vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 594 forks source link

how to set the js formatter use the standard js style? #2590

Open Dvlpwhite0216 opened 3 years ago

Dvlpwhite0216 commented 3 years ago

Info

Problem

I create a new project, in this project i use eslint and vetur to check and format my code. Because eslint cannot format the content in .vue file, also it can't fix the problem like i insert 2 or more spaces between the function name and "(" , so I use the vetur.But because i set the eslint style as the standard, whatever formatter i choose(vetur.format.defaultFormatter.js), it always has error because the fomat rule is different from the standard js style.When i save the .vue or .js file, the vscode will change my code twice, first the eslint standard style ,second the vetur style, then it saves. And than it thow error.I try to donot use the vetur formatter for js and only for templates, but like i said in the beginning, if i write" function abc( xx ) ",eslint can detect it and fix it, when i write "function abc (xxx)", eslint cannot help me anymore. And i want to know how to set the vetur's js formmater rule to use the standard style.

Reproducible

yoyo930021 commented 3 years ago

I think you can set prettier-eslint. and set standard plugins and rule in eslint.