mirror of
https://github.com/airbnb/javascript.git
synced 2026-04-25 03:00:19 -04:00
23
README.md
23
README.md
@@ -1551,6 +1551,29 @@ Other Style Guides
|
||||
}
|
||||
```
|
||||
|
||||
- [18.9](#18.9) <a name='18.9'></a> Do not add spaces inside parentheses.
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
function bar( foo ) {
|
||||
return foo;
|
||||
}
|
||||
|
||||
// good
|
||||
function bar(foo) {
|
||||
return foo;
|
||||
}
|
||||
|
||||
// bad
|
||||
if ( foo ) {
|
||||
console.log(foo);
|
||||
}
|
||||
|
||||
// good
|
||||
if (foo) {
|
||||
console.log(foo);
|
||||
}
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ module.exports = {
|
||||
'space-before-blocks': 2,
|
||||
// require or disallow space before function opening parenthesis
|
||||
'space-before-function-paren': [2, 'never'],
|
||||
// require or disallow spaces inside parentheses
|
||||
'space-in-parens': 0,
|
||||
// disallow spaces inside parentheses
|
||||
'space-in-parens': [2, 'never'],
|
||||
// require spaces around operators
|
||||
'space-infix-ops': 2,
|
||||
// require a space after return, throw, and case
|
||||
|
||||
Reference in New Issue
Block a user