@@ -10,35 +10,47 @@ const END_TABLE_MARKER = '\n<!-- __END AUTOGENERATED TABLE__ -->';
10
10
11
11
const expectedTableLines = Object . keys ( rules )
12
12
. sort ( )
13
- . reduce ( ( lines , ruleId ) => {
14
- const rule = rules [ ruleId ] ;
15
-
16
- lines . push ( [
17
- `[${ ruleId } ](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/${ ruleId } .md)` ,
18
- rule . meta . docs . recommended ? '✔️' : '' ,
19
- rule . meta . fixable ? '🛠' : '' ,
20
- rule . meta . hasSuggestions ? '💡' : '' ,
21
- rule . meta . docs . description ,
22
- ] . join ( ' | ' ) ) ;
23
-
24
- return lines ;
25
- } , [ 'Name | ✔️ | 🛠 | 💡 | Description' , '----- | ----- | ----- | ----- | -----' ] )
13
+ . reduce (
14
+ ( lines , ruleId ) => {
15
+ const rule = rules [ ruleId ] ;
16
+
17
+ lines . push (
18
+ [
19
+ `[${ ruleId } ](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/${ ruleId } .md)` ,
20
+ rule . meta . docs . recommended ? '✔️' : '' ,
21
+ rule . meta . fixable ? '🛠' : '' ,
22
+ rule . meta . hasSuggestions ? '💡' : '' ,
23
+ rule . meta . docs . description ,
24
+ ] . join ( ' | ' )
25
+ ) ;
26
+
27
+ return lines ;
28
+ } ,
29
+ [
30
+ 'Name | ✔️ | 🛠 | 💡 | Description' ,
31
+ '----- | ----- | ----- | ----- | -----' ,
32
+ ]
33
+ )
26
34
. join ( '\n' ) ;
27
35
28
36
const readmeContents = fs . readFileSync ( README_LOCATION , 'utf8' ) ;
29
37
30
38
if ( ! readmeContents . includes ( BEGIN_TABLE_MARKER ) ) {
31
- throw new Error ( `Could not find '${ BEGIN_TABLE_MARKER } ' marker in README.md.` ) ;
39
+ throw new Error (
40
+ `Could not find '${ BEGIN_TABLE_MARKER } ' marker in README.md.`
41
+ ) ;
32
42
}
33
43
34
44
if ( ! readmeContents . includes ( END_TABLE_MARKER ) ) {
35
45
throw new Error ( `Could not find '${ END_TABLE_MARKER } ' marker in README.md.` ) ;
36
46
}
37
47
38
- const linesStartIndex = readmeContents . indexOf ( BEGIN_TABLE_MARKER ) + BEGIN_TABLE_MARKER . length ;
48
+ const linesStartIndex =
49
+ readmeContents . indexOf ( BEGIN_TABLE_MARKER ) + BEGIN_TABLE_MARKER . length ;
39
50
const linesEndIndex = readmeContents . indexOf ( END_TABLE_MARKER ) ;
40
51
41
- const updatedReadmeContents = readmeContents . slice ( 0 , linesStartIndex ) +
52
+ const updatedReadmeContents =
53
+ readmeContents . slice ( 0 , linesStartIndex ) +
42
54
expectedTableLines +
43
55
readmeContents . slice ( linesEndIndex ) ;
44
56
0 commit comments