Skip to content

Commit 701e38c

Browse files
thefourtheyervagg
authored andcommitted
tools: enable prefer-const eslint rule
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 <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 1929d5b commit 701e38c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.eslintrc

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ rules:
7070
# require space after keywords, eg 'for (..)'
7171
space-after-keywords: 2
7272

73+
# ECMAScript 6
74+
# list: http://eslint.org/docs/rules/#ecmascript-6
75+
## Suggest using 'const' wherever possible
76+
prefer-const: 2
77+
7378
# Strict Mode
7479
# list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
7580
## 'use strict' on top

0 commit comments

Comments
 (0)