From 514bd87d1a8d96f7259ed4d1bcc9eb64618811a0 Mon Sep 17 00:00:00 2001 From: Vladimir Kutepov Date: Fri, 11 Dec 2015 13:39:03 +0500 Subject: [PATCH] Require space before/after arrow function's arrow (arrow-spacing) Enable [arrow-spacing](http://eslint.org/docs/rules/arrow-spacing.html) rule, code with space before/after arrow function's arrow is easier to read. ```js () => {}; (a) => {}; a => a; () => {'\n'}; ()=> {}; /*error Missing space before =>*/ () =>{}; /*error Missing space after =>*/ (a)=> {}; /*error Missing space before =>*/ (a) =>{}; /*error Missing space after =>*/ a =>a; /*error Missing space after =>*/ a=> a; /*error Missing space before =>*/ ()=> {'\n'}; /*error Missing space before =>*/ () =>{'\n'}; /*error Missing space after =>*/ ``` --- packages/eslint-config-airbnb/rules/es6.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config-airbnb/rules/es6.js b/packages/eslint-config-airbnb/rules/es6.js index b7fde7bf..fde86e8f 100644 --- a/packages/eslint-config-airbnb/rules/es6.js +++ b/packages/eslint-config-airbnb/rules/es6.js @@ -25,7 +25,8 @@ module.exports = { // require parens in arrow function arguments 'arrow-parens': 0, // require space before/after arrow function's arrow - 'arrow-spacing': 0, + // https://github.com/eslint/eslint/blob/master/docs/rules/arrow-spacing.md + 'arrow-spacing': [2, { 'before': true, 'after': true }], // verify super() callings in constructors 'constructor-super': 0, // enforce the spacing around the * in generator functions