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.

`printWidth` not enforced on save

See original GitHub issue

Today, when saving a document, prettier is not respecting the printWidth value in my application settings.

vscode settings

I added a .prettierrc file to my project to try to force the desired (default) printWidth of 80:

{
  "printWidth": 80,
  "indent": 2
}

I setup rulers at 80 and 120 to test, and 120 is being used for all files.

screen shot 2018-04-13 at 1 14 04 pm

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
philsinatracommented, Apr 19, 2018

It seems integrating eslint-config-prettier as the last config gets formatOnSave working with the max-len @80.

1reaction
philsinatracommented, Apr 19, 2018

I’ve tried using both error and warning for the max-length rule, either way the result is the same. formatOnSave always wraps @120 and the linter reports the error/warning message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

prettier printWidth setting is not formatting correctly on save
I think your vscode config and settings and .prettier are not the same. try creating .prettierrc file in your project root and add...
Read more >
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 >
prettier-plugin-apex vscode printWidth not working
I need to update the .prettierrc in root directory, not the extension settings { "trailingComma": "none", "overrides": [ { "files": ...
Read more >
prettier printWidth setting is not formatting correctly on save ...
[Solved]-prettier printWidth setting is not formatting correctly on save-Reactjs. Search. score:1 ... Setting a default value with react-select not working ...
Read more >
Visual Studio Code and Prettier not respecting print width field
I read there was no built in support for formatting apex and it was suggested to install Prettier, which I have done. When...
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