@@ -19,42 +19,52 @@ const requireIndex = require('requireindex');
19
19
// import all rules in lib/rules
20
20
module . exports = {
21
21
rules : requireIndex ( path . resolve ( __dirname , './rules' ) ) ,
22
- configs : {
23
- recommended : {
24
- plugins : [ 'mocha-cleanup' ] ,
25
- rules : {
26
- 'mocha-cleanup/asserts-limit' : 2 ,
27
- 'mocha-cleanup/disallow-stub-spy-restore-in-it' : 2 ,
28
- 'mocha-cleanup/no-empty-title' : 2 ,
29
- 'mocha-cleanup/no-same-titles' : 2 ,
30
- 'mocha-cleanup/no-nested-it' : 2 ,
31
- 'mocha-cleanup/no-assertions-outside-it' : 2 ,
32
- 'mocha-cleanup/complexity-it' : 2 ,
33
- 'mocha-cleanup/no-eql-primitives' : 2 ,
34
- 'mocha-cleanup/no-assertions-in-loop' : 2 ,
35
- 'mocha-cleanup/no-empty-body' : 2 ,
36
- 'mocha-cleanup/invalid-assertions' : 2 ,
37
- 'mocha-cleanup/no-expressions-in-assertions' : 2 ,
38
- 'mocha-cleanup/no-outside-declaration' : 2 ,
39
- } ,
22
+ configs : { } ,
23
+ } ;
24
+
25
+ for ( const prefix of [ 'flat/' , '' ] ) {
26
+ module . exports . configs [ prefix + 'recommended' ] = {
27
+ rules : {
28
+ 'mocha-cleanup/asserts-limit' : 2 ,
29
+ 'mocha-cleanup/disallow-stub-spy-restore-in-it' : 2 ,
30
+ 'mocha-cleanup/no-empty-title' : 2 ,
31
+ 'mocha-cleanup/no-same-titles' : 2 ,
32
+ 'mocha-cleanup/no-nested-it' : 2 ,
33
+ 'mocha-cleanup/no-assertions-outside-it' : 2 ,
34
+ 'mocha-cleanup/complexity-it' : 2 ,
35
+ 'mocha-cleanup/no-eql-primitives' : 2 ,
36
+ 'mocha-cleanup/no-assertions-in-loop' : 2 ,
37
+ 'mocha-cleanup/no-empty-body' : 2 ,
38
+ 'mocha-cleanup/invalid-assertions' : 2 ,
39
+ 'mocha-cleanup/no-expressions-in-assertions' : 2 ,
40
+ 'mocha-cleanup/no-outside-declaration' : 2 ,
40
41
} ,
41
- 'recommended-no-limits' : {
42
- plugins : [ 'mocha-cleanup' ] ,
43
- rules : {
44
- // "mocha-cleanup/asserts-limit": 0,
45
- ' mocha-cleanup/disallow-stub-spy-restore-in-it' : 2 ,
46
- 'mocha-cleanup/no-empty-title ' : 2 ,
47
- 'mocha-cleanup/no-same-titles ' : 2 ,
48
- 'mocha-cleanup/no-nested-it ' : 2 ,
49
- 'mocha-cleanup/no-assertions-outside -it' : 2 ,
50
- // " mocha-cleanup/complexity-it": 0 ,
51
- ' mocha-cleanup/no-eql-primitives' : 2 ,
52
- 'mocha-cleanup/no-assertions-in-loop ' : 2 ,
53
- 'mocha-cleanup/no-empty-body ' : 2 ,
54
- 'mocha-cleanup/invalid-assertions ' : 2 ,
55
- 'mocha-cleanup/no-expressions-in -assertions' : 2 ,
56
- 'mocha-cleanup/no-outside-declaration ' : 2 ,
57
- } ,
42
+ } ;
43
+
44
+ module . exports . configs [ prefix + 'recommended-no-limits' ] = {
45
+ rules : {
46
+ // " mocha-cleanup/asserts-limit": 0 ,
47
+ 'mocha-cleanup/disallow-stub-spy-restore-in-it ' : 2 ,
48
+ 'mocha-cleanup/no-empty-title ' : 2 ,
49
+ 'mocha-cleanup/no-same-titles ' : 2 ,
50
+ 'mocha-cleanup/no-nested -it' : 2 ,
51
+ ' mocha-cleanup/no-assertions-outside-it' : 2 ,
52
+ // " mocha-cleanup/complexity-it": 0 ,
53
+ 'mocha-cleanup/no-eql-primitives ' : 2 ,
54
+ 'mocha-cleanup/no-assertions-in-loop ' : 2 ,
55
+ 'mocha-cleanup/no-empty-body ' : 2 ,
56
+ 'mocha-cleanup/invalid -assertions' : 2 ,
57
+ 'mocha-cleanup/no-expressions-in-assertions ' : 2 ,
58
+ 'mocha-cleanup/no-outside-declaration' : 2 ,
58
59
} ,
59
- } ,
60
+ } ;
61
+ }
62
+
63
+ module . exports . configs . recommended . plugins = [ 'mocha-cleanup' ] ;
64
+ module . exports . configs [ 'recommended-no-limits' ] . plugins = [ 'mocha-cleanup' ] ;
65
+ module . exports . configs [ 'flat/recommended' ] . plugins = {
66
+ 'mocha-cleanup' : module . exports ,
67
+ } ;
68
+ module . exports . configs [ 'flat/recommended-no-limits' ] . plugins = {
69
+ 'mocha-cleanup' : module . exports ,
60
70
} ;
0 commit comments