From e6cbcf4cc56b04edbb22eef2856fce78bf4625b1 Mon Sep 17 00:00:00 2001 From: Harrison Shoff Date: Sun, 14 Feb 2016 18:35:23 -0800 Subject: [PATCH] [eslint-v2][whitespace] add no-whitespace-before-property rule --- README.md | 2 +- packages/eslint-config-airbnb/rules/style.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e2b48378..99f9b3df 100644 --- a/README.md +++ b/README.md @@ -1679,7 +1679,7 @@ Other Style Guides ``` - [18.6](#18.6) 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 diff --git a/packages/eslint-config-airbnb/rules/style.js b/packages/eslint-config-airbnb/rules/style.js index 4e8710c3..85c1fd70 100644 --- a/packages/eslint-config-airbnb/rules/style.js +++ b/packages/eslint-config-airbnb/rules/style.js @@ -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