From 46d05009cc38f7c1c97f5bb42d3c018cb606b681 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Mar 2020 21:12:27 +0400 Subject: feat(sonarjs): Added rules Signed-off-by: Valentin Popov --- src/rules/sonarjs/default.json | 81 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) (limited to 'src/rules/sonarjs') diff --git a/src/rules/sonarjs/default.json b/src/rules/sonarjs/default.json index 0967ef4..cc5897a 100644 --- a/src/rules/sonarjs/default.json +++ b/src/rules/sonarjs/default.json @@ -1 +1,80 @@ -{} +{ + "sonarjs/cognitive-complexity": [ + "warn", + 25 + ], + "sonarjs/max-switch-cases": [ + "warn", + 30 + ], + "sonarjs/no-all-duplicated-branches": [ + "error" + ], + "sonarjs/no-collapsible-if": [ + "error" + ], + "sonarjs/no-collection-size-mischeck": [ + "error" + ], + "sonarjs/no-duplicate-string": [ + "warn", + 5 + ], + "sonarjs/no-duplicated-branches": [ + "error" + ], + "sonarjs/no-element-overwrite": [ + "error" + ], + "sonarjs/no-extra-arguments": [ + "error" + ], + "sonarjs/no-identical-conditions": [ + "error" + ], + "sonarjs/no-identical-expressions": [ + "error" + ], + "sonarjs/no-identical-functions": [ + "error" + ], + "sonarjs/no-inverted-boolean-check": [ + "error" + ], + "sonarjs/no-one-iteration-loop": [ + "error" + ], + "sonarjs/no-redundant-boolean": [ + "error" + ], + "sonarjs/no-redundant-jump": [ + "error" + ], + "sonarjs/no-same-line-conditional": [ + "error" + ], + "sonarjs/no-small-switch": [ + "error" + ], + "sonarjs/no-unused-collection": [ + "error" + ], + "sonarjs/no-use-of-empty-return-value": [ + "error" + ], + "sonarjs/no-useless-catch": [ + "warn" + ], + "sonarjs/please-immediate-return": [ + "error" + ], + "sonarjs/prefer-object-literal": [ + "error" + ], + "sonarjs/prefer-single-boolean-return": [ + "error" + ], + "sonarjs/prefer-while": [ + "error" + ] +} -- cgit v1.2.3 From 9ba18706cdcd61618ad1e92f14587fb855deb1c8 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Mar 2020 21:34:11 +0400 Subject: fix(sonarjs): prefer-immediate-return Signed-off-by: Valentin Popov --- src/rules/sonarjs/default.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rules/sonarjs') diff --git a/src/rules/sonarjs/default.json b/src/rules/sonarjs/default.json index cc5897a..5c39836 100644 --- a/src/rules/sonarjs/default.json +++ b/src/rules/sonarjs/default.json @@ -65,7 +65,7 @@ "sonarjs/no-useless-catch": [ "warn" ], - "sonarjs/please-immediate-return": [ + "sonarjs/prefer-immediate-return": [ "error" ], "sonarjs/prefer-object-literal": [ -- cgit v1.2.3