Closed as not planned
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Link to the rule's documentation
https://typescript-eslint.io/rules/strict-boolean-expressions/
Description
By using "strict-boolean-expressions" you are implicitly to enabling "no-unnecessary-condition" since:
const a = {}
if (a) {
console.log("a")
}
will raise an error for "Unexpected object value in conditional. The condition is always true @typescript-eslint/strict-boolean-expressions"
I would like to have an option to not get these warnings. I practice I have a legacy code base with 1000 errors of this type if I enable it. So i would very much like to be able to enable or disable this feature. So that I can you the feature for what is meant for.
Fail
const a = {}
const b:number|null = 0
if (a) {
console.log(b?"a":"b")
}
Pass
const replace = 'me';
const a = {}
if (a) {
console.log("a")
}
Additional Info
No response