Open dustContributor opened 8 years ago
Thanks for the report! This is definitely a bug. It results from the mechanism JSHint uses to determine if the input should be interpreted as JSON or as JavaScript code. It guessed incorrectly in your case, but there is nothing particularly ambiguous about the input you shared.
I've updated the title of this report to describe the issue a little more directly. Here are a few ideas for temporary workarounds that will fix the issue for you today:
void 0;
These are clearly sub-optimal solutions, but I hope they'll do in a pinch.
Yay, found a bug \o/ :smile: I see, adding a semicolon gets it to recognize it as normal JS. I hope its gets fixed, thanks for your time.
Hi! I'm using jshint through this Atom linter https://atom.io/packages/linter-jshint
I get "Error: Expected a JSON value" on code like this:
And a few other related errors "Expected a string and instead saw const" and so on. I'm just trying to add a block scope so not to mess up the global scope (I'm runing the JS code on Nashorn/JVM btw). Code works as intended.
My config file is quite simple:
Is this error appropriate in this context?