@@ -54,6 +54,7 @@ tester.run('require-meta-docs-url', rule, {
5454 pattern : 'path/to/{{name}}.md' ,
5555 } ,
5656 ] ,
57+ name : "no filename (pattern: 'path/to/{{name}}.md')" ,
5758 } ,
5859 {
5960 filename : 'test-rule' ,
@@ -68,6 +69,7 @@ tester.run('require-meta-docs-url', rule, {
6869 pattern : 'path/to/{{name}}.md' ,
6970 } ,
7071 ] ,
72+ name : "matching path (pattern: 'path/to/{{name}}.md')" ,
7173 } ,
7274 {
7375 // CJS file extension
@@ -79,6 +81,7 @@ tester.run('require-meta-docs-url', rule, {
7981 }
8082 ` ,
8183 options : [ { pattern : 'path/to/{{name}}.md' } ] ,
84+ name : "matching path with cjs extension (pattern: 'path/to/{{name}}.md')" ,
8285 } ,
8386 {
8487 // ESM
@@ -95,6 +98,7 @@ tester.run('require-meta-docs-url', rule, {
9598 } ,
9699 ] ,
97100 languageOptions : { sourceType : 'module' } ,
101+ name : "ESM (pattern: 'path/to/{{name}}.md')" ,
98102 } ,
99103 {
100104 // TypeScript
@@ -107,6 +111,7 @@ tester.run('require-meta-docs-url', rule, {
107111 ` ,
108112 options : [ { pattern : 'path/to/{{name}}.md' } ] ,
109113 languageOptions : { sourceType : 'module' } ,
114+ name : "TypeScript (pattern: 'path/to/{{name}}.md')" ,
110115 } ,
111116 {
112117 // `url` in variable.
@@ -123,6 +128,7 @@ tester.run('require-meta-docs-url', rule, {
123128 pattern : 'path/to/{{name}}.md' ,
124129 } ,
125130 ] ,
131+ name : "url in variable (pattern: 'path/to/{{name}}.md')" ,
126132 } ,
127133 {
128134 // Can't determine `url` value statically.
@@ -138,6 +144,7 @@ tester.run('require-meta-docs-url', rule, {
138144 pattern : 'path/to/{{name}}.md' ,
139145 } ,
140146 ] ,
147+ name : "undefined variable reference (pattern: 'path/to/{{name}}.md')" ,
141148 } ,
142149 {
143150 // Can't determine `url` value statically.
@@ -153,6 +160,7 @@ tester.run('require-meta-docs-url', rule, {
153160 pattern : 'path/to/{{name}}.md' ,
154161 } ,
155162 ] ,
163+ name : "undefined function (pattern: 'path/to/{{name}}.md')" ,
156164 } ,
157165 {
158166 // Spread.
@@ -166,6 +174,7 @@ tester.run('require-meta-docs-url', rule, {
166174 }
167175 ` ,
168176 options : [ { pattern : 'path/to/{{name}}.md' } ] ,
177+ name : "spread (pattern: 'path/to/{{name}}.md')" ,
169178 } ,
170179 ] ,
171180
@@ -372,6 +381,7 @@ tester.run('require-meta-docs-url', rule, {
372381 } ,
373382 ] ,
374383 errors : [ { messageId : 'missing' , type : 'FunctionExpression' } ] ,
384+ name : "missing meta (pattern: 'plugin-name/{{ name }}.md')" ,
375385 } ,
376386 {
377387 code : `
@@ -387,6 +397,7 @@ tester.run('require-meta-docs-url', rule, {
387397 } ,
388398 ] ,
389399 errors : [ { messageId : 'missing' , type : 'Identifier' } ] ,
400+ name : "meta as variable (pattern: 'plugin-name/{{ name }}.md')" ,
390401 } ,
391402 {
392403 code : `
@@ -402,6 +413,7 @@ tester.run('require-meta-docs-url', rule, {
402413 } ,
403414 ] ,
404415 errors : [ { messageId : 'missing' , type : 'Literal' } ] ,
416+ name : "meta set to number (pattern: 'plugin-name/{{ name }}.md')" ,
405417 } ,
406418 {
407419 code : `
@@ -417,6 +429,7 @@ tester.run('require-meta-docs-url', rule, {
417429 } ,
418430 ] ,
419431 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
432+ name : "empty meta (pattern: 'plugin-name/{{ name }}.md')" ,
420433 } ,
421434 {
422435 code : `
@@ -434,6 +447,7 @@ tester.run('require-meta-docs-url', rule, {
434447 } ,
435448 ] ,
436449 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
450+ name : "missing docs with other prop having no trailing comma (pattern: 'plugin-name/{{ name }}.md')" ,
437451 } ,
438452 {
439453 code : `
@@ -451,6 +465,7 @@ tester.run('require-meta-docs-url', rule, {
451465 } ,
452466 ] ,
453467 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
468+ name : "missing docs (pattern: 'plugin-name/{{ name }}.md')" ,
454469 } ,
455470 {
456471 code : `
@@ -468,6 +483,7 @@ tester.run('require-meta-docs-url', rule, {
468483 } ,
469484 ] ,
470485 errors : [ { messageId : 'missing' , type : 'Identifier' } ] ,
486+ name : "docs as variable (pattern: 'plugin-name/{{ name }}.md')" ,
471487 } ,
472488 {
473489 code : `
@@ -485,6 +501,7 @@ tester.run('require-meta-docs-url', rule, {
485501 } ,
486502 ] ,
487503 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
504+ name : "docs as empty object (pattern: 'plugin-name/{{ name }}.md')" ,
488505 } ,
489506 {
490507 code : `
@@ -504,6 +521,7 @@ tester.run('require-meta-docs-url', rule, {
504521 } ,
505522 ] ,
506523 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
524+ name : "missing url with other prop as string (pattern: 'plugin-name/{{ name }}.md')" ,
507525 } ,
508526 {
509527 code : `
@@ -523,6 +541,7 @@ tester.run('require-meta-docs-url', rule, {
523541 } ,
524542 ] ,
525543 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
544+ name : "missing url with other prop as string with trailing comma (pattern: 'plugin-name/{{ name }}.md')" ,
526545 } ,
527546 {
528547 code : `
@@ -542,6 +561,7 @@ tester.run('require-meta-docs-url', rule, {
542561 } ,
543562 ] ,
544563 errors : [ { messageId : 'wrongType' , type : 'Literal' } ] ,
564+ name : "url as number (pattern: 'plugin-name/{{ name }}.md')" ,
545565 } ,
546566 {
547567 code : `
@@ -561,6 +581,7 @@ tester.run('require-meta-docs-url', rule, {
561581 } ,
562582 ] ,
563583 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
584+ name : "spread url variable (pattern: 'plugin-name/{{ name }}.md')" ,
564585 } ,
565586
566587 // -------------------------------------------------------------------------
@@ -578,6 +599,7 @@ tester.run('require-meta-docs-url', rule, {
578599 } ,
579600 ] ,
580601 errors : [ { messageId : 'missing' , type : 'FunctionExpression' } ] ,
602+ name : "missing meta with filename (pattern: 'plugin-name/{{ name }}.md')" ,
581603 } ,
582604 {
583605 filename : 'test.js' ,
@@ -594,6 +616,7 @@ tester.run('require-meta-docs-url', rule, {
594616 } ,
595617 ] ,
596618 errors : [ { messageId : 'missing' , type : 'Identifier' } ] ,
619+ name : "meta as variable with filename (pattern: 'plugin-name/{{ name }}.md')" ,
597620 } ,
598621 {
599622 filename : 'test.js' ,
@@ -610,6 +633,7 @@ tester.run('require-meta-docs-url', rule, {
610633 } ,
611634 ] ,
612635 errors : [ { messageId : 'missing' , type : 'Literal' } ] ,
636+ name : "meta set to number with filename (pattern: 'plugin-name/{{ name }}.md')" ,
613637 } ,
614638 {
615639 filename : 'test.js' ,
@@ -635,6 +659,7 @@ url: "plugin-name/test.md"
635659 } ,
636660 ] ,
637661 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
662+ name : "empty meta with filename (pattern: 'plugin-name/{{ name }}.md')" ,
638663 } ,
639664 {
640665 // URL missing, spreads present.
@@ -658,6 +683,7 @@ url: "plugin-name/test.md" } };
658683 ` ,
659684 options : [ { pattern : 'plugin-name/{{ name }}.md' } ] ,
660685 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
686+ name : "missing url inside spreads (pattern: 'plugin-name/{{ name }}.md')" ,
661687 } ,
662688 {
663689 // URL wrong inside spreads.
@@ -680,6 +706,7 @@ url: "plugin-name/test.md" } };
680706 ` ,
681707 options : [ { pattern : 'plugin-name/{{ name }}.md' } ] ,
682708 errors : [ { messageId : 'mismatch' , type : 'Literal' } ] ,
709+ name : "url wrong inside spreads (pattern: 'plugin-name/{{ name }}.md')" ,
683710 } ,
684711 {
685712 // CJS file extension
@@ -706,6 +733,7 @@ url: "plugin-name/test.md"
706733 } ,
707734 ] ,
708735 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
736+ name : "empty meta with filename and cjs extension (pattern: 'plugin-name/{{ name }}.md')" ,
709737 } ,
710738 {
711739 // ESM
@@ -733,6 +761,7 @@ url: "plugin-name/test.md"
733761 ] ,
734762 languageOptions : { sourceType : 'module' } ,
735763 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
764+ name : "empty meta with filename and esm (pattern: 'plugin-name/{{ name }}.md')" ,
736765 } ,
737766 {
738767 // TypeScript
@@ -756,6 +785,7 @@ url: "plugin-name/test.md"
756785 options : [ { pattern : 'plugin-name/{{ name }}.md' } ] ,
757786 languageOptions : { sourceType : 'module' } ,
758787 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
788+ name : "empty meta with filename and TypeScript (pattern: 'plugin-name/{{ name }}.md')" ,
759789 } ,
760790 {
761791 filename : 'test.js' ,
@@ -784,6 +814,7 @@ url: "plugin-name/test.md"
784814 } ,
785815 ] ,
786816 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
817+ name : "missing docs with other prop having no trailing comma > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
787818 } ,
788819 {
789820 filename : 'test.js' ,
@@ -812,6 +843,7 @@ url: "plugin-name/test.md"
812843 } ,
813844 ] ,
814845 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
846+ name : "missing docs > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
815847 } ,
816848 {
817849 filename : 'test.js' ,
@@ -830,6 +862,7 @@ url: "plugin-name/test.md"
830862 } ,
831863 ] ,
832864 errors : [ { messageId : 'missing' , type : 'Identifier' } ] ,
865+ name : "docs as variable > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
833866 } ,
834867 {
835868 filename : 'test.js' ,
@@ -857,6 +890,7 @@ url: "plugin-name/test.md"
857890 } ,
858891 ] ,
859892 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
893+ name : "docs as empty object > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
860894 } ,
861895 {
862896 filename : 'test.js' ,
@@ -887,6 +921,7 @@ url: "plugin-name/test.md"
887921 } ,
888922 ] ,
889923 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
924+ name : "missing url with other prop as string > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
890925 } ,
891926 {
892927 filename : 'test.js' ,
@@ -917,6 +952,7 @@ url: "plugin-name/test.md",
917952 } ,
918953 ] ,
919954 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
955+ name : "missing url with other prop as string with trailing comma > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
920956 } ,
921957 {
922958 filename : 'test.js' ,
@@ -951,6 +987,7 @@ url: "plugin-name/test.md",
951987 type : 'Literal' ,
952988 } ,
953989 ] ,
990+ name : "url as number > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
954991 } ,
955992 {
956993 // `url` in variable, can't autofix it.
@@ -976,6 +1013,7 @@ url: "plugin-name/test.md",
9761013 type : 'Identifier' ,
9771014 } ,
9781015 ] ,
1016+ name : "url in variable > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
9791017 } ,
9801018 {
9811019 // `url` is `null`.
@@ -1007,6 +1045,7 @@ url: "plugin-name/test.md",
10071045 type : 'Literal' ,
10081046 } ,
10091047 ] ,
1048+ name : "url is null > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
10101049 } ,
10111050 {
10121051 // `url` is `undefined`.
@@ -1038,6 +1077,7 @@ url: "plugin-name/test.md",
10381077 type : 'Identifier' ,
10391078 } ,
10401079 ] ,
1080+ name : "url is undefined > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
10411081 } ,
10421082 {
10431083 filename : 'test.js' ,
@@ -1068,6 +1108,7 @@ url: "plugin-name/test.md"
10681108 } ,
10691109 ] ,
10701110 errors : [ { messageId : 'missing' , type : 'ObjectExpression' } ] ,
1111+ name : "spread url variable > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
10711112 } ,
10721113 {
10731114 // Function rule in variable.
@@ -1081,6 +1122,7 @@ url: "plugin-name/test.md"
10811122 type : 'FunctionExpression' ,
10821123 } ,
10831124 ] ,
1125+ name : "function rule in variable > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
10841126 } ,
10851127 {
10861128 // Object rule in variable.
@@ -1098,6 +1140,7 @@ url: "plugin-name/test.md"
10981140 type : 'ObjectExpression' ,
10991141 } ,
11001142 ] ,
1143+ name : "object rule in variable > with filename (pattern: 'plugin-name/{{ name }}.md')" ,
11011144 } ,
11021145 ] ,
11031146} ) ;
0 commit comments