no-unsafe-type-assertion
Configuration
rslint.config.ts
Rule Details
Disallow type assertions that narrow a type.
Type assertions (as or angle-bracket syntax) that narrow the type of an expression are unsafe because they tell TypeScript to trust the developer rather than the type system. This rule flags assertions from any types, assertions to any types, assertions to unconstrained type parameters, and assertions that narrow a type to a more specific one.
Examples of incorrect code for this rule:
Examples of correct code for this rule: