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.
Description
The strict-boolean-expressions
does not prevent the following bug:
const numbers: number[] = [];
const filteredNumbers = numbers.filter((element) => {
return element; // BUG - SHOULD BE SOME KIND OF BOOLEAN COMPARISON!!!
});
This is because it does not examine function return values, it only examines comparisons.
Note that the no-unnecessary-condition
rule is a similar rule, and it does support function return values. Thus, the function-examining logic needs to also be copy-pasted to this rule, so that this rule can catch the bug above.
For reference, the rule should be able to handle the following Array
methods:
- Array.every
- Array.filter
- Array.find
- Array.findIndex
- Array.findLast
- Array.findLastIndex
- Array.some