File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/eslint-plugin-svelte/tests/utils Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,9 @@ function* itrListupInput(rootDir: string): IterableIterator<string> {
193
193
continue ;
194
194
}
195
195
const abs = path . join ( rootDir , filename ) ;
196
- const baseFileName = path . basename ( filename , path . extname ( filename ) ) ;
196
+ const baseName = path . basename ( filename ) ;
197
+ const fileNameSuffix = baseName . match ( / \. s v e l t e \. (?: j | t ) s $ / u) ? baseName . slice ( baseName . length - 10 ) : path . extname ( filename ) ;
198
+ const baseFileName = baseName . slice ( 0 , baseName . length - fileNameSuffix . length ) ;
197
199
if ( baseFileName . endsWith ( 'input' ) || baseFileName . startsWith ( '+' ) ) {
198
200
yield abs ;
199
201
} else if ( fs . statSync ( abs ) . isDirectory ( ) ) {
@@ -350,7 +352,7 @@ function getConfig(ruleName: string, inputFile: string) {
350
352
}
351
353
352
354
function getRequirements ( inputFile : string ) : Record < string , string > {
353
- let requirementsFile : string = inputFile . replace ( / ( i n p u t | \+ .+ ) \. [ a - z ] + $ / u, 'requirements.json' ) ;
355
+ let requirementsFile : string = inputFile . replace ( / ( i n p u t | \+ .+ ) (?: \. [ a - z ] + ) + $ / u, 'requirements.json' ) ;
354
356
if ( ! fs . existsSync ( requirementsFile ) ) {
355
357
requirementsFile = path . join ( path . dirname ( inputFile ) , '_requirements.json' ) ;
356
358
}
You can’t perform that action at this time.
0 commit comments