File tree 3 files changed +27
-0
lines changed 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,15 @@ export function packageNameFromPath(path) {
263
263
return / ^ vd+ (. d+ )? $ / .exec (base) || / ^ tsd. d/ .exec (base) ? basename (dirname (path)) : base;
264
264
}
265
265
// Message: This description only repeats the name it describes.
266
+
267
+ /**
268
+ * package name from path
269
+ */
270
+ export default function packageNameFromPath (path ) {
271
+ const base = basename (path);
272
+ return / ^ vd+ (. d+ )? $ / .exec (base) || / ^ tsd. d/ .exec (base) ? basename (dirname (path)) : base;
273
+ }
274
+ // Message: This description only repeats the name it describes.
266
275
````
267
276
268
277
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const getNamesFromNode = (node) => {
39
39
) ,
40
40
] ;
41
41
42
+ case 'ExportDefaultDeclaration' :
42
43
case 'ExportNamedDeclaration' :
43
44
return getNamesFromNode (
44
45
/** @type {import('@typescript-eslint/types').TSESTree.ExportNamedDeclaration } */
Original file line number Diff line number Diff line change @@ -517,6 +517,23 @@ export default {
517
517
message : 'This description only repeats the name it describes.' ,
518
518
} ,
519
519
] ,
520
+ } ,
521
+ {
522
+ code : `
523
+ /**
524
+ * package name from path
525
+ */
526
+ export default function packageNameFromPath(path) {
527
+ const base = basename(path);
528
+ return /^v\d+(\.\d+)?$/.exec(base) || /^ts\d\.\d/.exec(base) ? basename(dirname(path)) : base;
529
+ }
530
+ ` ,
531
+ errors : [
532
+ {
533
+ line : 2 ,
534
+ message : 'This description only repeats the name it describes.' ,
535
+ } ,
536
+ ] ,
520
537
}
521
538
] ,
522
539
valid : [
You can’t perform that action at this time.
0 commit comments