Skip to content

Commit

Permalink
feat: add style recommended config
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Nov 7, 2018
1 parent 5d3ebcc commit af070bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -72,6 +72,17 @@ config file:
}
```

### Style

This plugin also exports a configuration named `style`, which adds some
stylistic rules, such as `prefer-to-be-null`, which enforces usage of `toBeNull`
over `toBe(null)`. All rules included are:

- `prefer-to-be-null`
- `prefer-to-be-undefined`
- `prefer-to-contain`
- `prefer-to-have-length`

See
[ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information about extending configuration files.
Expand Down
9 changes: 9 additions & 0 deletions index.js
Expand Up @@ -49,6 +49,15 @@ module.exports = {
'jest/valid-expect-in-promise': 'error',
},
},
style: {
plugins: ['jest'],
rules: {
'jest/prefer-to-be-null': 'error',
'jest/prefer-to-be-undefined': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
},
},
},
environments: {
globals: {
Expand Down

0 comments on commit af070bc

Please sign in to comment.