Skip to content

Commit

Permalink
fix: import non-ESM (CJS) packages with import/require syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Dec 28, 2021
1 parent 25a66f0 commit ab398aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/core-worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { parentPort } from 'worker_threads';
import { expose } from 'comlink';
import nodeEndpoint from 'comlink/dist/umd/node-adapter';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import nodeEndpoint = require('comlink/dist/umd/node-adapter');
import { ESLint } from 'eslint';
import { Core } from './core.js';
import { SuggestionFilter } from './transforms/apply-suggestions.js';
Expand Down
3 changes: 2 additions & 1 deletion src/formatter/format-by-rules.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import chalk from 'chalk';
import Table from 'cli-table';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import Table = require('cli-table');
import { ESLint } from 'eslint';
// import terminalLink from 'terminal-link';
import { ERROR_COLOR } from './colors.js';
Expand Down
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { join } from 'path';
import { Worker } from 'worker_threads';
import { wrap } from 'comlink';
import nodeEndpoint from 'comlink/dist/umd/node-adapter';
import isInstalledGlobally from 'is-installed-globally';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import nodeEndpoint = require('comlink/dist/umd/node-adapter');
// eslint-disable-next-line @typescript-eslint/no-require-imports
import isInstalledGlobally = require('is-installed-globally');
import { warn } from './cli/log.js';
import { parseArgv } from './cli/parse-argv.js';
import { SerializableCore } from './core-worker.js';
Expand Down

0 comments on commit ab398aa

Please sign in to comment.