Skip to content

Commit 2259ed6

Browse files
committed
feat(jest): move into its own file
I think this will be a breaking change, but I'm not a hundred percent sure. I'm also not too sure how to test this
1 parent e5ade41 commit 2259ed6

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,33 @@ module.exports = {
6666
}
6767
```
6868

69+
### Jest
70+
71+
We recommend using Jest as a test runner.
72+
73+
**terminal**
74+
```sh
75+
yarn add eslint-plugin-jest --dev
76+
```
77+
78+
**.eslintrc.js**
79+
```js
80+
module.exports = {
81+
extends: 'algolia/jest'
82+
};
83+
```
84+
85+
**package.json**
86+
```json
87+
{
88+
"scripts": {
89+
"test": "npm run lint",
90+
"lint": "eslint .",
91+
"lint:fix": "npm run lint -- --fix"
92+
}
93+
}
94+
```
95+
6996
### React
7097

7198
**terminal**

base.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module.exports = {
44
browser: true,
55
es6: true,
66
node: true,
7-
jest: true,
87
},
98
parser: 'babel-eslint', // allows both flowtype and static class properties
109
parserOptions: {
@@ -16,11 +15,10 @@ module.exports = {
1615
jsx: true,
1716
},
1817
},
19-
plugins: ['import', 'jest', 'prettier'],
18+
plugins: ['import', 'prettier'],
2019
extends: [
2120
'eslint:recommended',
2221
'plugin:import/errors',
23-
'plugin:jest/recommended',
2422
'./rules/base.js',
2523
'prettier',
2624
],

jest.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// eslint-disable-next-line import/no-commonjs
2+
module.exports = {
3+
env: {
4+
jest: true,
5+
},
6+
extends: ['plugin:jest/recommended', './base.js'],
7+
plugins: ['jest'],
8+
};

0 commit comments

Comments
 (0)