[no-unnecessary-type-assertion] False positive with value that can have the value null #1199
Labels
bug
Something isn't working
has pr
there is a PR raised to close this
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Ok, I know I already tried to open this as #1195, but I totally borked that report. Hopefully, I'm not doing it again 馃, the issue was with no-unnecessary-type-assertion all along.
Repro
Expected Result
No errors
Actual Result
3:14 error This assertion is unnecessary since the receiver accepts the original type of the expression @typescript-eslint/no-unnecessary-type-assertion
Additional Info
With the
!
this compiles, but if the!
is removed, then you get a compiler error:Versions
The text was updated successfully, but these errors were encountered: