DEV Community

ESLint not working in VS CODE?

Raffaele Pizzari on April 04, 2019

(check out my blog) Hi Raffaele, this a note from your old self. I know that ESLint is not working in VS Code. You have already installed all th...
Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • • Edited

I got this warning, Auto Fix is enabled by default. Use the single string form.

So, I changed it to,

"eslint.validate": [
        "vue",
        "html",
        "javascript",
        "typescript",
        "javascriptreact",
        "typescriptreact"
    ]
Enter fullscreen mode Exit fullscreen mode

However, according to github.com/Microsoft/vscode-eslint..., mixed form or autofix: false should work as well.

Also, my .eslintignore, for extra fun!

!**/.eslintrc*
node_modules*
dist
*.svg
*.ico
*.json
.gitignore
*.md
*.log
*.lock
Enter fullscreen mode Exit fullscreen mode
Collapse
 
dutradotdev profile image
lucas •

this helped me too, tks!

Collapse
 
dmudro profile image
David Mudro •

Nice one, this hint is going the right direction.

I'd just add check your user settings.json before blindly sticking the same eslint.validate JSON config in each workspace individually.

Collapse
 
luisreyes98 profile image
Luis Reyes •

Thank you so so much

Collapse
 
stevemu profile image
Qi Mu •

Thank you! This is so helpful!

Collapse
 
frankapiyo profile image
Frankline Apiyo •

should the settings be added to ./vscode/settings.json or .vscode/settings.json? is it possible that this is an error in your post because it only worked for me with the latter.

Collapse
 
frankapiyo profile image
Frankline Apiyo •

nice post though.

Collapse
 
vadikenaladiken profile image
Vadikenaladiken •

Nice hint bro! Saved my life!

Collapse
 
kasiriveni profile image
Srinivas Kasiriveni •

Nice tip

Collapse
 
crenshaw_dev profile image
Michael Crenshaw •

Future not to me: install the ESLint plugin too. :-)

Collapse
 
johndavidbell profile image
JD Bell •

The Dollyrots' "Because I'm Awesome" was definitely inspired by you. Thanks.

Collapse
 
miteshp030 profile image
Mitesh • • Edited

I am getting End of file expected. error on pasting below in settings.json

"eslint.validate":[

{

"language":"vue",
"autoFix":true
},
{

"language":"html",
"autoFix":true
},
{

"language":"javascript",
"autoFix":true
},
{

"language":"typescript",
"autoFix":true
}
]

Collapse
 
dpagey profile image
Pagey • • Edited

Life saver! ๐Ÿงก

Collapse
 
dutradotdev profile image
lucas •

tks a lot man, saved my life

Collapse
 
pierrecordier profile image
Pierre Cordier •

Alt text of image

Collapse
 
amitkum66494760 profile image
Amit Yadav •

thanks man

Collapse
 
jjoselv profile image
Juanjo Lopez •

Holly s*** it worked...
github.com/mdx-js/eslint-mdx/issue...