How to Fix ESLint Errors Upon Save in VS Code
Two of the most prominent utilities in web development today are ESLint and Microsoft's Visual Studio Code. I enjoy using both, and I love the integration between both tools, but warnings from ESLint inside Visual Studio Code aren't fulfilling -- I'd rather lint errors be fixed each time I save.
Complete the following steps to make Visual Studio Code fix any lint errors when a file is saved:
- Open the following file path:
~/Library/Application Support/Code/User/settings.json
- Within the JSON structure, add the following:
{
// ... Existing JSON here ...
"editor.codeActionsOnSave": {
"source.fixAll": true
}
}
Every time you save applicable files within Visual Studio Code, ESLint will be run to fix any errors.
For me this is a massive time savings. There is some risk that this task might take a while one large files but for me it's worth it.
![Conquering Impostor Syndrome]()
Two years ago I documented my struggles with Imposter Syndrome and the response was immense. I received messages of support and commiseration from new web developers, veteran engineers, and even persons of all experience levels in other professions. I've even caught myself reading the post...
![LightFace: Facebook Lightbox for MooTools]()
One of the web components I've always loved has been Facebook's modal dialog. This "lightbox" isn't like others: no dark overlay, no obnoxious animating to size, and it doesn't try to do "too much." With Facebook's dialog in mind, I've created LightFace: a Facebook lightbox...
![Create a Trailing Mouse Cursor Effect Using MooTools]()
Remember the old days of DHTML and effects that were an achievement to create but had absolutely no value? Well, a trailing mouse cursor script is sorta like that. And I'm sorta the type of guy that creates effects just because I can.
![CSS 3D Folding Animation]()
Google Plus provides loads of inspiration for front-end developers, especially when it comes to the CSS and JavaScript wonders they create. Last year I duplicated their incredible PhotoStack effect with both MooTools and pure CSS; this time I'm going to duplicate...
This is going to save a lot of my time! Thanks a lot for this :)
It would better to save this in the project root under .vscode/settings.json to ensure the config is consistent across the whole team – otherwise it kinda defeats the point of having eslint.
https://github.com/olmesm/better-cypress-axe/blob/master/.vscode
Tnx for the info, was useful to read. I use Microsoft’s Visual Studio Code and I like how it works.