diff --git a/src/cli/index.ts b/src/cli/index.ts index 80e9684e57..929fe03b4a 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -30,8 +30,9 @@ import HttpStream from '../formatter/http_stream' import { promisify } from 'util' import { Writable } from 'stream' import { pathToFileURL } from 'url' -import importer from '../importer' +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { importer } = require('../importer') const { incrementing, uuid } = IdGenerator export interface ICliRunResult { diff --git a/src/formatter/builder.ts b/src/formatter/builder.ts index 113ea23abc..72862b0740 100644 --- a/src/formatter/builder.ts +++ b/src/formatter/builder.ts @@ -21,7 +21,8 @@ import { IParsedArgvFormatOptions } from '../cli/argv_parser' import { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax' import HtmlFormatter from './html_formatter' import { pathToFileURL } from 'url' -import importer from '../importer' +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { importer } = require('../importer') interface IGetStepDefinitionSnippetBuilderOptions { cwd: string diff --git a/src/importer.js b/src/importer.js index 7fbfb1da10..56bc57fab2 100644 --- a/src/importer.js +++ b/src/importer.js @@ -12,4 +12,4 @@ async function importer(descriptor) { return await import(descriptor) } -module.exports = importer +module.exports = { importer } diff --git a/src/runtime/parallel/worker.ts b/src/runtime/parallel/worker.ts index ec2271b937..b8b42b38b4 100644 --- a/src/runtime/parallel/worker.ts +++ b/src/runtime/parallel/worker.ts @@ -19,8 +19,9 @@ import { IRuntimeOptions } from '../index' import { PredictableTestRunStopwatch, RealTestRunStopwatch } from '../stopwatch' import { duration } from 'durations' import { pathToFileURL } from 'url' -import importer from '../../importer' +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { importer } = require('../../importer') const { uuid } = IdGenerator type IExitFunction = (exitCode: number, error?: Error, message?: string) => void diff --git a/tsconfig.json b/tsconfig.json index 7d1e4e6851..b9d4b64ad9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "allowJs": true, "esModuleInterop": true, "lib": ["es2019"], "module": "commonjs",