Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dvlpwhite0216 opened this issue Dec 23, 2020 · 1 comment
Open

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

Dvlpwhite0216 opened this issue Dec 23, 2020 · 1 comment
Labels

Comments

@Dvlpwhite0216
Copy link

  • [√] I have searched through existing issues
  • [√] I have read through docs
  • [√] I have read FAQ

Info

  • Platform: win
  • Vetur/VLS version: 0.31.3
  • VS Code (or other LSP client) version: latest

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 xxxx 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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants