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 = {
4040
4141### ./.eslintrc
4242
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+
4356``` json
4457{
45- "plugins" : [" eslint-plugin-local-rules" ],
58+ "plugins" : [" local-rules" ],
59+ "extends" : [
60+ " plugin:local-rules/all-warn"
61+ ]
62+ }
63+ ```
4664
65+ #### Customize each rule independently
66+
67+ ``` json
68+ {
69+ "plugins" : [" local-rules" ],
4770 "rules" : {
4871 "local-rules/disallow-identifiers" : " error"
4972 }
Original file line number Diff line number Diff line change @@ -26,6 +26,18 @@ if (!rules) {
2626 ) ;
2727}
2828
29+ var getConfig = ( type ) => ( {
30+ rules : Object . fromEntries (
31+ Object
32+ . keys ( rules )
33+ . map ( ( rule ) => [ `local-rules/${ rule } ` , type ] )
34+ ) ;
35+ } ) ;
36+
2937module . exports = {
38+ configs : {
39+ all : getConfig ( 'error' ) ,
40+ 'all-warn' : getConfig ( 'warn' ) ,
41+ } ,
3042 rules : rules ,
3143} ;
You can’t perform that action at this time.
0 commit comments