# 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.

- Category: style
- Level: warning
- Fix: automatic
- Scope: module

## Reported

```ds title="main.ds"
const enabled: boolean = true;
```

## Accepted

```ds title="main.ds"
const enabled = true;
```

## Prior art

- [typescript-eslint · no-inferrable-types](https://typescript-eslint.io/rules/no-inferrable-types)

[language/linter/src/rules/style/no_inferrable_type_annotation.rs:8](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/no_inferrable_type_annotation.rs#L8)
