Skip to content

Commit 0144e3e

Browse files
Add all configuration (#250)
* Add `all` configuration * Update docs/user-guide/README.md Co-authored-by: Michael Schmidt <[email protected]> * Update docs/user-guide/README.md Co-authored-by: Michael Schmidt <[email protected]> * Update README.md * Update README.md * Revert `tools/update-rulesets.ts` * Replaced `all.ts` with RunDevelopment's suggested version * RunDevelopment's suggestion Co-authored-by: Michael Schmidt <[email protected]>
1 parent 4fe0b65 commit 0144e3e

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ npm install --save-dev eslint eslint-plugin-regexp
4646
<!--USAGE_SECTION_START-->
4747

4848
Add `regexp` to the plugins section of your `.eslintrc` configuration file (you can omit the `eslint-plugin-` prefix)
49-
and either use the recommended configuration or configure the rules you want:
49+
and either use one of the two configurations available (`recommended` or `all`) or configure the rules you want:
5050

5151
### The recommended configuration
5252

@@ -84,6 +84,11 @@ module.exports = {
8484
}
8585
```
8686

87+
### Using `"plugin:regexp/all"`
88+
89+
The `plugin:regexp/all` config enables all rules. It's meant for testing, not for production use because it changes with every minor and major version of the plugin. Use it at your own risk.
90+
*See [https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/all.ts](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/all.ts) for more details.*
91+
8792
<!--USAGE_SECTION_END-->
8893

8994
## :white_check_mark: Rules

docs/user-guide/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm install --save-dev eslint eslint-plugin-regexp
1818
<!--USAGE_SECTION_START-->
1919

2020
Add `regexp` to the plugins section of your `.eslintrc` configuration file (you can omit the `eslint-plugin-` prefix)
21-
and either use the recommended configuration or configure the rules you want:
21+
and either use one of the two configurations available (`recommended` or `all`) or configure the rules you want:
2222

2323
### The recommended configuration
2424

@@ -56,6 +56,11 @@ module.exports = {
5656
}
5757
```
5858

59+
### Using `"plugin:regexp/all"`
60+
61+
The `plugin:regexp/all` config enables all rules. It's meant for testing, not for production use because it changes with every minor and major version of the plugin. Use it at your own risk.
62+
*See [https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/all.ts](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/all.ts) for more details.*
63+
5964
<!--USAGE_SECTION_END-->
6065

6166
See [the rule list](../rules/README.md) to get the `rules` that this plugin provides.

lib/configs/all.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import recommended from "./recommended"
2+
import { rules } from "../utils/rules"
3+
4+
const all: Record<string, string> = {}
5+
for (const rule of rules) {
6+
all[rule.meta.docs.ruleId] = "error"
7+
}
8+
9+
export = {
10+
plugins: ["regexp"],
11+
rules: {
12+
...all,
13+
...recommended.rules,
14+
},
15+
}

lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { RuleModule } from "./types"
22
import { rules as ruleList } from "./utils/rules"
33
import recommended from "./configs/recommended"
4+
import all from "./configs/all"
45

56
const configs = {
67
recommended,
8+
all,
79
}
810

911
const rules = ruleList.reduce((obj, r) => {

0 commit comments

Comments
 (0)