From fc524a46098d1cfb4ca3991f41ea0b2f8334e404 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 13 Feb 2020 23:59:20 +0400 Subject: feat(eslint): Rule "no-magic-numbers" Signed-off-by: Valentin Popov --- ROADMAP.md | 2 +- src/rules/default.json | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index 3455def..ba1bcfb 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -138,7 +138,7 @@ - [ ] "no-lone-blocks" - [ ] "no-lonely-if" - [ ] "no-loop-func" -- [ ] "no-magic-numbers" +- [X] "no-magic-numbers" - [ ] "no-misleading-character-class" - [ ] "no-mixed-operators" - [ ] "no-mixed-requires" diff --git a/src/rules/default.json b/src/rules/default.json index 7df9925..9b6b2dc 100644 --- a/src/rules/default.json +++ b/src/rules/default.json @@ -206,6 +206,14 @@ "no-extra-semi": [ "error" ], + "no-magic-numbers": [ + "warn", + { + "detectObjects": false, + "enforceConst": true, + "ignoreArrayIndexes": false + } + ], "no-multi-spaces": [ "error", { -- cgit v1.2.3