Skip to content

Commit

Permalink
Add Section 18.10 - No spaces inside brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
pigoz authored and gilbox committed Mar 21, 2016
1 parent 79291f9 commit 5784d89
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,18 @@ Other Style Guides
}
```
- [18.10](#18.10) <a name='18.10'></a> Do not add spaces inside brackets.
```javascript
// bad
const foo = [ 1, 2, 3 ];
console.log(foo[ 0 ]);

// good
const foo = [1, 2, 3];
console.log(foo[0]);
```
**[⬆ back to top](#table-of-contents)**
## Commas
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-airbnb/rules/style.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
'rules': {
// enforce spacing inside array brackets
'array-bracket-spacing': 0,
'array-bracket-spacing': [2, 'never'],
// enforce one true brace style
'brace-style': [2, '1tbs', {'allowSingleLine': true }],
// require camel case names
Expand All @@ -10,8 +10,8 @@ module.exports = {
'comma-spacing': [2, {'before': false, 'after': true}],
// enforce one true comma style
'comma-style': [2, 'last'],
// require or disallow padding inside computed properties
'computed-property-spacing': 0,
// disallow padding inside computed properties
'computed-property-spacing': [2, 'never'],
// enforces consistent naming when capturing the current execution context
'consistent-this': 0,
// enforce newline at the end of file, with no multiple empty lines
Expand Down

0 comments on commit 5784d89

Please sign in to comment.