summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ROADMAP.md28
-rw-r--r--package.json4
-rw-r--r--src/javascript.ts4
-rw-r--r--src/rules/sonarjs.json1
-rw-r--r--yarn.lock5
5 files changed, 41 insertions, 1 deletions
diff --git a/ROADMAP.md b/ROADMAP.md
index 8cc9d68..895366f 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -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 @@
+{}
diff --git a/yarn.lock b/yarn.lock
index f73ba79..74e10ed 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -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"