【问题标题】:How to @suppress multiple warnings with Closure Compiler?如何使用 Closure Compiler @suppress 多个警告?
【发布时间】:2011-09-04 17:42:42
【问题描述】:

可以通过@suppress annotation 使用 Google 的 Closure Compiler 在每个文件的基础上抑制警告。但是,似乎不可能同时抑制多个警告——例如globalThischeckVars 警告。我都试过了

/**
 * @fileoverview
 * @suppress {globalThis checkVars}
 */

/**
 * @fileoverview
 * @suppress {globalThis,checkVars}
 */

但两者都会导致 @suppress 注释被忽略。多个@suppress 行也不起作用。

【问题讨论】:

    标签: compiler-construction compiler-warnings google-closure-compiler suppress


    【解决方案1】:

    用竖线字符分隔类型(例如:'|')。

    /**
     * @fileoverview
     * @suppress {globalThis|checkVars}
     */
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-13
    • 1970-01-01
    • 2019-09-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多