Skip to content

Commit d7a9532

Browse files
nickineeringSimenB
authored andcommitted
feat(config): added shareable configuration jest/all (#276)
1 parent 3bb50dc commit d7a9532

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,21 @@ See
8787
[ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
8888
for more information about extending configuration files.
8989

90+
### All
91+
92+
If you want to enable all rules instead of only some you can do so by adding the
93+
`all` configuration to your `.eslintrc` config file:
94+
95+
```json
96+
{
97+
"extends": ["plugin:jest/all"]
98+
}
99+
```
100+
101+
While the `recommended` and `style` configurations only change in major versions
102+
the `all` configuration may change in any release and is thus unsuited for
103+
installations requiring long-term consistency.
104+
90105
## Rules
91106

92107
| Rule | Description | Recommended | Fixable |

src/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@ const rules = fs
1111
(acc, curr) => Object.assign(acc, { [curr]: require(`./rules/${curr}`) }),
1212
{},
1313
);
14+
let allRules = {};
15+
Object.keys(rules).forEach(function(key) {
16+
allRules[`jest/${key}`] = 'error';
17+
});
1418

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

1721
module.exports = {
1822
configs: {
23+
all: {
24+
plugins: ['jest'],
25+
env: {
26+
'jest/globals': true,
27+
},
28+
rules: allRules,
29+
},
1930
recommended: {
2031
plugins: ['jest'],
2132
env: {

0 commit comments

Comments
 (0)