Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): added shareable configuration plugin:jest/all #276

Merged
merged 2 commits into from Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a caveat about this not being subject to semver, so use with caution, blahblah 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


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