Plovr config json fails IDE validation

20 views
Skip to first unread message

Andre Tannus

unread,
Mar 5, 2014, 9:59:59 AM3/5/14
to pl...@googlegroups.com
Since Netbeans 7.3, the json parser has been complaining that // is unsupported in json spec.

// fails json validation
{
  // comment
  "foo": "bar"
}

I can't rename as .js, because a literal object declaration on its own is apparently illegal too.

// fails validation
{"foo":"bar"}

// passes validation, but chokes plovr.
a={"foo":"bar"}

Does anyone have a workaround for this?
Or did you ditch comments in your plovr configs altogether?



--
André Tannús | Epungo | +55 11 2389-4360 

Ilia Mirkin

unread,
Mar 5, 2014, 12:50:45 PM3/5/14
to pl...@googlegroups.com
On Wed, Mar 5, 2014 at 9:59 AM, Andre Tannus <andre....@gmail.com> wrote:
> Since Netbeans 7.3, the json parser has been complaining that // is
> unsupported in json spec.

It's right, json doesn't support comments.

>
> // fails json validation
> {
> // comment
> "foo": "bar"
> }
>
> I can't rename as .js, because a literal object declaration on its own is
> apparently illegal too.
>
> // fails validation
> {"foo":"bar"}

It's wrong, that's perfectly legal js (albeit useless, as the value is
discarded).

>
> // passes validation, but chokes plovr.
> a={"foo":"bar"}
>
> Does anyone have a workaround for this?

My approach is to find tools that work for me rather than changing my
workstyle to comply with tools. (i.e. fix the tool, not yourself). No
issues with this in emacs ;)

Cheers,

-ilia
Reply all
Reply to author
Forward
0 new messages