File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2456
2456
` ` `
2457
2457
2458
2458
< a name= " whitespace--in-brackets" >< / a>< a name= " 18.10" >< / a>
2459
- - [18.10 ](#whitespace-- in - brackets) Do not add spaces inside brackets . eslint : [` array-bracket-spacing` ](http: // eslint.org/docs/rules/array-bracket-spacing.html) jscs: [`disallowSpacesInsideArrayBrackets `](http://jscs.info/rule/disallowSpacesInsideArrayBrackets)
2459
+ - [18.10 ](#whitespace-- in - brackets) Add spaces inside brackets . But do not add spaces if accessing object attributes . eslint : [` array-bracket-spacing` ](http: // eslint.org/docs/rules/array-bracket-spacing.html) [`computed-property-spacing `](http://eslint.org/docs/rules/computed-property-spacing)
2460
2460
2461
2461
` ` ` javascript
2462
2462
// bad
2463
- const foo = [ 1, 2, 3 ];
2463
+ const foo = [1, 2, 3];
2464
2464
console.log(foo[ 0 ]);
2465
2465
2466
2466
// good
2467
- const foo = [1, 2, 3];
2467
+ const foo = [ 1, 2, 3 ];
2468
2468
console.log(foo[0]);
2469
2469
` ` `
2470
2470
You can’t perform that action at this time.
0 commit comments