Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upShould not allow space before bracket notation #389
Comments
This comment has been minimized.
This comment has been minimized.
|
I agree it looks like a bug. It might be worth filing this on eslint. |
dcousens
added
bug
blocked
labels
Jan 20, 2016
dcousens
assigned
yoshuawuyts
Jan 20, 2016
This comment has been minimized.
This comment has been minimized.
kaicataldo
commented
Jan 28, 2016
|
Wait, are you sure this is incorrect syntax? It might just be because it's late, but I'm not seeing the error...I don't know the particulars of the specific example, but it looks like valid syntax to me:
Edit: Oh, I see what you meant now! Rather than a property of the returned value of |
This comment has been minimized.
This comment has been minimized.
|
@kaicataldo Even though it's technically valid syntax, I think @mattdesl was hoping standard would report it as error, because property accesses shouldn't have spaces after them. So it's either inconsistent style, or a programmer error. Happy to enable a rule for this, if it's available in |
This comment has been minimized.
This comment has been minimized.
|
Doesn't look like there's an eslint rule for this. |
feross
closed this
Feb 4, 2016
This comment has been minimized.
This comment has been minimized.
|
@mattdesl Are you interested in opening an issue on eslint to request this rule? |
This comment has been minimized.
This comment has been minimized.
|
It is such a minor thing that I can't really be bothered. |
feross
removed
the
blocked
label
Feb 4, 2016
This comment has been minimized.
This comment has been minimized.
|
I think we can actually catch this with the http://eslint.org/docs/2.0.0/rules/no-whitespace-before-property rule. Will ship this in |
mattdesl commentedJan 20, 2016
I just got bit by a small bug because the linting didn't catch it. Might be worth disallowing this, I can't see any reason it should be legit.
It wouldn't catch the same code if there was no space, but at least when a space is there (i.e. in the case of a missing comma) it could be caught early.
Thoughts?😄