menu

no-inferrable-type-annotation

Disallow annotations identical to an inferred scalar type

A scalar initializer already determines its ordinary runtime type. Instead, you SHOULD omit an annotation that repeats that type.

Annotations that preserve a literal type, select another width, or constrain a wider expression remain meaningful.

Reported

1const enabled: boolean = true;

Accepted

1const enabled = true;