Confirmed users
177
edits
(All devtools code is now in /devtools - updated the path references.) |
(Add function spacing style) |
||
Line 115: | Line 115: | ||
* don't open braces on the next line, | * don't open braces on the next line, | ||
* don't name function expressions: <code>let o = { doSomething: function doSomething() {} };</code>, | * don't name function expressions: <code>let o = { doSomething: function doSomething() {} };</code>, | ||
* use a space before opening paren for anonymous functions, but don't use one for named functions: | |||
** anonymous functions: <code>function () {}</code> | |||
** named functions: <code>function foo() {}</code> | |||
** anonymous generators: <code>function* () {}</code> | |||
** named generators: <code>function* foo() {}</code> | |||
* aim for short functions, 24 lines max (ESLint has a rule that checks for function complexity too), | * aim for short functions, 24 lines max (ESLint has a rule that checks for function complexity too), | ||
* aArguments aAre the aDevil (don't use them please), | * aArguments aAre the aDevil (don't use them please), |