Enhancement: [strict-boolean-expressions] options for operators/positions #8239
Labels
duplicate
This issue or pull request already exists
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/strict-boolean-expressions
Description
strict-boolean-expressions
should offer granular options for allowing/disallowing non-booleans in certain positions, such as the conditional position of aif
statement or ternary, or when using specific boolean operators.Fail
Pass
Additional Info
This is motivated by a recent inquiry on the TypeScript Community Discord server, wanting
A
to be linted, in favor ofB
:Currently, with
allowNumber: false
, the rule will correctly error onA
, but will not allow the preferred fix.I'm not sure what format of options would be ideal for granular control while also being compatible with the current options, so the options in the example are just for demonstration.
The text was updated successfully, but these errors were encountered: