-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: fix doc for no-unneeded-ternary rule (fixes #12098) #12410
Docs: fix doc for no-unneeded-ternary rule (fixes #12098) #12410
Conversation
064aa0c
to
fc6ee97
Compare
I've realised that I slightly misunderstood the issue so I have a couple of changes to make to this PR. Will do them asap this weekend.Please hold off reviewing for now. |
Hi @samrae7, I've added the "do not merge" label to try to avoid an accidental merge on our side. Feel free to ping me or another team member when you're ready for review and we can remove the label at that point. Thanks! |
- default assignment on right hand side - default assignment not on right side - assignment that is not default e.g. x ? 1 : x
@platinumazure I've updated the PR and it's ready for review. Please can you remove the |
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.
Looks good, thanks for contributing!
(Also: Wow! That option is kind of misleading as it stands. I think it could be improved- in a future PR and with discussion around the design- by basically renaming it, maybe to something like allowTernaryForDefaultValue
, since it's not always part of an assignment. But that's definitely a discussion for another day...)
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! Thanks for the docs and the additional test cases to clarify the behavior! 👍
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)
Corrected docs for defaultAssignment option of no-unneeded-ternary rule as per this issue: #12098. Also added extra test cases to show more clearly how the option works.
Is there anything you'd like reviewers to focus on?