I work with vue project that add a eslint file to define some rules. And I also use vscode extension to format the code when pressing alt + shift + f
.
I want the formatted code followed the rule that defined in the eslint file of the project.
How can I do that?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (5)
May be I get the point
dev.to/ferasdawod/setting-up-eslin...
There is a setting available in ESLint extension for that! Open this marketplace.visualstudio.com/items... and look for
eslint.format.enable
under theSettings Options
. If you set ESlint as the default formatter, it should be the one formatting your code onShift + Alt + F
.I apparently forgot I was using lint--I was tearing my hair out trying to get formatting shortcuts to work! Thx
Please install these extensions on your vscode:
You can use prettier but it'll conflict with vetur formatting. I wanted to do the same thing, but it's just not worth it, with larger projects having eslints with popular configs like airbnb, a lot of issues arise, I had set it up on my work machine and it used to throw hundreds of errors, removed it at the end.