Skip to content

Commit

Permalink
[eslint] add mocha eslint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 22, 2018
1 parent 5a4bb4e commit 2c2871e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"root": true,
"env": {
"node": true,
"mocha": true
},
"rules": {
"id-length": 0,
Expand Down Expand Up @@ -52,6 +51,6 @@
"react/no-multi-comp": 0,
"react/jsx-one-expression-per-line": 0,
},
}
},
],
}
24 changes: 24 additions & 0 deletions packages/enzyme-test-suite/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"env": {
"mocha": true,
},
"plugins": ["mocha"],
"settings": {
"mocha/additionalTestFunctions": ["itIf", "describeIf"],
},
"rules": {
"no-param-reassign": 0,
"padded-blocks": 0,
Expand All @@ -30,5 +34,25 @@
"react/destructuring-assignment": 1,
"react/no-access-state-in-setstate": 1,
"react/button-has-type": 1,

"mocha/no-exclusive-tests": 2,
"mocha/no-global-tests": 2,
"mocha/no-nested-tests": 2,
"mocha/no-pending-tests": 2,
"mocha/no-sibling-hooks": 2,
"mocha/no-skipped-tests": 1,
"mocha/no-top-level-hooks": 2,
"mocha/valid-suite-description": [2, "^(?!should )"],
"mocha/valid-test-description": [2, "^(?!should )"],
},
"overrides": [
{
"files": [
"test/_helpers/*",
],
"rules": {
"mocha/no-exclusive-tests": 0,
},
}
],
}
1 change: 1 addition & 0 deletions packages/enzyme-test-suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-mocha": "^5.2.0",
"eslint-plugin-react": "^7.11.1",
"react-is": "^16.4.2"
}
Expand Down

0 comments on commit 2c2871e

Please sign in to comment.