Docs: Improve examples and clarify default option#12067
Docs: Improve examples and clarify default option#12067ilyavolodin merged 2 commits intoeslint:masterfrom
Conversation
The "default" option is now set to `overrides` instead of `after` because examples in after may be misleading. A new incorrect example is added to `overrides` to clarify whether the overridden style can still be used.
|
Hi @zypA13510, thanks for the PR. I'm a bit confused. Are the docs currently incorrect/showing invalid defaults? What problem are you solving with this change? |
|
@platinumazure in the same documentation, options section:
in the incorrect example of "after" (which claims to be the default)
same for the correct example of "after". Imho, this could be very confusing - if the reader somehow skipped the "real" default above and jumped to the examples directly, or, if the reader read the default, thinking all the example in "after" section is the default (with overrides), they can come to the wrong conclusion and misconfigure this rule. You can compare the entire document, if that's clearer: before and after |
platinumazure
left a comment
There was a problem hiding this comment.
Basically looks good to me, but I have one question. Thanks for your patience!
|
Actually, after reading it again, I think that adding two new examples at the end of "overrides", with some examples from the "after" section included could be better (i.e. show a complete example of the default behavior). What do you think @platinumazure? Edit: like this[diff]. If ok then I will push it to this PR. |
Hmm. Not sure which is better. Maybe another team member will have a better idea how to proceed. I'm okay either way at this point. |
|
Since no one replied to evaluate the two versions. I decided by myself to use the second version and updated this PR. Please review again. |
|
Sorry, I misclicked. @aladdin-add @platinumazure I think all the changes are now resolved. Review please? |
What is the purpose of this pull request? (put an "X" next to item)
[X] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
overridesinstead ofafterbecause the ternary examples inaftermay be misleading.overridesto reflect the default behavior. The old one+=is removed as it serves no purpose after the change.overridesto clarify whether the overridden style can still be used.Is there anything you'd like reviewers to focus on?
No.