Closed jdgamble555 closed 2 years ago
What happens if you remove the "eslint.nodePath"
setting?
Here is a simple playground that uses ESLint >= 8.0. Does that one work for you?
@MariaSolOs - Nothing. I would think the opposite would be true. Having that set is what should make it work? Correct?
@dbaeumer - No, it does not. The same error. I uninstalled and reinstalled eslint globally.
Here is my whole global settings.json
file:
{
"material-icon-theme.showWelcomeMessage": false,
"files.autoSave": "afterDelay",
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[json]": {
"editor.defaultFormatter": "SimonSiefke.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"javascript.updateImportsOnFileMove.enabled": "always",
"[graphql]": {
"editor.defaultFormatter": "SimonSiefke.prettier-vscode"
},
"wallaby.codeLensFeature.runTest": true,
"workbench.editor.revealIfOpen": false,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"svelte.enable-ts-plugin": true,
"editor.bracketPairColorization.enabled": true,
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"go.toolsManagement.autoUpdate": true,
"terminal.integrated.enableMultiLinePasteWarning": false,
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"vue",
"html",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"angular"
],
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"eslint.useESLintClass": true
}
J
@MariaSolOs Nothing. I would think the opposite would be true. Having that set is what should make it work? Correct?
I might be wrong, but I thought that there was no need to set "eslint.nodePath"
when the module is installed globally.
I am sure you did but did you run npm install
in that directory before testing it?
Are you using yarn or some other package manager.
And @MariaSolOs is right. there is usually no need to tinker with eslint.nodePath
. We get the global installation path by running npm
.
One other idea is to clean the node cache. May be the cached npm module is corrupted.
Does eslint work in the terminal for you in that playground by executing ./node_modules/.bin/eslint --version
in the playground directory.
@jdgamble555 Based on how the library is loaded here, I would also suggest removing the "eslint.workingDirectories"
setting (together with "eslint.nodePath"
).
@dbaeumer - Yes, eslint works fine outside of VS Code. Running the command prints 8.23.1
as espected.
I have removed all other settings in my global settings.json
file so I have:
{
"material-icon-theme.showWelcomeMessage": false,
"files.autoSave": "afterDelay",
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[json]": {
"editor.defaultFormatter": "SimonSiefke.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"javascript.updateImportsOnFileMove.enabled": "always",
"[graphql]": {
"editor.defaultFormatter": "SimonSiefke.prettier-vscode"
},
"wallaby.codeLensFeature.runTest": true,
"workbench.editor.revealIfOpen": false,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"svelte.enable-ts-plugin": true,
"editor.bracketPairColorization.enabled": true,
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"go.toolsManagement.autoUpdate": true,
"terminal.integrated.enableMultiLinePasteWarning": false,
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"vue",
"html",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact"
]
}
I believe this is a bug in all versions after v7.32.0,
as it works before that version. Has anyone actually gotten v8
to work on Windows 11 with VS Code and the latest version of eslint plugin for VS Code? I have a feeling no one has tested this, hence why it does not work on these setups.
Thanks,
J
Almost all my repositories use ESlint v8, together with the lastest VS Code and ESLint plugin. You might want to clone this one (https://github.com/microsoft/vscode-eslint.git) and do the following:
npm install
Please note that this repository uses a locally installed eslint. Try this with an empty global settings file:
And here an example with ESLint v8 loaded from a global location.
Global eslint version is v8.23.1
It does not load (I'm ignoring the other errors). I tried uninstalling and reinstalling eslint
globally with the same result.
J
@jdgamble555 do you have several versions of node
installed in your computer?
No, I do not.
J
So I got it working. I uninstalled all of my VS Code extensions and reopened my projects. Everything works now. I do not know which specific plugin caused the issue.
Thank you guys for all of your help!
J
I CAN get eslint to work in my projects if I run:
npm i -D eslint@7.32.0
However, all of the newest versions of frameworks don't support this version. Angular and Sveltekit, for example, now use the latest version 8.
I am using Windows 11 with Powershell. All of my projects give the same error.
In both my local
.vsocde/settings.json
and globalsettings.json
file I have this:I have uninstalled and reinstalled eslint gloabally
npm i -g eslint
.No matter what I do, I still get this error even on a brand new clean project.
I have ESLint VS Code Extension v2.2.6 (latest).
How can I get version 8 working on my Windows machine?
Thanks,
J