File tree 1 file changed +4
-7
lines changed
packages/eslint-plugin-svelte/src/utils
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const isRunInBrowser = !fs.readFileSync;
8
8
9
9
export type SvelteContext = {
10
10
svelteVersion : '3/4' | '5' ;
11
- svelteFileType : '.svelte' | '.svelte.[js|ts]' ;
11
+ svelteFileType : '.svelte' | '.svelte.[js|ts]' | null ;
12
12
runes : boolean ;
13
13
svelteKitVersion : '1-next' | '1' | '2' | null ;
14
14
svelteKitFileType :
@@ -23,7 +23,7 @@ export type SvelteContext = {
23
23
| null ;
24
24
} ;
25
25
26
- function getFileType ( filePath : string ) : SvelteContext [ 'svelteFileType' ] | null {
26
+ function getSvelteFileType ( filePath : string ) : SvelteContext [ 'svelteFileType' ] | null {
27
27
if ( filePath . endsWith ( '.svelte' ) ) {
28
28
return '.svelte' ;
29
29
}
@@ -186,15 +186,12 @@ export function getSvelteContext(context: RuleContext): SvelteContext | null {
186
186
const svelteKitContext = getSvelteKitContext ( context ) ;
187
187
188
188
const runes = svelteParseContext . runes === true ;
189
- const fileType = getFileType ( filePath ) ;
190
- if ( fileType === null ) {
191
- return null ;
192
- }
189
+ const svelteFileType = getSvelteFileType ( filePath ) ;
193
190
194
191
return {
195
192
svelteVersion : getSvelteVersion ( compilerVersion ) ,
196
193
runes,
197
- svelteFileType : fileType ,
194
+ svelteFileType,
198
195
svelteKitVersion : svelteKitContext . svelteKitVersion ,
199
196
svelteKitFileType : svelteKitContext . svelteKitFileType
200
197
} ;
You can’t perform that action at this time.
0 commit comments