File tree Expand file tree Collapse file tree 1 file changed +37
-33
lines changed Expand file tree Collapse file tree 1 file changed +37
-33
lines changed Original file line number Diff line number Diff line change @@ -298,39 +298,7 @@ export const generatedRuleDocs: Plugin = () => {
298
298
}
299
299
}
300
300
301
- // 6. Add a notice about coming from ESLint core for extension rules
302
- if ( meta . docs . extendsBaseRule ) {
303
- root . children . push ( {
304
- children : [
305
- {
306
- type : 'jsx' ,
307
- value : '<sup>' ,
308
- } ,
309
- {
310
- type : 'text' ,
311
- value : 'Taken with ❤️ ' ,
312
- } ,
313
- {
314
- type : 'link' ,
315
- title : null ,
316
- url : `https://github.com/eslint/eslint/blob/main/docs/rules/${ meta . docs . extendsBaseRule } .md` ,
317
- children : [
318
- {
319
- type : 'text' ,
320
- value : 'from ESLint core' ,
321
- } ,
322
- ] ,
323
- } ,
324
- {
325
- type : 'jsx' ,
326
- value : '</sup>' ,
327
- } ,
328
- ] ,
329
- type : 'paragraph' ,
330
- } as mdast . Paragraph ) ;
331
- }
332
-
333
- // 7. Also add a link to view the rule's source and test code
301
+ // 6. Add a link to view the rule's source and test code
334
302
root . children . push (
335
303
{
336
304
children : [
@@ -388,6 +356,42 @@ export const generatedRuleDocs: Plugin = () => {
388
356
type : 'list' ,
389
357
} as mdast . List ,
390
358
) ;
359
+
360
+ // 7. Also add a notice about coming from ESLint core for extension rules
361
+ if ( meta . docs . extendsBaseRule ) {
362
+ root . children . push ( {
363
+ children : [
364
+ {
365
+ type : 'jsx' ,
366
+ value : '<sup>' ,
367
+ } ,
368
+ {
369
+ type : 'text' ,
370
+ value : 'Taken with ❤️ ' ,
371
+ } ,
372
+ {
373
+ type : 'link' ,
374
+ title : null ,
375
+ url : `https://github.com/eslint/eslint/blob/main/docs/src/rules/${
376
+ meta . docs . extendsBaseRule === true
377
+ ? file . stem
378
+ : meta . docs . extendsBaseRule
379
+ } .md`,
380
+ children : [
381
+ {
382
+ type : 'text' ,
383
+ value : 'from ESLint core' ,
384
+ } ,
385
+ ] ,
386
+ } ,
387
+ {
388
+ type : 'jsx' ,
389
+ value : '</sup>' ,
390
+ } ,
391
+ ] ,
392
+ type : 'paragraph' ,
393
+ } as mdast . Paragraph ) ;
394
+ }
391
395
} ;
392
396
} ;
393
397
You can’t perform that action at this time.
0 commit comments