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
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
declareconstanee:any;aneeas2;
ESLint Config
module.exports={"rules":{"@typescript-eslint/no-unsafe-type-assertion":"warn"}}
tsconfig
{"compilerOptions": {"strictNullChecks":true }}
Expected Result
Unsafetype assertion fromany
detected: consider using type guards or a safertype assertion. 2:1 - 2:10
Actual Result
Unsafecast fromany
detected: consider using type guards or a safercast. 2:1 - 2:10
Additional Info
Thedocs for no-unsafe-type-assertion, as well asthe TS docs on type assertions, are careful not to use the word "cast" since, in other programming languages, that generally can imply runtime behavior. Note that this idea is reinforced by the naming of the core ruleno-extra-boolean-cast.
I propose: let's avoid using the word "cast" entirely.