"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
- "plugin:promise/recommended"
+ "plugin:promise/recommended",
+ "plugin:sonarjs/recommended"
],
"env": {
"parser": "typescript-eslint-parser",
- "plugins": ["import", "jsx-a11y", "react", "promise"],
+ "plugins": ["import", "jsx-a11y", "react", "promise", "sonarjs"],
"rules": {
// possible errors
"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": {
"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",
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"
cliui "^2.1.0"
decamelize "^1.0.0"
window-size "0.1.0"
-
"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
- "plugin:promise/recommended"
+ "plugin:promise/recommended",
+ "plugin:sonarjs/recommended"
],
"env": {
"parser": "typescript-eslint-parser",
- "plugins": ["import", "jsx-a11y", "react", "promise"],
+ "plugins": ["import", "jsx-a11y", "react", "promise", "sonarjs"],
"rules": {
// possible errors
"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": {
"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",
"expose-loader": "0.7.5",
"flow-bin": "^0.52.0",
"html-webpack-plugin": "3.0.6",
import { UPDATE_FILTER } from './actions';
const filter = (state = 'all', action = {}) => {
- switch (action.type) {
- case UPDATE_FILTER:
- return action.filter;
- default:
- return state;
+ if (action.type === UPDATE_FILTER) {
+ return action.filter;
}
+ return state;
};
export default filter;
import { SELECT_PERMISSION } from './actions';
const selectedPermission = (state = null, action = {}) => {
- switch (action.type) {
- case SELECT_PERMISSION:
- return action.permission;
- default:
- return state;
+ if (action.type === SELECT_PERMISSION) {
+ return action.permission;
}
+ return state;
};
export default selectedPermission;
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"