Enhancement: [prefer-optional-chain] Suggest !foo || !foo.bar
as a valid match for the rule
#5245
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Link to the rule's documentation
https://typescript-eslint.io/rules/prefer-optional-chain/
Description
I propose that the
prefer-optional-chain
rule should also check for!foo || !foo.bar
the boolean alternative form of!(foo && foo.bar)
to be suggested as!foo?.bar
Fail
Pass
Additional Info
Willing to open a PR
The text was updated successfully, but these errors were encountered: