【问题标题】:How to disable extra space checking for google closure linter?如何禁用谷歌关闭 linter 的额外空间检查?
【发布时间】:2014-12-17 22:56:50
【问题描述】:

Google 闭包 linter 将对以下代码中的每一行发出警告,因为键名后面有多余的空格。 有没有办法禁用额外的空间检查?我也找不到配置 .gjslintrc 文件的文档。

我也找不到在“gjslint --help”结果中使用的正确标志。

var ngTemplatesOptions = {
    prefix    : '/',
    module    : 'lc.directive.tpls',
    standalone: false,
    htmlmin   : {
        collapseBooleanAttributes    : true,
        collapseWhitespace           : true,
        removeAttributeQuotes        : true,
        removeComments               : true, // Only if you don't use comment directives!
        removeEmptyAttributes        : true,
        removeRedundantAttributes    : true,
        removeScriptTypeAttributes   : true,
        removeStyleLinkTypeAttributes: true
    }
};

【问题讨论】:

    标签: javascript google-closure


    【解决方案1】:

    您可以使用disable 标志禁用特定错误。在您的情况下,您需要执行以下操作:

    gjslint --strict --disable 0001,0002 yourfile.js
    

    其中,错误代码0001 表示多余的空间,错误代码0002 表示缺少空间。根据您的情况,您可能还想忽略缩进错误。在这种情况下,您需要将错误代码 0006 添加到列表中。

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-04-26
    • 1970-01-01
    • 2013-08-31
    • 1970-01-01
    • 1970-01-01
    • 2014-11-01
    • 1970-01-01
    相关资源
    最近更新 更多