Using v0.11.0 trailing commas are always added, even when User Settings or Workspace Settings contains "prettier.trailingComma": "none".
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?
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:
simply rename it to .VSIX and install.
@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 ?
I was on [email protected] 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.
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.
@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.
We should close this in favour of #55, yeah? @CiGit
Seems fair enough
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.
Most helpful comment
Found out the Validation Error problem. The hidden message is
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 totrue/falseif you really want to use a version older than 0.19.0.