diff options
author | Valentin Popov <info@valentineus.link> | 2020-02-14 11:25:05 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2020-02-14 11:25:05 +0300 |
commit | 3a6a1d0c3ad4d742e4da37b93613cf77b066dc7f (patch) | |
tree | 46ee4492ffb3ff780281966e90debf21d91d39db | |
parent | 570290241dc983abfb14bb20b0e8eb8b3a74a22d (diff) | |
download | eslint-config-3a6a1d0c3ad4d742e4da37b93613cf77b066dc7f.tar.xz eslint-config-3a6a1d0c3ad4d742e4da37b93613cf77b066dc7f.zip |
feat(sonar): Initial SonarJS plugin
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r-- | ROADMAP.md | 28 | ||||
-rw-r--r-- | package.json | 4 | ||||
-rw-r--r-- | src/javascript.ts | 4 | ||||
-rw-r--r-- | src/rules/sonarjs.json | 1 | ||||
-rw-r--r-- | yarn.lock | 5 |
5 files changed, 41 insertions, 1 deletions
@@ -340,6 +340,34 @@ - [ ] "detect-pseudoRandomBytes" - [ ] "detect-unsafe-regex" +## SonarJS + +- [ ] "cognitive-complexity" +- [ ] "max-switch-cases" +- [ ] "no-all-duplicated-branches" +- [ ] "no-collapsible-if" +- [ ] "no-collection-size-mischeck" +- [ ] "no-duplicate-string" +- [ ] "no-duplicated-branches" +- [ ] "no-element-overwrite" +- [ ] "no-extra-arguments" +- [ ] "no-identical-conditions" +- [ ] "no-identical-expressions" +- [ ] "no-identical-functions" +- [ ] "no-inverted-boolean-check" +- [ ] "no-one-iteration-loop" +- [ ] "no-redundant-boolean" +- [ ] "no-redundant-jump" +- [ ] "no-same-line-conditional" +- [ ] "no-small-switch" +- [ ] "no-unused-collection" +- [ ] "no-use-of-empty-return-value" +- [ ] "no-useless-catch" +- [ ] "prefer-immediate-return" +- [ ] "prefer-object-literal" +- [ ] "prefer-single-boolean-return" +- [ ] "prefer-while" + ## TypeScript - [ ] "adjacent-overload-signatures" diff --git a/package.json b/package.json index b20c629..fd69939 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "eslint": "^6.8.0", "eslint-plugin-import": "^2.20.1", "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.5.0", "rollup": "^1.31.1", "rollup-plugin-terser": "^5.2.0", "tslib": "^1.10.0", @@ -28,7 +29,8 @@ "@typescript-eslint/parser": "^2.19.0", "eslint": "^6.8.0", "eslint-plugin-import": "^2.20.1", - "eslint-plugin-security": "^1.4.0" + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.5.0" }, "dependencies": {} } diff --git a/src/javascript.ts b/src/javascript.ts index 9026379..85499be 100644 --- a/src/javascript.ts +++ b/src/javascript.ts @@ -1,6 +1,7 @@ import rDefault from "./rules/default.json"; import rImport from "./rules/import.json"; import rSecurity from "./rules/security.json"; +import rSonarJS from "./rules/sonarjs.json"; module.exports = { "extends": [ @@ -9,14 +10,17 @@ module.exports = { "plugin:import/recommended", "plugin:import/warnings", "plugin:security/recommended", + "plugin:sonarjs/recommended", ], "plugins": [ "import", "security", + "sonarjs", ], "rules": { ...rDefault, ...rImport, ...rSecurity, + ...rSonarJS, }, }; diff --git a/src/rules/sonarjs.json b/src/rules/sonarjs.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/rules/sonarjs.json @@ -0,0 +1 @@ +{} @@ -393,6 +393,11 @@ eslint-plugin-security@^1.4.0: dependencies: safe-regex "^1.1.0" +eslint-plugin-sonarjs@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.5.0.tgz#ce17b2daba65a874c2862213a9e38e8986ad7d7d" + integrity sha512-XW5MnzlRjhXpIdbULC/qAdJYHWw3rRLws/DyawdlPU/IdVr9AmRK1r2LaCvabwKOAW2XYYSo3kDX58E4MrB7PQ== + eslint-scope@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" |