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> {
193193 continue ;
194194 }
195195 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 ) ;
197199 if ( baseFileName . endsWith ( 'input' ) || baseFileName . startsWith ( '+' ) ) {
198200 yield abs ;
199201 } else if ( fs . statSync ( abs ) . isDirectory ( ) ) {
@@ -350,7 +352,7 @@ function getConfig(ruleName: string, inputFile: string) {
350352}
351353
352354function 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' ) ;
354356 if ( ! fs . existsSync ( requirementsFile ) ) {
355357 requirementsFile = path . join ( path . dirname ( inputFile ) , '_requirements.json' ) ;
356358 }
You can’t perform that action at this time.
0 commit comments