question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option "printWidth" must be of type

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
CiGitcommented, Dec 14, 2017

@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)
3reactions
CiGitcommented, Dec 13, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options - Prettier
Prettier's printWidth option does not work the same way. It is not the hard upper allowed line length limit. It is a way...
Read more >
VSCode prettier's printWidth - Stack Overflow
If yes, open the "Output" tab in VS Code and try to format the file. What do you see as output (you might...
Read more >
VS Code Prettier Setting: prettier.printWidth - YouTube
Want to master VS Code? Click here: https://andrecasal.com/courses/mastery-for-vs-codeWant to upgrade web dev skills?
Read more >
Visual Studio Code and Prettier not respecting print width field
Visual Studio Code and Prettier not respecting print width field. Hi all, I have decided to swap from the dev console to visual...
Read more >
How to use the prettier.formatWithCursor function in prettier
{ printWidth?: number }>); // $ExpectError (Options should have proper types) ... Test return types */ let result; result = prettier.format(code); (result: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found