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

User-Setting has preference over Workspace-Setting #1074

Closed
bluemoehre opened this issue Nov 19, 2019 · 3 comments
Closed

User-Setting has preference over Workspace-Setting #1074

bluemoehre opened this issue Nov 19, 2019 · 3 comments
Labels
bug locked Please open a new issue and fill out the template instead of commenting.

Comments

@bluemoehre
Copy link

bluemoehre commented Nov 19, 2019

Summary

In version 3.4.0 a change was introduced which causes my User-Setting to have preference over the Workspace-Settings. (I just updated from 3.3.x)

Steps To Reproduce:

  1. add .prettierrc with { "printWidth": 120 } to your project
  2. Goto VSCode PreferencesSettingsUser and set semi: false + printWidth: 40
  3. add a random JS file having multiple lines of code with more than 120 chars
  4. use >Format document (with Prettier)

Expected result

Code lines will be wrapped before 120 chars
Code has semicolons at the end of every line, since that's Prettier's default and a config file was provided, which does not touch that.

Actual result

Code lines are wrapped correctly (according to .prettierrc)
Code has NO semicolons (according to User-Settings)

Additional information

If .prettierrc or similar config is provided there should be no unexpected mix between User-Settings & config file. Settings not provided by .prettierrc should fallback to Prettier's default, else you will need to provide a full detailed config file to guarantee overwriting all User-Settings.

See also:
https://code.visualstudio.com/docs/getstarted/settings

Workspace settings override user settings. Workspace settings are specific to a project and can be shared across developers on a project.

Reverting back to 3.3.0 the behavior is good again.

VS Code Version:
1.40.1

Prettier & Prettier Plugin Version:
3.7.0

OS and version:
MacOS 10.14.6

@ntotten
Copy link
Member

ntotten commented Nov 19, 2019

Fixed in 3.8.0 and added tests to ensure it doesn't regress. Thanks!

@ntotten ntotten added the bug label Nov 19, 2019
@chrisj-skinner
Copy link

This update has caused my prettier to ignore my single quotes and is now making everything double quotes. No changes to my settings json in VSCODE where made apart from updating this plugin.
I was only using the VSCODE extension and had no need for a .prettierrc file, nor did I have prettier installed as a dependency in my project. Everything worked fine until this update.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 20, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

3 participants