From efa30dd2f051999110766fb4881ba7796b6fc27f Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Thu, 8 Oct 2015 23:10:10 +0530 Subject: [PATCH] tools: enable prefer-const eslint rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description from: http://eslint.org/docs/rules/prefer-const.html If a variable is never modified, using the `const` declaration is better. `const` declaration tells readers, "this variable is never modified," reducing cognitive load and improving maintainability. Refer: https://github.com/nodejs/node/issues/3118 PR-URL: https://github.com/nodejs/node/pull/3152 Reviewed-By: Colin Ihrig Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Roman Reiss Reviewed-By: Michaël Zasso --- .eslintrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.eslintrc b/.eslintrc index cf1f7682cdcf91..1d14b72abb2bf3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -70,6 +70,11 @@ rules: # require space after keywords, eg 'for (..)' space-after-keywords: 2 + # ECMAScript 6 + # list: http://eslint.org/docs/rules/#ecmascript-6 + ## Suggest using 'const' wherever possible + prefer-const: 2 + # Strict Mode # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode ## 'use strict' on top