summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2020-02-14 00:54:49 +0300
committerValentin Popov <info@valentineus.link>2020-02-14 00:54:49 +0300
commitdf848834f582a1cba6e275d4dd408eeb95f5ef26 (patch)
treefb833c53bee83a10268414519ab9d8701d7883b1
parent6feb5456418b15b25cdd6408a43c9af6f8c58fa9 (diff)
downloadeslint-config-df848834f582a1cba6e275d4dd408eeb95f5ef26.tar.xz
eslint-config-df848834f582a1cba6e275d4dd408eeb95f5ef26.zip
feat(eslint): Rule "prefer-const"
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r--ROADMAP.md2
-rw-r--r--src/rules/default.json7
2 files changed, 8 insertions, 1 deletions
diff --git a/ROADMAP.md b/ROADMAP.md
index c28c3f2..c6e9031 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -233,7 +233,7 @@
- [ ] "padded-blocks"
- [ ] "padding-line-between-statements"
- [ ] "prefer-arrow-callback"
-- [ ] "prefer-const"
+- [X] "prefer-const"
- [ ] "prefer-destructuring"
- [ ] "prefer-exponentiation-operator"
- [ ] "prefer-named-capture-group"
diff --git a/src/rules/default.json b/src/rules/default.json
index f6d347b..5a92435 100644
--- a/src/rules/default.json
+++ b/src/rules/default.json
@@ -388,6 +388,13 @@
"error",
"never"
],
+ "prefer-const": [
+ "error",
+ {
+ "destructuring": "any",
+ "ignoreReadBeforeAssign": false
+ }
+ ],
"prefer-reflect": [
"off"
],