What does the number in eslint rule arrays mean?

时间:2015-12-10 01:43:24

标签: javascript eslint

I'm totally new to eslint configurations. I'm using tslint for typescript for quite a while now so I'm familiar with the concept.

eslint uses for many rules a syntax like

"no-cond-assign": [2, "always"]

or just

"no-constant-condition": 2

What does the number mean? The documentation is pretty huge and I'm not able to google or find it in the docs on the fly

1 个答案:

答案 0 :(得分:22)

I've found it myself by using another number than 0,1 or 2. I defines the severity of a rule.

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