Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Repro
{"rules": {"@typescript-eslint/no-unnecessary-type-assertion": ["error"] }}
exportclassA{data?:unknown;}exportasyncfunctiontest():Promise<unknown>{leta:A=newA();returna.data!;}
Expected Result
no errors
Actual Result
This assertion is unnecessary since it does not change the type of the expression. eslint(@typescript-eslint/no-unnecessary-type-assertion)
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 2.3.3 |
@typescript-eslint/parser | 2.3.3 |
TypeScript | 3.6.3 |
ESLint | 6.5.1 |
node | 12.10.0 |
npm | 6.10.3 |