Skip to content

Commit 8da7aaa

Browse files
committed
spaces inside brackets
1 parent 912cba2 commit 8da7aaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,15 +2456,15 @@
24562456
```
24572457

24582458
<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)
24602460

24612461
```javascript
24622462
// bad
2463-
const foo = [ 1, 2, 3 ];
2463+
const foo = [1, 2, 3];
24642464
console.log(foo[ 0 ]);
24652465
24662466
// good
2467-
const foo = [1, 2, 3];
2467+
const foo = [ 1, 2, 3 ];
24682468
console.log(foo[0]);
24692469
```
24702470

0 commit comments

Comments
 (0)