I use Closure Compiler on my sources and recently decided to enable the most strict mode via --jscomp_warning=reportUnknownTypes
. Alas, it triggered a lot of warnings inside the goog.base
itself! I've fixed all the problems in my own code and now I'm looking for a way to silence/remove errors in the closure library code.
I tried to fix errors in base.js
but quickly realized it's unfeasible. There are approximately 108 errors in the file and in most cases they are real errors because of goog.base
doesn't care much about types: it's a common practice there to define a type like {?}
or {*}
.
I also tried to use --warnings_whitelist_file
to silence warnings I don't care about but it didn't work either. For an error:
..\js\google\base.js:204: WARNING - could not determine the type of this expression
cur[part] = opt_object;
^
I tried different forms in the whitelist file but none has worked:
..\\js\\google\\base.js:204 could not determine the type of this expression
..\\js\\google\\base.js:204 WARNING - could not determine the type of this expression
..\js\google\base.js:204 could not determine the type of this expression
..\js\google\base.js:204 WARNING - could not determine the type of this expression
../js/google/base.js:204 could not determine the type of this expression
../js/google/base.js:204 WARNING - could not determine the type of this expression
..\js\google\base.js:204 WARNING - could not determine the type of this expression
cur[part] = opt_object;
Does anybody have a working solution to have this mode enabled and not get spammed by the errors from the closure library itself?
I use latest Closure Compiler which is:
Version: v20150315
Built on: 2015/03/17 14:18