prettier-vscode: Option "printWidth" must be of type

Hello, How can I solve this? It used to work just fine, and start getting this error since yesterday. ` Option “printWidth” must be of type: number but instead received: string

Example: { “printWidth”: 80 }`

I’m new to VSCode, How can I solve this? Thanks

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 15 (5 by maintainers)

Most upvoted comments

@ray-su For proseWrap, this is certainly because you have a prettier 1.8 installed locally. 3 solutions:

  • update it
  • use a prettier config file with {"proseWrap": true}
  • set prettier.proseWrap to true in vscode settings (you will have a JSON validation warning)

By editorconfig, I mean a file so named. prettier.resolveConfig reads it. printWidth comes from https://github.com/josephfrazier/editorconfig-to-prettier/blob/29aa34459dfec238ce179f1eb5a4fdcefb9c4961/index.js#L30-L32

max_line_length is what is transformed to printWidth

im also having this issue. i have integers for all of the printWidth values. is printWidth supported by editorConfig? its not listed

I’m also having this issue. I’ve removed all prettier configurations and just using the default plugin options and still seeing this error.

I found this in my setting:

"prettier.printWidth": 80,

It is a number. Is this a bug from VSCode?