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

Trailing commas setting does not work #54

Closed
markbrouch opened this issue Mar 20, 2017 · 9 comments
Closed

Trailing commas setting does not work #54

markbrouch opened this issue Mar 20, 2017 · 9 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@markbrouch
Copy link

Using v0.11.0 trailing commas are always added, even when User Settings or Workspace Settings contains "prettier.trailingComma": "none".

@markbrouch
Copy link
Author

Update - issue was I had an old version of prettier installed in node_modules. Is there a way to override the extension so that it uses the version of prettier installed with the extension instead of the project?

@jupiterzzz
Copy link

jupiterzzz commented Mar 21, 2017

I got the "Validation Error" Issue when I installed 0.11.0 version of this extension.
I found a workaround for this, by installing previous version (0.10.1) from URL:

https://esbenp.gallery.vsassets.io/_apis/public/gallery/publisher/esbenp/extension/prettier-vscode/0.10.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

simply rename it to .VSIX and install.

@CiGit
Copy link
Member

CiGit commented Mar 21, 2017

@markbrouch it's not possible to use the bundled version over the project one (with the latest release). I'm curious, why would you prefer to use a different version from the project one?

@jupiterzzz What do you mean by Validation Error ?

@gusvargas
Copy link

gusvargas commented Mar 21, 2017

I was on prettier@v0.17.1 and after upgrading to the latest prettier-vscode formatting stopped working completely. After upgrading my local prettier to 0.22.0 it all started to work again as expected.

@CiGit I also experienced what @jupiterzzz described – after upgrading prettier-vscode while on an old version of prettier VSCode would display a generic looking "Validation Error" banner with no context as to what caused the error – it was strange. Still not sure what caused the error but again, upgrading local prettier seemed to resolve the issue.

@CiGit
Copy link
Member

CiGit commented Mar 21, 2017

Found out the Validation Error problem. The hidden message is

Option "trailingComma" must be of type:
    boolean
  but instead received:
    string

  Example:
  {
    "trailingComma": false
  }

This is due to how we handle settings and the trailing comma change between different versions.
By default we pass in "none". Prettier 0.19.0 changed this option from a boolean value to a string value. It may be possible to set your setting explicitly to true/false if you really want to use a version older than 0.19.0.

@markbrouch
Copy link
Author

@CiGit good point - don't really need to use different version than what's in project. Just had a weird circumstance where I couldn't update project right away but wanted to try out a newer version of Prettier.

@esbenp
Copy link
Contributor

esbenp commented Mar 29, 2017

We should close this in favour of #55, yeah? @CiGit

@CiGit
Copy link
Member

CiGit commented Mar 29, 2017

Seems fair enough

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

No branches or pull requests

5 participants