Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Odd behavior with Extra Comma #363
JSHint will tell me I'm missing a space after the comma and that there is an extra comma. It should just tell me there's an extra comma.
And the following is even stranger:
othertest.js: line 1, col 16, Missing space after ','.
I just need to know there's an extra comma.
These commits at least hide the confusing whitespace warnings from the beginning of the reports.
Note that I do not know very well how the JSHint parser works and if this is a proper way to do the check, but at least my fix does not break any
So correct me if I'm wrong but I'm thinking if
Should tell me there's an extra comma and a space missing. That would rule out f45ebff
The only issue now is when an object literal has two, or more, commas in a row.
There's many options to approach this:
Any others? I'm not sure if I like any of those. They all make assumptions about what the developer is trying to do. Though, I hate the third options least, because if the developer has made a typo about the extra comma, it would also show itself as a logical error, because