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

why this plugin ignore .prettierrc? how should i use it #12

Closed
uniquejava opened this issue Apr 6, 2022 · 6 comments
Closed

why this plugin ignore .prettierrc? how should i use it #12

uniquejava opened this issue Apr 6, 2022 · 6 comments

Comments

@uniquejava
Copy link

uniquejava commented Apr 6, 2022

From my experience, for any vue project, eslint + prettier is a must and prettier config should be considered with higher priority.

I created a brand new project with npm init vue@latest, and I ticked eslint + prettier.

I created a .prettierrc file in my vue project root folder

{
  "printWidth": 120,
  "tabWidth": 2,
  "singleQuote": true,
  "bracketSpacing": true,
  "trailingComma": "all",
  "semi": false,
  "useTabs": false,
}

now my vscode starts complaining...

image

If i remove '@vue/eslint-config-prettier', from .eslintrc.js, everything works normally again.

so my question is why we have this plugin built-in in vue-cli, how should I use it.

@yyx990803 尤大

@sodatea
Copy link
Member

sodatea commented Jun 16, 2022

Can't reproduce. Could you please provide a reproduction repo?

@uniquejava
Copy link
Author

The typescript file works this time 👍 (I think there must be some changes done in the past 2 months)

However, the vue and other files like cjs still not work.

reproduction repo:
https://github.com/uniquejava/prettier-not-work

@uniquejava
Copy link
Author

Update: the solution is to restart vs code

I found that after we create .prettierrc file, we need to restart vs code, otherwise vs code will still complain the eslint errors. (in vue file this time)

@TheGreatRefrigerator
Copy link

Update: the solution is to restart vs code

I found that after we create .prettierrc file, we need to restart vs code, otherwise vs code will still complain the eslint errors. (in vue file this time)

Same thing for WebStorm if somebody wonders...

@itapai
Copy link

itapai commented Sep 23, 2022

It's enough to restart the eslint server in vscode, you don't have to restart the entire vscode.

@p-kuen
Copy link
Contributor

p-kuen commented Jul 15, 2023

As this package only defines some simple eslint config, I believe this is no bug. It's normal that you have to restart the eslint server if you change the configuration. I think this should be closed.

@sodatea sodatea closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants