Autofix does not work on .vue files
See original GitHub issueI’m using ESLint with vue-eslint-parser then I enabled vscode-eslint
for .vue
files.
vue-eslint-parser
supports autofix for .vue
files. But eslint.autoFixOnSave
option and eslint.executeAutofix
command did not work on .vue
files.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:32 (23 by maintainers)
Top Results From Across the Web
How to use eslint autofix in .vue? - Stack Overflow
Try to use it with specifying files extensions eslint --fix --ext .js,.vue src.
Read more >VSCode - Fix eslint autofix not work in .vue file - Sing's Log
VSCode - Fix eslint autofix not work in .vue file · Install ESLint extension · Open settings.json by pressing Ctrl, · Add following...
Read more >ESLint and Prettier with Vite and Vue.js 3 - Vue School Blog
Now we've got ESLint reporting the errors directly in the file but we don't have any automation setup for Prettier to reformat the...
Read more >Auto-fix linting errors with vue-cli 3 : r/vuejs - Reddit
This would be what I'd do. Having a process that's not my editor change and save files blindly sounds like a bad time....
Read more >Share your .eslintrc, auto-fix on save, and related config files
Do you know that Visual Studio Code itself can auto-fix your code ... Currently, I auto-fixes TypeScript, JavaScript, Vue, Markdown files.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I only add this to settings.json and it works :
I published version 1.2.2 of the ESLint extension. It allows for selective autoFix configuration. From the readme:
Added configuration options to enable code actions and auto fix on save selectively per language. In release 1.2.1 code actions and auto fix on save very still only available for JavaScript. In 1.2.2 you can now enable this selectively per language. For compatibility it is enabled by default for JavaScript and disabled by default for all other languages. The reason is that I encounter cases for non JavaScript file types where the computed fixes had wrong positions resulting in ‘broken’ documents. To enable it simply provide an object literal in the validate setting with the properties
language
andautoFix
instead of a simplestring
. An example is: