Add Section 18.10 - No spaces inside brackets

See #593
This commit is contained in:
Stefano Pigozzi
2015-11-28 13:28:28 +01:00
parent 2557a5bca6
commit ee3759a7ed
2 changed files with 15 additions and 3 deletions

View File

@@ -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

View File

@@ -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
@@ -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