Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
// failsconsttest1:(someCondition:boolean)=>void=someCondition=>{if(someCondition===true){}};// should failconsttest2:<Textendsboolean>(someCondition:T)=>void=someCondition=>{if(someCondition===true){}};
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/no-unnecessary-boolean-literal-compare":"error"},};
tsconfig
{"compilerOptions": {"strictNullChecks":true }}
Expected Result
I expect all use-cases to be consistent and report as errors.
Actual Result
The use-cases with a type constraint doesn't report as an error (even though it should).
Additional Info
This seems similar to#10311, and it looks like the fix should be similar.
Note that this issue is also similar to#10442, and I wasn't sure if I should create one issue for each rule or aggregate them under a single issue. I apologize if this was a bit spammy. I checked existing rules for similar problems after resolving#10311.