File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
packages/eslint-config-airbnb/rules Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1575,6 +1575,18 @@ Other Style Guides
1575
1575
}
1576
1576
` ` `
1577
1577
1578
+ - [18.10](#18.10) <a name='18.10'></a> Do not add spaces inside brackets.
1579
+
1580
+ ` ` ` javascript
1581
+ // bad
1582
+ const foo = [ 1 , 2 , 3 ];
1583
+ console .log (foo[ 0 ]);
1584
+
1585
+ // good
1586
+ const foo = [1 , 2 , 3 ];
1587
+ console .log (foo[0 ]);
1588
+ ` ` `
1589
+
1578
1590
**[⬆ back to top](#table-of-contents)**
1579
1591
1580
1592
## Commas
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
'rules' : {
3
3
// enforce spacing inside array brackets
4
- 'array-bracket-spacing' : 0 ,
4
+ 'array-bracket-spacing' : [ 2 , 'never' ] ,
5
5
// enforce one true brace style
6
6
'brace-style' : [ 2 , '1tbs' , { 'allowSingleLine' : true } ] ,
7
7
// require camel case names
@@ -10,8 +10,8 @@ module.exports = {
10
10
'comma-spacing' : [ 2 , { 'before' : false , 'after' : true } ] ,
11
11
// enforce one true comma style
12
12
'comma-style' : [ 2 , 'last' ] ,
13
- // require or disallow padding inside computed properties
14
- 'computed-property-spacing' : 0 ,
13
+ // disallow padding inside computed properties
14
+ 'computed-property-spacing' : [ 2 , 'never' ] ,
15
15
// enforces consistent naming when capturing the current execution context
16
16
'consistent-this' : 0 ,
17
17
// enforce newline at the end of file, with no multiple empty lines
You can’t perform that action at this time.
0 commit comments