consistent-type-assertions
Configuration
rslint.config.ts
Rule Details
Enforce consistent usage of type assertions. TypeScript provides two syntaxes for type assertions: as expressions (value as Type) and angle-bracket syntax (<Type>value). This rule enforces a consistent style and can also restrict type assertions on object and array literals.
The assertionStyle option supports "as" (default), "angle-bracket", and "never". Additional options objectLiteralTypeAssertions and arrayLiteralTypeAssertions control whether assertions on literals are allowed.
Examples of incorrect code for this rule (with default "as" option):
Examples of correct code for this rule (with default "as" option):