no-magic-numbers
禁止魔法数字.
🧱
This is an "extension" rule that replaces a core ESLint rule to work with TypeScript. See Rules > Extension Rules.
This rule extends the base no-magic-numbers
rule from ESLint core. 它增加了对以下内容的支持:
¥It adds support for:
-
数字字面量类型(
type T = 1
),¥numeric literal types (
type T = 1
), -
enum
成员(enum Foo { bar = 1 }
),¥
enum
members (enum Foo { bar = 1 }
), -
readonly
类属性(class Foo { readonly bar = 1 }
)。¥
readonly
class properties (class Foo { readonly bar = 1 }
).