@@ -10,35 +10,47 @@ const END_TABLE_MARKER = '\n<!-- __END AUTOGENERATED TABLE__ -->';
1010
1111const expectedTableLines = Object . keys ( rules )
1212 . 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+ )
2634 . join ( '\n' ) ;
2735
2836const readmeContents = fs . readFileSync ( README_LOCATION , 'utf8' ) ;
2937
3038if ( ! 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+ ) ;
3242}
3343
3444if ( ! readmeContents . includes ( END_TABLE_MARKER ) ) {
3545 throw new Error ( `Could not find '${ END_TABLE_MARKER } ' marker in README.md.` ) ;
3646}
3747
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 ;
3950const linesEndIndex = readmeContents . indexOf ( END_TABLE_MARKER ) ;
4051
41- const updatedReadmeContents = readmeContents . slice ( 0 , linesStartIndex ) +
52+ const updatedReadmeContents =
53+ readmeContents . slice ( 0 , linesStartIndex ) +
4254 expectedTableLines +
4355 readmeContents . slice ( linesEndIndex ) ;
4456
0 commit comments