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.

Possible mistake in behavior of "prettier.requireConfig"

See original GitHub issue

From the README file: image

The extension is enabled. I don’t have a .prettierrc file. I do have an .editorconfig file.

My settings.json: image

When I format a document I expect that prettier not to work (due to the settings). But when I right-click and format the document, the document is formatted and in the Prettier terminal I receive this message: image

While the docs mention that using prettier.requireConfig will enable prettier only if a prettier config file is present, the real behavior (and as seen in the terminal message is that prettier is being used if a prettier config or an editorconfig files are present.

I’m working on several projects that some have prettier and some not. I want to use this property (prettier.requireConfig) to enable prettier conditionally only if a .prettierrc is present

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Cotehcommented, Jun 19, 2021

Just ran into this issue while taking a look at the mithril project. They have an .editorconfig file but do not appear to use prettier.

It would be nice if the docs clarified that .editorconfig is considered a prettier configuration file by this extension, and to only auto-format on prettier config files specifically, you need to set prettier.useEditorConfig to false.

0reactions
github-actions[bot]commented, Oct 31, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

visual studio code - prettier settings for vscode - Stack Overflow
Type "Prettier"; You should see the available Prettier settings. ... ctrl + , paste --> Prettier: Require Config uncheck it, then all done....
Read more >
prettier-vscode - Bountysource
Possible mistake in behavior of "prettier.requireConfig " $ 0. Created 1 year ago in prettier/prettier-vscode with 2 comments. From the README file:
Read more >
How to disable prettier in VSCode for a specific project?
Now the first option is to disable the VSCode extension. I am sure this is not what you are looking for as it...
Read more >
prettier ignore comment - You.com | The search engine you control.
Expected behavior: No change on the file. Actual behavior: File is fixed, regardless the ignore comment. Also the doc seems incomplete. Even I...
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
You can configure JavaScript code auto-formatting with Prettier to work per-project. ... Nothing happens on save; Code formatting is wrong.
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