在Tslint升级中出错

时间:2016-09-30 12:07:11

标签: javascript node.js linux ubuntu tslint

您好我无法解决此错误请帮我解决此错误,我已尝试过sudo apt-get install nodejs legacy等,但无法找到解决方案

       TS    build-rt
    /home/gautam/sd.js-master/node_modules/tslint/lib/ruleLoader.js:29
            throw new Error(ERROR_MESSAGE);
        ^

Error: 
            Could not find implementations for the following rules specified in the configuration:
            no-trailing-comma
            Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
            If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.

    at Object.loadRules (/home/gautam/sd.js-master/node_modules/tslint/lib/ruleLoader.js:29:15)
    at Linter.lint (/home/gautam/sd.js-master/node_modules/tslint/lib/tslint.js:59:44)
    at processFile (/home/gautam/sd.js-master/node_modules/tslint/lib/tslint-cli.js:138:29)
    at /home/gautam/sd.js-master/node_modules/tslint/lib/tslint-cli.js:177:74
    at Array.forEach (native)
    at Object.<anonymous> (/home/gautam/sd.js-master/node_modules/tslint/lib/tslint-cli.js:177:41)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
make: *** [build-rt] Error 1

1 个答案:

答案 0 :(得分:2)

删除了无尾随逗号规则,它已被尾随逗号规则取代(#687)

编辑: 在你的/tslint.json文件中删除使用&#34; no-trailing-comma&#34;。它可以替换为新的&#34;尾随逗号&#34;您可以在此处找到更多相关规则:https://palantir.github.io/tslint/rules/trailing-comma/

新规则为多线和单线添加选项,可以是&#34;始终&#34;或&#34;永远&#34;:

"trailing-comma": [true,
    {
        "multiline": "always",
        "singleline": "never"
    }
], 

如果您只是想将其关闭,可以添加以下内容:

"trailing-comma": [false],