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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
// fails
const test1: (someCondition: boolean) => void = someCondition => {
if (someCondition === true) {}
};
// should fail
const test2: <T extends boolean>(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
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.