File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,33 @@ module.exports = {
40
40
41
41
### ./.eslintrc
42
42
43
+ #### Use all rules as errors
44
+
45
+ ``` json
46
+ {
47
+ "plugins" : [" local-rules" ],
48
+ "extends" : [
49
+ " plugin:local-rules/all"
50
+ ]
51
+ }
52
+ ```
53
+
54
+ #### Use all rules as warnings
55
+
43
56
``` json
44
57
{
45
- "plugins" : [" eslint-plugin-local-rules" ],
58
+ "plugins" : [" local-rules" ],
59
+ "extends" : [
60
+ " plugin:local-rules/all-warn"
61
+ ]
62
+ }
63
+ ```
46
64
65
+ #### Customize each rule independently
66
+
67
+ ``` json
68
+ {
69
+ "plugins" : [" local-rules" ],
47
70
"rules" : {
48
71
"local-rules/disallow-identifiers" : " error"
49
72
}
Original file line number Diff line number Diff line change @@ -26,6 +26,18 @@ if (!rules) {
26
26
) ;
27
27
}
28
28
29
+ var getConfig = ( type ) => ( {
30
+ rules : Object . fromEntries (
31
+ Object
32
+ . keys ( rules )
33
+ . map ( ( rule ) => [ `local-rules/${ rule } ` , type ] )
34
+ ) ;
35
+ } ) ;
36
+
29
37
module . exports = {
38
+ configs : {
39
+ all : getConfig ( 'error' ) ,
40
+ 'all-warn' : getConfig ( 'warn' ) ,
41
+ } ,
30
42
rules : rules ,
31
43
} ;
You can’t perform that action at this time.
0 commit comments