I was following tutorial to turn on ESLint Auto Fix on saving a file. Tutorial demonstrates to check a checkbox. And I cannot find it. Do I need any extension or smth?
Go to: View -> command pallete -> Preferences: Open Workspace Settings -> Extensions -> ESLint
This is how settings page look like in tutorial:
this is what I see:
If you have the ESLint extension installed you can use CTRL+SHIFT+P to open the Command Palette. Then search for ESLint: Fix all auto-fixable Problems and press ENTER (or RETURN ). You are free from counting indentation and checking for quotation marks and semicolons!
Click the “Settings” gear icon in the bottom-left corner. Search “Formatter” and click the “Editor: Default Formatter” option. From the drop-down menu, select whichever code formatter you want to use. Scroll down a bit and check the box next to the “Editor: Format On Save” option.
Clicking on the Code Action lightbulb or using the Quick Fix command Ctrl+. will display Quick Fixes and refactorings. If you'd just like to see refactorings without Quick Fixes, you can use the Refactor command (Ctrl+Shift+R).
The setting is deprecated. Auto Fix on Save is now part of VS Code's Code Action on Save infrastructure. See the release notes. Just for fun you can bring the checkbox back by adding "eslint.autoFixOnSave": true
to your settings.json. However, what you need to add now instead is:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With