aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-vsts
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-04-17 14:25:25 +0200
committerSonarTech <sonartech@sonarsource.com>2018-04-17 20:20:48 +0200
commitb6b3aab90877ce4b9106378e13eff601f794c68c (patch)
treedc7a2ce0bc8866a580d77527465ae04da04d152a /server/sonar-vsts
parent3a4cd557bc1448a83e1f8bcd0c2fe3de1a698ca7 (diff)
downloadsonarqube-b6b3aab90877ce4b9106378e13eff601f794c68c.tar.gz
sonarqube-b6b3aab90877ce4b9106378e13eff601f794c68c.zip
add eslint-plugin-sonarjs (#153)
Diffstat (limited to 'server/sonar-vsts')
-rw-r--r--server/sonar-vsts/.eslintrc11
-rw-r--r--server/sonar-vsts/package.json1
-rw-r--r--server/sonar-vsts/yarn.lock5
3 files changed, 13 insertions, 4 deletions
diff --git a/server/sonar-vsts/.eslintrc b/server/sonar-vsts/.eslintrc
index 298cd8bbc89..ddca3b05c68 100644
--- a/server/sonar-vsts/.eslintrc
+++ b/server/sonar-vsts/.eslintrc
@@ -4,7 +4,8 @@
"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
- "plugin:promise/recommended"
+ "plugin:promise/recommended",
+ "plugin:sonarjs/recommended"
],
"env": {
@@ -25,7 +26,7 @@
"parser": "typescript-eslint-parser",
- "plugins": ["import", "jsx-a11y", "react", "promise"],
+ "plugins": ["import", "jsx-a11y", "react", "promise", "sonarjs"],
"rules": {
// possible errors
@@ -197,7 +198,11 @@
"promise/catch-or-return": ["warn", { "allowThen": true }],
"promise/always-return": "off",
- "promise/avoid-new": "off"
+ "promise/avoid-new": "off",
+
+ // sonarjs
+ "sonarjs/cognitive-complexity": "warn",
+ "sonarjs/no-identical-functions": "warn"
},
"settings": {
diff --git a/server/sonar-vsts/package.json b/server/sonar-vsts/package.json
index 2ad9444fa63..9a061014420 100644
--- a/server/sonar-vsts/package.json
+++ b/server/sonar-vsts/package.json
@@ -46,6 +46,7 @@
"eslint-plugin-jsx-a11y": "6.0.2",
"eslint-plugin-promise": "3.6.0",
"eslint-plugin-react": "7.6.1",
+ "eslint-plugin-sonarjs": "0.1.0",
"html-webpack-plugin": "3.0.6",
"jest": "22.0.6",
"postcss-calc": "6.0.1",
diff --git a/server/sonar-vsts/yarn.lock b/server/sonar-vsts/yarn.lock
index 1fad7fa5983..5d03d335354 100644
--- a/server/sonar-vsts/yarn.lock
+++ b/server/sonar-vsts/yarn.lock
@@ -2479,6 +2479,10 @@ eslint-plugin-react@7.6.1:
jsx-ast-utils "^2.0.1"
prop-types "^15.6.0"
+eslint-plugin-sonarjs@0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.1.0.tgz#fedf6e67296c30470002c48d10a701d69e40af8a"
+
eslint-scope@^3.7.1:
version "3.7.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
@@ -7607,4 +7611,3 @@ yargs@~3.10.0:
cliui "^2.1.0"
decamelize "^1.0.0"
window-size "0.1.0"
-