mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-13 20:57:56 -05:00
12
README.md
12
README.md
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user