mizdra / eslint-interactive

The CLI tool to fix huge number of ESLint errors
MIT License
363 stars 9 forks source link

`applySuggestions` hangs on "Opening editor..." #347

Closed eddie-dunn closed 4 months ago

eddie-dunn commented 7 months ago

image

I ran eslint-interactive via npx. OS is Fedora Silverblue 39.

mizdra commented 6 months ago

@eddie-dunn I think this is the same as #328. Could you try the solution described in the issue?

eddie-dunn commented 5 months ago

It might be related -- whlie EDITOR is set in my shell, fish, I don't remember if I used fish when I reported the "Opening editor..." issue.

Unfortunately, I cannot try again as I'm now getting this error:

❯ npx eslint-interactive .
✖ Linting...
Error: Could not find config file.
    at locateConfigFileToUse (/var/home/username/.npm/_npx/81916b408d06f96a/node_modules/eslint/lib/eslint/eslint.js:348:21)
    at async calculateConfigArray (/var/home/username/.npm/_npx/81916b408d06f96a/node_modules/eslint/lib/eslint/eslint.js:383:49)
    at async ESLint.lintFiles (/var/home/username/.npm/_npx/81916b408d06f96a/node_modules/eslint/lib/eslint/eslint.js:790:25)
    at Core.lint (/var/home/username/.npm/_npx/81916b408d06f96a/node_modules/eslint-interactive/src/core.ts:64:19)

I'm assuming it's looking for an eslint config file? The repo does have one:

❯ ls -al | grep eslintrc
-rw-r--r--. 1 username username   5918 25 mar 11.24 .eslintrc.js
mizdra commented 5 months ago

Probably because eslint-interactive is using ESLint v9. ESLint v9 loads the flat config by default, not the legacy config. The .eslintrc.js is not loaded by default because it is a legacy config.

To load the legacy config, start eslint-interactive with the ESLINT_USE_FLAT_CONFIG=false environment variable set.

mizdra commented 4 months ago

Please try https://github.com/mizdra/eslint-interactive/issues/347#issuecomment-2084150296 :)