Disable Closure Compiler style rules

Viewed 73

I have an old codebase that uses Closure Compiler to minify the files. We're trying to slowly modernize and optimize this codebase, so we added a job in CI that just outputs any warnings / errors.

Some of these warnings are not relevant to us, and we'd like to ignore them.

Is there a way to disable warnings via the CLI, instead of on a per file basis?

Specifically, the JSC_STRING_CONCATENATION warning. We will introduce a template language at some point which will remove the need for multiline strings in our application.

05:08:28  WARNING - [JSC_STRING_CONTINUATION] String continuations are not recommended. See https://google.github.io/styleguide/jsguide.html#features-strings-no-line-continuations
05:08:28   887|                 dataid: \'' + o.dataid + '\', \
1 Answers

Caveat: I haven't used CC in a decade.

Looking through the --help, I found the promising --jscomp_off option, but it didn't like JSC_STRING_CONCATENATION as a value.

The sledgehammer --warning_level QUIET worked to suppress that warning. Of course, it will also suppress others.

Related