[valid-typeof] @typescript-eslint/recommended disables valid-typeof but it shouldn't #3797
Closed
3 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
breaking change
This change will require a new major version to be released
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
recommended-rules
Discussion about recommended rule sets
Milestone
Repro
Expected Result
Actual Result
🦗
Additional Info
The
@typescript-eslint/recommended
ruleset disables thevalid-typeof
ESLint rule on the basis that it's covered by TypeScript's "This condition will always return 'false'" handling.However, this is incorrect: TypeScript does not detect this incorrect condition in the case of
null
andundefined
, and so thevalid-typeof
rule should be re-enabled in therecommended
preset.Versions
@typescript-eslint/eslint-plugin
4.23.0
@typescript-eslint/parser
4.23.0
TypeScript
4.2.4
ESLint
7.26.0
node
12.13.1
The text was updated successfully, but these errors were encountered: