Closure Linter vs. JSON

Skip to first unread message

Nick Thompson

Aug 20, 2013, 5:20:26 PM8/20/13
I have some embedded JSON in my source code, but the linter complains about the double-quotes.
I agree with the linter in general about quotes, but would like to make an exception for JSON: is there any way to suppress the quote warning for a single variable definition?


Hochhaus, Andrew

Aug 20, 2013, 5:59:23 PM8/20/13
to Closure Linter Discuss
Which specific error are you receiving?

Some (all?) of the closure-linter errors can be turned off using the
@suppress jsdoc. I normally grep the linter code to locate the
required suppression (eg: extraRequire, extraProvide, missingProvide,
accessControls, underscore, etc)

If it is UNNECESSARY_DOUBLE_QUOTED_STRING I don't see a corresponding
suppress that is supported by the linter.

> --
> You received this message because you are subscribed to the Google Groups
> "Closure Linter Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> For more options, visit

Andy Perelson

Aug 20, 2013, 6:52:21 PM8/20/13
Unfortunately you cannot suppress the unnecessary double quoted string error on a case by case basis using the @suppress annotation. You can see the list of valid values for the @suppress annotation here: , though not all those suppressions are used by the linter, some are just there for compatibility with the Closure Compiler.

As of a fairly recent release of the linter you can suppress any error for all occurrences on the command line via the --disable flag. You can see the flag source here: . We don't allow this blanket suppression internally at Google (don't want to allow us to ignore our own style guide) so if there are issues please report them. But it does sound like this is overkill for your case, unfortunately. You are welcome to file a feature request to allow @suppress of arbitrary errors for case by case suppression but I do not know when it would get addressed.

(another) Andy

Nick Thompson

Aug 20, 2013, 6:13:55 PM8/20/13
That's the one I'm afraid: 
   E:0131: Single-quoted string preferred over double-quoted string.

Guess I'll put it in a separate file that doesn't go through the linter, or something along those lines.


On Tue, Aug 20, 2013 at 2:59 PM, Hochhaus, Andrew <> wrote:
Reply all
Reply to author
0 new messages