typescript-eslint/tslint-to-eslint-config

TypeError: (0 , glob_1.default) is not a function

andreidiaconescu opened this issue ยท 5 comments

๐Ÿ› Bug Report

  • tslint-to-eslint-config version: 2.14.1
  • ESLint version: 8.54.0
  • Node version: 20.9.0

Actual Behavior

sudo npx tslint-to-eslint-config --comments

and i get the output including error

โœจ 114 rules replaced with their ESLint equivalents. โœจ

โ— 7 ESLint rules behave differently from their TSLint counterparts โ—
  Check ./tslint-to-eslint-config.log for details.
โŒ 1 error running tslint-to-eslint: โŒ
  TypeError: (0 , glob_1.default) is not a function
    at /mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/adapters/globAsync.js:10:28
    at new Promise (<anonymous>:null:null)
    at globAsync (/mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/adapters/globAsync.js:9:12)
    at Array.map (<anonymous>:null:null)
    at extractGlobPaths (/mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/converters/comments/extractGlobPaths.js:11:102)
    at convertComments (/mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/converters/comments/convertComments.js:28:49)
    at tryConvertConfig (/mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/cli/runCli.js:64:18)
    at runCli (/mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/cli/runCli.js:50:24)
    at Object.main (/mnt/otherLinuxPartition/var/www/kickstart/api/node_modules/tslint-to-eslint-config/src/cli/main.js:11:30)
  • the code comments are not actually modified
  • i got stuck

Expected Behavior

The command
sudo npx tslint-to-eslint-config --comments
should work and replace tslint comments with eslint comments.

Reproduction

This was introduced in c2572c1. v10 stopped supporting default export

I filed a PR to fix this. As a workaround, you can run with the following:

npx tslint-to-eslint-config@v2.14.0 --comments

hello,
thank you,
when i run
npx tslint-to-eslint-config@v2.14.0 --comments
i get error:

โœจ 114 rules replaced with their ESLint equivalents. โœจ

โ— 7 ESLint rules behave differently from their TSLint counterparts โ—
  Check ./tslint-to-eslint-config.log for details.
โŒ 2 errors running tslint-to-eslint: โŒ
  Error: EISDIR: illegal operation on a directory, read

  Error: EISDIR: illegal operation on a directory, read

I see - those errors have been fixed by #1717, which unfortunately is included in v2.14.1. I tried to run npx 'git+https://github.com/typescript-eslint/tslint-to-eslint-config.git#HEAD' --comments, but unfortunately that does not seem to work for me (which should have put you to the latest version).

The errors you are getting with v2.14.0 are fortunately not fatal, so even if you get errors, the program should work. Once v2.14.2 is released, you can of course use that version.