-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clarification notes about EditorConfig #13828
base: main
Are you sure you want to change the base?
Add clarification notes about EditorConfig #13828
Conversation
Can anyone please review it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks.
|
||
However, the API _doesn't_ respect `.editorconfig` by default, in order to avoid potential editor integration issues. To opt in, add `editorconfig: true` to the [`prettier.resolveConfig`](https://prettier.io/docs/en/api.html#prettierresolveconfigfilepath--options) options. | ||
|
||
> Note: Rules that are set in `.editorconfig` can be overridden by their corresponding rules from `.prettierrc.js`, therefore rules from `.editorconfig` can be used as a fallback for files that Prettier doesn't support. See the languages list supported by Prettier [here](https://prettier.io/docs/en/index.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this part: "rules from .editorconfig
can be used as a fallback for files that Prettier doesn't support". What does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say there is a set of rules in .prettier.js
and an environment that doesn't support prettier (the not widely used programming language that is not in the Prettier support list for instance).
However, we still have .editorconfig
, which has better support for most IDEs.
For example, if, for the reasons above, the printWidth
Prettier rule cannot be used, we still have its EditorConfig's alternative max_line_length
that will be used as a fallback value.
Does it answer your question, @thorn0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean now, but this isn't clear from the proposed paragraph. A better wording is needed.
Description
Although I'm not a Prettier expert, IMHO the section about the EditorConfig integration is not super clear, to be honest. So I'd add some more words about the relationships between Prettier and EditorConfig.
Please correct me, if I'm missing something.
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨