[strict-boolean-expressions] ignoreRhs
is too lenient
#1118
Labels
enhancement
New feature or request
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
Additional Info
This does error as expected in TSLint (with the equivalent rule of the same name).
In the first example, the right-hand side of
expression
will not be coerced (until it's later used in anif
statement), so it's safe to for it to be a non-boolean type.In the second example however, the right-hand side of the condition in the
if
statement will be coerced, so it's not safe for it to be a non-boolean type.Versions
@typescript-eslint/eslint-plugin
2.4.0
@typescript-eslint/parser
2.4.0
TypeScript
3.6.4
ESLint
6.5.1
node
12.8.1
npm
6.10.2
The text was updated successfully, but these errors were encountered: