Skip to content

Commit

Permalink
Add Section 18.9 - No spaces inside parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
pigoz authored and jaylaw81 committed Sep 19, 2017
1 parent 70195c1 commit 2013a71
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)**
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-airbnb/rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2013a71

Please sign in to comment.