Skip to content

Commit

Permalink
tools: enable prefer-const eslint rule
Browse files Browse the repository at this point in the history
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: #3118
PR-URL: #3152
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
  • Loading branch information
thefourtheye authored and rvagg committed Oct 29, 2015
1 parent 1929d5b commit 701e38c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 701e38c

Please sign in to comment.