no-unnecessary-type-assertion
Configuration
rslint.config.ts
Rule Details
Disallow type assertions that do not change the type of an expression.
Type assertions (as expressions, angle-bracket syntax, and non-null assertions !) that don't actually change the type of an expression are unnecessary and add noise to the code. This includes non-null assertions on values that are already non-nullable.
Examples of incorrect code for this rule:
Examples of correct code for this rule: