Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(config): added shareable configuration jest/all (#276)
  • Loading branch information
nickineering authored and SimenB committed Jun 20, 2019
1 parent 3bb50dc commit d7a9532
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -87,6 +87,21 @@ 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"]
}
```

While the `recommended` and `style` configurations only change in major versions
the `all` configuration may change in any release and is thus unsuited for
installations requiring long-term consistency.

## 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 d7a9532

Please sign in to comment.