手冊上說,我可以使用:警告白名單不會在谷歌關閉編譯器工作
--warnings_whitelist_file VAL : A file containing warnings to
suppress. Each line should be of the
form
<file-name>:<line-number>? <warning-d
escription>
這是我的白名單中的樣子:在編譯
ef-utils.js:1 Redeclared variable: ef
ef-utils.js:1 Variable ef first declared in externs-ko.js
ef-validation.js:1 Redeclared variable: ef
ef-validation.js:1 Variable ef first declared in externs-ko.js
而且我仍然得到警告:
ef-utils.js:1: WARNING - Redeclared variable: ef
?var ef = (function (ns, ko) {
^
ef-utils.js:1: WARNING - Variable ef first declared in externs-ko.js
?var ef = (function (ns, ko) {
^
ef-validation.js:1: WARNING - Redeclared variable: ef
?var ef = (function (ns, ko) {
^
ef-validation.js:1: WARNING - Variable ef first declared in externs-ko.js
?var ef = (function (ns, ko) {
^
此網頁無法正常工作。另外,我無法再在網上找到這個工具。 – efficks
ClosureCompiler現在在GitHub上。 WhitelistBuilder類是[這裏](https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java#L212),但它似乎並不成爲處理警告的首選方式。當我確定推薦的過程時,我會更新我的答案。 – Tibos