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 upMissing space before keyword "function" when function is inside an array #387
Comments
dcousens
added
the
bug
label
Jan 17, 2016
This comment has been minimized.
This comment has been minimized.
|
Looks like a bug. var x = {
y: [function () { // Missing space before keyword "function".
}]
}
console.log(x)Add the space before |
This comment has been minimized.
This comment has been minimized.
kaicataldo
commented
Jan 28, 2016
|
This seems to be the intended behavior of ESLint's From the docs: "This rule will allow keywords to be preceded by an opening curly brace ({)." Nothing about square brackets though. |
This comment has been minimized.
This comment has been minimized.
|
This issue is caused by the keyword spacing rules that we have enabled conflicting with other spacing rules that we have enabled. Fortunately, the next version of eslint (v2) (which will ship in standard v6) has a new, better rule From the docs for
This is fixed on the |
capaj commentedJan 15, 2016
this fails with:
3:23: Missing space before keyword "function".this has no errors:
So this essentially forces me to have one space at the beginning of an array. Is this a bug? I think so.