[no-unnecessary-type-assertion] False positive with lazily initialized local variable #2423
Labels
fix: strictNullChecks
issues that were fixed by turning on strictNullChecks
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
working as intended
Issues that are closed as they are working as intended
Uh oh!
There was an error while loading. Please reload this page.
Not sure if or how this relates to #2248. In my case, the repro is quite simple.
Repro
.eslintrc.json
index.ts
package.json
tsconfig.json
Run with:
npx eslint index.ts
Expected Result
No error.
Actual Result
Getting error
This assertion is unnecessary since it does not change the type of the expression @typescript-eslint/no-unnecessary-type-assertion
on line 3.Versions
@typescript-eslint/eslint-plugin
3.10.0
@typescript-eslint/parser
3.10.0
TypeScript
4.0.2
ESLint
7.4.0
node
14.8.0
The text was updated successfully, but these errors were encountered: