Skip to content

Commit

Permalink
feat: plugin:jest/all: added shareable configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nickineering committed Jun 8, 2019
1 parent 1740ee7 commit 718b6d9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -87,6 +87,17 @@ See
[ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information about extending configuration files.

### All

If you want to enable all rules instead of only some you can do so by adding the
`all` configuration to your `.eslintrc` config file:

```json
{
"extends": ["plugin:jest/all"]
}
```

## Rules

| Rule | Description | Recommended | Fixable |
Expand Down
11 changes: 11 additions & 0 deletions src/index.js
Expand Up @@ -11,11 +11,22 @@ const rules = fs
(acc, curr) => Object.assign(acc, { [curr]: require(`./rules/${curr}`) }),
{},
);
let allRules = {};
Object.keys(rules).forEach(function(key) {
allRules[`jest/${key}`] = 'error';
});

const snapshotProcessor = require('./processors/snapshot-processor');

module.exports = {
configs: {
all: {
plugins: ['jest'],
env: {
'jest/globals': true,
},
rules: allRules,
},
recommended: {
plugins: ['jest'],
env: {
Expand Down

0 comments on commit 718b6d9

Please sign in to comment.