Commit 5a514035 authored by Sean Hammond's avatar Sean Hammond

jscs: Require `function () {}`

Change jscs's required style from `function()` to `function ()`.

We always require a space after the `function` keyword, and before {}
braces, but we do not allow a space between a function name and its ()
braces:

    var foo1 = function () {};  // Right.
    var foo2 = function() {};  // Wrong.
    var foo3 = function (){};  // Wrong.

    var foo4 = function foo4() {};  // Right.
    var foo5 = function foo5 () {};  // Wrong.
    var foo6 = function foo6(){};  // Wrong.

    function foo7() {}  // Right.
    function foo8 () {}  // Wrong.
    function foo9(){}  // Wrong.

This deviates from the Google style guide and jscs presets that we use.
parent 86256af9
...@@ -6,5 +6,19 @@ ...@@ -6,5 +6,19 @@
"node_modules/**", "node_modules/**",
"h/static/scripts/vendor" "h/static/scripts/vendor"
], ],
"maxErrors": 10 "maxErrors": 10,
"disallowSpacesInAnonymousFunctionExpression": null,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": null,
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireSpacesInFunctionDeclaration": null,
"requireSpacesInFunctionExpression": null,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment