如何将TSLint添加到TFS构建中

时间:2017-05-09 16:50:45

标签: azure-devops tslint

如果TSLint出现任何错误,我想使构建失败。我如何将其集成到VSTS(TFS在线)构建中?

1 个答案:

答案 0 :(得分:0)

如果TSLint有任何错误,则构建步骤将失败。 例如:

  1. Npm步骤/任务(npm命令:安装;参数:tslint typescript -g)
  2. 命令行步骤/任务(工具:tslint;参数:app.ts;工作文件夹:$(Build.SourcesDirectory)
  3. 示例tslint.json:

    {
        "defaultSeverity": "error",
       "extends": [
            "tslint:recommended"
        ],
        "jsRules": {},
        "rules": {
            "member-access": [true, "no-public"]
        },
        "rulesDirectory": []
    }