Skip to content

Commit

Permalink
feat(jest): move into its own file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Haroenv committed Jun 28, 2017
1 parent e5ade41 commit 2259ed6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,33 @@ module.exports = {
}
```

### Jest

We recommend using Jest as a test runner.

**terminal**
```sh
yarn add eslint-plugin-jest --dev
```

**.eslintrc.js**
```js
module.exports = {
extends: 'algolia/jest'
};
```

**package.json**
```json
{
"scripts": {
"test": "npm run lint",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix"
}
}
```

### React

**terminal**
Expand Down
4 changes: 1 addition & 3 deletions base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
browser: true,
es6: true,
node: true,
jest: true,
},
parser: 'babel-eslint', // allows both flowtype and static class properties
parserOptions: {
Expand All @@ -16,11 +15,10 @@ module.exports = {
jsx: true,
},
},
plugins: ['import', 'jest', 'prettier'],
plugins: ['import', 'prettier'],
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:jest/recommended',
'./rules/base.js',
'prettier',
],
Expand Down
8 changes: 8 additions & 0 deletions jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// eslint-disable-next-line import/no-commonjs
module.exports = {
env: {
jest: true,
},
extends: ['plugin:jest/recommended', './base.js'],
plugins: ['jest'],
};

0 comments on commit 2259ed6

Please sign in to comment.