-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
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.
controversial, Zamiell and ronami
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin