From fdaf549e1f2e562384adb1820e107ec1f4015119 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen Date: Mon, 16 Oct 2023 18:28:50 -0300 Subject: [PATCH] removed variable requires --- apps/meteor/app/importer-csv/server/importer.ts | 4 +--- apps/meteor/app/importer-slack-users/server/importer.ts | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/meteor/app/importer-csv/server/importer.ts b/apps/meteor/app/importer-csv/server/importer.ts index b53142b866bb..512392ef7ffc 100644 --- a/apps/meteor/app/importer-csv/server/importer.ts +++ b/apps/meteor/app/importer-csv/server/importer.ts @@ -1,6 +1,7 @@ import type { IImport } from '@rocket.chat/core-typings'; import { Settings, Users } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; +import { parse } from 'csv-parse/lib/sync'; import { Importer, ProgressStep, ImporterWebsocket } from '../../importer/server'; import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter'; @@ -13,9 +14,6 @@ export class CsvImporter extends Importer { constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) { super(info, importRecord, converterOptions); - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { parse } = require('csv-parse/lib/sync'); - this.csvParser = parse; } diff --git a/apps/meteor/app/importer-slack-users/server/importer.ts b/apps/meteor/app/importer-slack-users/server/importer.ts index 0ba903d2f2f3..90957213aa52 100644 --- a/apps/meteor/app/importer-slack-users/server/importer.ts +++ b/apps/meteor/app/importer-slack-users/server/importer.ts @@ -2,6 +2,7 @@ import fs from 'fs'; import type { IImport, IImportUser } from '@rocket.chat/core-typings'; import { Settings } from '@rocket.chat/models'; +import { parse } from 'csv-parse/lib/sync'; import { RocketChatFile } from '../../file/server'; import { Importer, ProgressStep } from '../../importer/server'; @@ -15,8 +16,6 @@ export class SlackUsersImporter extends Importer { constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) { super(info, importRecord, converterOptions); - const { parse } = require('csv-parse/lib/sync'); - this.csvParser = parse; }