From 41c9b341e367b0b1ef238b0042b604e96fb0a010 Mon Sep 17 00:00:00 2001 From: Nicholas Ferrara Date: Sun, 9 Jun 2019 00:10:19 +0100 Subject: [PATCH 1/2] feat(config): added shareable configuration plugin:jest/all --- README.md | 11 +++++++++++ src/index.js | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 351b7674c..33f419046 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/src/index.js b/src/index.js index 53e7afd5b..31101b385 100644 --- a/src/index.js +++ b/src/index.js @@ -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: { From 6e8af0afb1116fdf8b429a6ce6031dde7ef0b009 Mon Sep 17 00:00:00 2001 From: Nicholas Ferrara Date: Wed, 19 Jun 2019 22:14:17 +0100 Subject: [PATCH 2/2] docs: included semver warning for all config --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 33f419046..b370f1a50 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,10 @@ If you want to enable all rules instead of only some you can do so by adding the } ``` +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 |