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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
declare const anee: any;
anee as 2;
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/no-unsafe-type-assertion": "warn"
}
}
tsconfig
Expected Result
Unsafe type assertion from any
detected: consider using type guards or a safer type assertion. 2:1 - 2:10
Actual Result
Unsafe cast from any
detected: consider using type guards or a safer cast. 2:1 - 2:10
Additional Info
The docs for no-unsafe-type-assertion, as well as the 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 rule no-extra-boolean-cast.
I propose: let's avoid using the word "cast" entirely.