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.
![Detect DOM Node Insertions with JavaScript and CSS Animations]()
I work with an awesome cast of developers at Mozilla, and one of them in Daniel Buchner. Daniel's shared with me an awesome strategy for detecting when nodes have been injected into a parent node without using the deprecated DOM Events API.
![Create a Sheen Logo Effect with CSS]()
I was inspired when I first saw Addy Osmani's original ShineTime blog post. The hover sheen effect is simple but awesome. When I started my blog redesign, I really wanted to use a sheen effect with my logo. Using two HTML elements and...
![Google Extension Effect with CSS or jQuery or MooTools JavaScript]()
Both of the two great browser vendors, Google and Mozilla, have Extensions pages that utilize simple but classy animation effects to enhance the page. One of the extensions used by Google is a basic margin-top animation to switch between two panes: a graphic pane...
![MooTools Equal Heights Plugin: Equalizer]()
Keeping equal heights between elements within the same container can be hugely important for the sake of a pretty page. Unfortunately sometimes keeping columns the same height can't be done with CSS -- you need a little help from your JavaScript friends. Well...now you're...
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.