Skip to content

Commit

Permalink
Merge pull request #4572 from eslint/issue4569
Browse files Browse the repository at this point in the history
Fix: Ignore space before function in array start (fixes #4569)
  • Loading branch information
nzakas committed Nov 30, 2015
2 parents 931e0a2 + 95d2e0b commit 58ee960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/space-before-keywords.js
Expand Up @@ -188,7 +188,7 @@ module.exports = function(context) {
return;
}

checkTokens(node, left, right, { allowedPrecedingChars: [ "(", "{" ] });
checkTokens(node, left, right, { allowedPrecedingChars: [ "(", "{", "[" ] });
},
"YieldExpression": function(node) {
check(node, { allowedPrecedingChars: [ "(", "{" ] });
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/space-before-keywords.js
Expand Up @@ -133,6 +133,7 @@ ruleTester.run("space-before-keywords", rule, {
{ code: "; function foo () {}", options: never },
{ code: ";\nfunction foo () {}", options: never },
// FunctionExpression
{ code: "[function () {}]" },
{ code: "var foo = function bar () {}" },
{ code: "var foo =\nfunction bar () {}" },
{ code: "function foo () { return function () {} }" },
Expand Down

0 comments on commit 58ee960

Please sign in to comment.