Skip to content

Commit

Permalink
moved some codeclimate rules to eslint (upgraded to v5)
Browse files Browse the repository at this point in the history
  • Loading branch information
daneryl committed Feb 19, 2019
1 parent 947fe9c commit 53dfad0
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 172 deletions.
25 changes: 10 additions & 15 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
version: "2" # required to adjust maintainability checks
checks:
argument-count:
config:
threshold: 4
enabled: false
file-lines:
enabled: false
method-lines:
enabled: false
return-statements:
enabled: false
method-count:
enabled: false
complex-logic:
config:
threshold: 4
file-lines:
config:
threshold: 250
method-complexity:
config:
threshold: 5
method-count:
config:
threshold: 20
method-lines:
config:
threshold: 25
nested-control-flow:
config:
threshold: 4
return-statements:
config:
threshold: 4
similar-code:
enabled: false
identical-code:
enabled: false
plugins:
eslint:
enabled: true
channel: "eslint-4"
channel: "eslint-5"
config:
config: .eslintrc
ratings:
Expand Down
28 changes: 27 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"ArrayExpression": "off",
"ObjectExpression": "off"}
],
"operator-linebreak": ["warn", "after"],
"no-mixed-operators": "off",
"no-underscore-dangle": "off",
"comma-dangle": "off",
Expand Down Expand Up @@ -62,6 +63,14 @@
"arrow-spacing": ["warn"],
"no-empty": ["warn"],
"no-cond-assign": ["warn"],
"no-multiple-empty-lines": ["warn"],
"implicit-arrow-linebreak": ["warn"],
"lines-between-class-members": ["warn"],
"max-lines": ["warn", 250],
"max-params": ["warn", 4],
"max-lines-per-function": ["warn", { "max": 25 }],
"max-statements": ["warn", { "max": 10 }, { "ignoreTopLevelFunctions": true }],


//import
"import/no-duplicates": ["warn"],
Expand All @@ -71,6 +80,9 @@
"import/newline-after-import": ["warn"],
"import/extensions": "never",
"import/no-unresolved": "off",
"import/order": ["warn"],
"import/named": ["warn"],
"import/no-cycle": ["warn"],

//react
"react/self-closing-comp": ["warn"],
Expand All @@ -95,6 +107,11 @@
"react/jsx-no-target-blank": ["warn"],
"react/jsx-filename-extension": "off",
"react/jsx-tag-spacing": "off",
"react/destructuring-assignment": ["warn"],
"react/jsx-one-expression-per-line": "off",
"import/no-useless-path-segments": ["warn"],
"react/button-has-type": ["warn"],
"react/no-access-state-in-setstate": ["warn"],

//jsx-a11y
"jsx-a11y/anchor-is-valid": ["warn"],
Expand All @@ -106,6 +123,15 @@
"jsx-a11y/alt-text": ["warn"],
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/mouse-events-have-key-events": "off"
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": ["warn"]
},
"overrides": [
{
"files": ["app/**/*spec.js"],
"rules": {
"max-lines-per-function": "off"
}
}
]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@
"enzyme": "3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.3",
"eslint": "4.18.1",
"eslint-config-airbnb": "^16.1.0",
"eslint": "v5.14.1",
"eslint-config-airbnb": "v17.1.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jasmine": "2.9.2",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "7.7.0",
"eslint-plugin-react": "v7.12.4",
"fetch-mock": "5.9.3",
"identity-obj-proxy": "^3.0.0",
"img-loader": "2.0.1",
Expand Down
Loading

0 comments on commit 53dfad0

Please sign in to comment.