Closed brentgreeff closed 2 years ago
Also getting this, but only on certain projects...
I dug into this and it turns out it's an artifact of #1440.
CLIEngine
was deprecated in ESLint v7 and is now absent in v8. That, I think, is ultimately why fileConfig
is null in this code block, and why all attempts to communicate with the worker result in the worker immediately sending back an empty array instead of the response message that getDebugInfo
expects when it sends a “debug” job to the worker. The assumption that the response will be present is what triggers this error.
I'm not saying this is a duplicate, mind you. That the cause of this problem is so far away from how it's presented to the user is likely its own problem that could be improved. Some more sanity checking could be helpful here, like testing for the presence of CLIEngine
and explicitly stopping and showing a notification if it's not there.
If this package is ever able to support ESLint 8 (whether by JS API integration or CLI output), this code path will get more paranoid anyway, as it won't be able to simply assume that CLIEngine
exists anymore. If it won't support ESLint 8, and we all end up having to install a new linter-eslint-8
or something, then this should still be fixed, so it can explain to people why linter-eslint
is silently failing and point them to the new package.
I'm keeping my eye on #1442 to see what the outcome is. If you absolutely need Atom-integrated linting for your project, you'll have to downgrade it to ESLint 7 until this gets worked out.
Perhaps it’s useful for some context, so I’m leaving this here.
I had the same issue on a brand new Vue project initialised with npm init vue@latest
(so Vite + Eslint 8). I was wondering why I didn’t have any in-editor linting when the lint
command worked fine in the terminal and did some investigating. When I tried getting the linter-eslint debug info, I ran into this error at first.
However, as soon as I disabled the checkbox next to "Disable when no ESLint config is found" in the plugin settings, the Linter ESLint: Debug
command started working again (although I’m still not able to lint files because of #1448 or something relating to that).
For eslint v8+ you should use linter-eslint-node.
Question
Issue Description
Eslint: Debug throws error when running
Linter Eslint: Debug
Bug Checklist
eslint
CLI gives the proper result, whilelinter-eslint
does notLinter Eslint: Debug
command from the Command Palette belowHaving issue with a fresh project - "eslint": "^8.6.0" I get the error
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
but one of the times I ran the command in Atom - it worked, and returnedI noticed I also had some Vue & Java stuff hanging around - I disabled those packages and restarted Atom but didnt help.
Running
./node_modules/.bin/eslint .
works great - I see the correct warnings.I am using
packages/atom-typescript
- and that works great.Here is my eslint
./node_modules/.bin/eslint --debug