【问题标题】:What does the number in eslint rule arrays mean?eslint 规则数组中的数字是什么意思?
【发布时间】:2016-03-15 12:32:48
【问题描述】:

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

eslint 对许多规则使用类似的语法

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

或者只是

"no-constant-condition": 2

这个数字是什么意思?文档非常庞大,我无法通过 Google 搜索或在动态文档中找到它

【问题讨论】:

    标签: javascript eslint


    【解决方案1】:

    我自己通过使用 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

    【讨论】:

    猜你喜欢
    • 2022-01-28
    • 2019-01-14
    • 1970-01-01
    • 2019-09-27
    • 2021-09-11
    • 2013-05-28
    • 1970-01-01
    • 2014-03-10
    • 2018-11-23
    相关资源
    最近更新 更多