Prettier-vscode: Default values for proseWrap are incorrect

Created on 20 Dec 2017  路  4Comments  路  Source: prettier/prettier-vscode

The default values for "prettier.proseWrap" are incorrect and cause prettier to fail. To get prettier to work in VSCode, I had to set "prettier.proseWrap" to true, which gives me a warning about it not being an accepted value.

image

The error:

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

  Example:
  {
    "proseWrap": true
  }
locked

Most helpful comment

Boolean values are those in prettier @1.8.x
These new values are valid with prettier @1.9.x which is the version we bundle.
Seems you have prettier @1.8 installed in your project. To use it, you should provide a .prettierrc file with at least one (1) rule in it. This will avoid some troubles with settings changes.

All 4 comments

Boolean values are those in prettier @1.8.x
These new values are valid with prettier @1.9.x which is the version we bundle.
Seems you have prettier @1.8 installed in your project. To use it, you should provide a .prettierrc file with at least one (1) rule in it. This will avoid some troubles with settings changes.

Answered

This causes unexpected errors when the project is using an older version of prettier.
Example: I've provisioned a project using CRA about 2 months ago and it got prettier ^1.8.2. Because of the yarn.lock it was never updated to the newer version. Now all of a sudden the extension has updated at some point and started erroring on me in the project it used to work before.

I understand it a non-trivial issue but probably the extension should have the idea of the minimal version of prettier it supports and
a) warn if the local version is lower
b) offer to use the bundled version in this case?

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.

Was this page helpful?
0 / 5 - 0 ratings