From a3a0cf603a2581e3641ddd44015d07d6d367de2c Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 22 Jan 2016 00:27:02 -0500 Subject: [PATCH] tools: add arrow function rules to eslint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit enables the following rules: * arrow-parens - requires parens around arrow function arguments * arrow-spacing - ensures a space on each side of the => * no-arrow-condition - prevents accidental use of => in cases where the user really intends to use <= PR-URL: https://github.com/nodejs/node/pull/4813 Reviewed-By: Rod Vagg Reviewed-By: Stephen Belanger Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: Michaël Zasso Reviewed-By: Matteo Collina Reviewed-By: Evan Lucas Reviewed-By: Jeremiah Senkpiel Reviewed-By: Roman Reiss --- .eslintrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.eslintrc b/.eslintrc index 98afe47e78..9dd70f22be 100644 --- a/.eslintrc +++ b/.eslintrc @@ -90,6 +90,12 @@ rules: # list: http://eslint.org/docs/rules/#ecmascript-6 ## Suggest using 'const' wherever possible prefer-const: 2 + ## Enforce parens around arrow function arguments + arrow-parens: [2, "always"] + ## Require a space on each side of arrow operator + arrow-spacing: [2, {"before": true, "after": true}] + ## Prevent using => in a condition where <= is intended + no-arrow-condition: 2 # Strict Mode # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode