Eslint with .vue extension How to Auto fix it? #6191

Closed
midascodebreaker opened this Issue May 15, 2016 · 3 comments

Projects

None yet

5 participants

@midascodebreaker

I added eslint in atom editor,
and and added my eslintrc.js with eslint --init...
i added html plugin also globally...

yes it linted the error in .vue file but on save it cannot fix it...
do i need additional plugin for this?

coz eslint works by fixing only .js files....

Hope someone can give me clarity about this thanks

@eslintbot eslintbot added the triage label May 15, 2016
@ilyavolodin ilyavolodin added question and removed triage labels May 16, 2016
@ilyavolodin
Member

Autofixing should work with any extension (correct me if I'm wrong). I'm assuming this has something to do with Linter-ESLint. Maybe it's hardcoding autofixing only to js files? You might want to open an issue there.

@platinumazure
Member

@ilyavolodin Just a note: Auto-fix works fine if it's only the extension that is different and no preprocessing needs to be done on the file. If preprocessing is needed (to extract lint-ready JavaScript), then auto-fix won't work because the locations will be wrong.

@midascodebreaker As mentioned above, you should ask in the linter-eslint repository.

@nzakas
Member
nzakas commented May 16, 2016

@midascodebreaker as @platinumazure pointed out, we can only autofix regular JavaScript files. Since .vue files are really HTML files, you'd need a preprocessor to get it to work in ESLint, and ESLint doesn't currently support autofixing in preprocessed files.

@nzakas nzakas closed this May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment