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
Docs: Improve examples and clarify default option #12067
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 |
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.
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. |
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!
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)
overrides
instead ofafter
because the ternary examples inafter
may be misleading.overrides
to reflect the default behavior. The old one+=
is removed as it serves no purpose after the change.overrides
to clarify whether the overridden style can still be used.Is there anything you'd like reviewers to focus on?
No.