no-unnecessary-conditional-chaining #10702
Closed
yannick-softwerft
started this conversation in
Technical Discussions
Replies: 1 comment
-
As per our discussion guidelines (which you ticked as having read) -- we do not use discussions for bugs, questions or feature requests. Please read the guidelines for alternatives. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
I was using the rule no-unnecessary-condition, until I started my first react project where you often use conditional rendering in your tsx code. For example:
Unfortunately no-unnecessary-condition breaks at this point because the second part of the condition is always truthy.
I would still like to allow optional chaining only if it is really needed to keep the code clean. Sometimes a type changes and it is not optional anymore. So all the optional chainings could be removed automatically by running
--fix
.Additional Info
Any additional info...
Before you submit your discussion, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
Beta Was this translation helpful? Give feedback.
All reactions