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

Vetur settings in vscode settings.json doen't respect .prettierrc. How can I fix it? #1407

Closed
3 tasks done
testgit-1 opened this issue Aug 27, 2019 · 3 comments
Closed
3 tasks done

Comments

@testgit-1
Copy link

testgit-1 commented Aug 27, 2019

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Win 10
  • Vetur version: 0.22.2
  • VS Code version: 1.37.1

Problem

If vetur format config is set in settings.json the setting in .prettierrc doesn't work.

GIF

Reproducible Case

  1. Set in project root file .prettierrc
{
    "tabWidth": 2,
    "useTabs": false,
    "singleQuote": true
}
  1. Use formatting. It will use settings from .prettierrc
  2. Set in settings.json
    "vetur.format.options.tabSize": 4,
    "vetur.format.options.useTabs": true,
  1. Use formatting. It will use settings from setting.json.
    But due to documentation it should "However, when a local config (such as .prettierrc) is found, Vetur will prefer it." ( https://vuejs.github.io/vetur/formatting.html#settings )
@octref
Copy link
Member

octref commented Sep 5, 2019

I changed it to the exact setting you have, and it''s working fine for me: octref/veturpack@a536a1c

Maybe you are using Prettier instead of Vetur's Formatter? You can check in the command "Format Document with...":

image

@Timmmm
Copy link

Timmmm commented Nov 8, 2019

I don't have a Format Document with command (I assume because it only found one formatter), and I'm having a similar problem. Vetur seems to ignore .prettierrc.js. Is there any way to make it print the command it is running?

@octref
Copy link
Member

octref commented Feb 11, 2020

In the next version you can set "vetur.dev.logLevel": "DEBUG" and Vetur will print prettier config that it loads:

image

Please include a reproducible case and open a new issue, if this still doesn't work.

@octref octref closed this as completed Feb 11, 2020
octref added a commit that referenced this issue Feb 11, 2020
octref added a commit that referenced this issue Feb 11, 2020
@octref octref added this to the February 2020 milestone Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants