[strict-boolean-expressions] Destructuring with default assignment leads to false positive #708
Labels
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
I have an object with an optional boolean field. It's passed to a function. I destructure the field, assigning
false
if it'sundefined
. I then combine it with the!
operator in an if-condition. The rule complains about an unexpected non-boolean.Repro
(To be fair the type of the function argument is inferred, but that's harder to express in a repro.)
Expected Result
No linter errors.
Actual Result
The rule complains that
field
is a non-boolean.Versions
@typescript-eslint/eslint-plugin
1.12.0
@typescript-eslint/parser
1.12.0
TypeScript
3.5.3
ESLint
6.0.1
node
X.Y.Z
npm
X.Y.Z
The text was updated successfully, but these errors were encountered: