首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >获取tslint.json文件中的所有TsLint规则

获取tslint.json文件中的所有TsLint规则
EN

Stack Overflow用户
提问于 2017-06-17 18:58:00
回答 1查看 1.3K关注 0票数 0

我正在配置SonarTsPlugin,并且正在尝试弄清楚要在我的tslint.json中放入什么(我还没有)。首先,我想启用SonarQube中所有可用的TypeScript规则。我找到了这个,并将其随机添加到我的项目中:

代码语言:javascript
复制
{
    "jsRules": {
        "class-name": true,
        "comment-format": [
            true,
            "check-space"
        ],
        "indent": [
            true,
            "spaces"
        ],
        "no-duplicate-variable": true,
        "no-eval": true,
        "no-trailing-whitespace": true,
        "no-unsafe-finally": true,
        "one-line": [
            true,
            "check-open-brace",
            "check-whitespace"
        ],
        "quotemark": [
            true,
            "double"
        ],
        "semicolon": [
            true,
            "always"
        ],
        "triple-equals": [
            true,
            "allow-null-check"
        ],
        "variable-name": [
            true,
            "ban-keywords"
        ],
        "whitespace": [
            true,
            "check-branch",
            "check-decl",
            "check-operator",
            "check-separator",
            "check-type"
        ]
    },
    "rules": {
        "class-name": true,
        "comment-format": [
          true,
          "check-space"
        ],
        "curly": true,
        "indent": [
            true,
            "spaces"
        ],
        "no-eval": true,
        "no-internal-module": true,
        "no-trailing-whitespace": true,
        "no-unsafe-finally": true,
        "no-var-keyword": true,
        "one-line": [
            true,
            "check-open-brace",
            "check-whitespace"
        ],
        "quotemark": [
            true,
            "double"
        ],
        "semicolon": [
            true,
            "always"
        ],
        "triple-equals": [
            true,
            "allow-null-check"
        ],
        "typedef-whitespace": [
            true,
            {
                "call-signature": "nospace",
                "index-signature": "nospace",
                "parameter": "nospace",
                "property-declaration": "nospace",
                "variable-declaration": "nospace"
            }
        ],
        "variable-name": [
            true,
            "ban-keywords"
        ],
        "whitespace": [
            true,
            "check-branch",
            "check-decl",
            "check-operator",
            "check-separator",
            "check-type"
        ]
    }
}

TypeScript插件可以很好地使用它,但我不确定它是否启用了所有可能的规则。有没有能做到这一点的tslint.json示例?谢谢。

注意:我启动了tsc --init命令来生成一个默认的配置文件,但是我问自己同样的问题。在SonarQube中,我看到有100+规则,但文件只包含~50。

EN

回答 1

Stack Overflow用户

发布于 2017-06-17 19:13:40

您可以找到TSLint in their official documentation支持的规则的完整列表

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44603783

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档