eslint规则数组中的数字是什么意思?

What does the number in eslint rule arrays mean?

我对 eslint 配置完全陌生。我将 tslint 用于打字稿已经有一段时间了,所以我很熟悉这个概念。

eslint 对许多规则使用类似

的语法
"no-cond-assign": [2, "always"]

或者只是

"no-constant-condition": 2

这个数字是什么意思?文档非常庞大,我无法 google 或在文档中即时找到它

我自己通过使用 0,1 或 2 以外的数字找到了它。我定义了规则的严重性。

Severity should be one of the following: 0 = off, 1 = warning, 2 = error (you passed "3").

文档:https://eslint.org/docs/user-guide/configuring/rules