【发布时间】:2023-01-23 18:04:00
【问题描述】:
我希望每个变量在声明时都必须有明确的类型。
我应该如何配置eslint?
const a = 10; // Error: Variable a does not explicitly specify a type
const b:number = 10; // Right!
【问题讨论】:
-
这并不是真正必要的,因为 TypeScript 已经将
10的类型推断为number。
标签: typescript eslint typescript-eslint