[eslint-v2][whitespace] add no-whitespace-before-property rule

This commit is contained in:
Harrison Shoff
2016-02-14 18:35:23 -08:00
committed by Jordan Harband
parent 92df6357b3
commit e6cbcf4cc5
2 changed files with 4 additions and 1 deletions

View File

@@ -1679,7 +1679,7 @@ Other Style Guides
```
- [18.6](#18.6) <a name='18.6'></a> Use indentation when making long method chains (more than 2 method chains). Use a leading dot, which
emphasizes that the line is a method call, not a new statement. eslint: [newline-per-chained-call](http://eslint.org/docs/rules/newline-per-chained-call)
emphasizes that the line is a method call, not a new statement. eslint: [newline-per-chained-call](http://eslint.org/docs/rules/newline-per-chained-call) [no-whitespace-before-property](http://eslint.org/docs/rules/no-whitespace-before-property)
```javascript
// bad

View File

@@ -90,6 +90,9 @@ module.exports = {
// also, prefer `a || b` over `a ? a : b`
// http://eslint.org/docs/rules/no-unneeded-ternary
'no-unneeded-ternary': [2, { 'defaultAssignment': false }],
// disallow whitespace before properties
// http://eslint.org/docs/rules/no-whitespace-before-property
'no-whitespace-before-property': 2,
// require padding inside curly braces
'object-curly-spacing': [2, 'always'],
// allow just one var statement per function