How eslint requires that variables must be explicitly typed

Viewed 63

I hope that each variable must have an explicit type when declared.

How should I configure eslint?


const a = 10; // Error: Variable a does not explicitly specify a type

const b:number = 10; // Right!

1 Answers

I don't think there's a rule for this.

There is a rule on the other hand for the exact inverse. Enforce to not use type declaration for infered types no-inferable-type.

You can see a list with all the rules here.

Related