@@ -2,7 +2,7 @@ import type * as Compiler from "svelte/compiler";
2
2
import type * as SvAST from "./svelte-ast-types" ;
3
3
import type { NormalizedParserOptions } from "./parser-options" ;
4
4
import { compilerVersion , svelteVersion } from "./svelte-version" ;
5
- import type { StaticSvelteConfig } from "../svelte-config" ;
5
+ import type { StaticSvelteConfigFile } from "../svelte-config" ;
6
6
7
7
/** The context for parsing. */
8
8
export type SvelteParseContext = {
@@ -15,24 +15,24 @@ export type SvelteParseContext = {
15
15
/** The version of "svelte/compiler". */
16
16
compilerVersion : string ;
17
17
/** The result of static analysis of `svelte.config.js`. */
18
- svelteConfig : StaticSvelteConfig | null ;
18
+ svelteConfig : StaticSvelteConfigFile | null ;
19
19
} ;
20
20
21
21
export function isEnableRunes (
22
- svelteConfig : StaticSvelteConfig | null ,
22
+ svelteConfig : StaticSvelteConfigFile | null ,
23
23
parserOptions : NormalizedParserOptions ,
24
24
) : boolean {
25
25
if ( ! svelteVersion . gte ( 5 ) ) return false ;
26
26
if ( parserOptions . svelteFeatures ?. runes != null ) {
27
27
return Boolean ( parserOptions . svelteFeatures . runes ) ;
28
- } else if ( svelteConfig ?. compilerOptions ?. runes != null ) {
29
- return Boolean ( svelteConfig . compilerOptions . runes ) ;
28
+ } else if ( svelteConfig ?. config . compilerOptions ?. runes != null ) {
29
+ return Boolean ( svelteConfig . config . compilerOptions . runes ) ;
30
30
}
31
31
return false ;
32
32
}
33
33
34
34
export function resolveSvelteParseContextForSvelte (
35
- svelteConfig : StaticSvelteConfig | null ,
35
+ svelteConfig : StaticSvelteConfigFile | null ,
36
36
parserOptions : NormalizedParserOptions ,
37
37
svelteAst : Compiler . Root | SvAST . AstLegacy ,
38
38
) : SvelteParseContext {
@@ -53,14 +53,14 @@ export function resolveSvelteParseContextForSvelte(
53
53
}
54
54
55
55
export function resolveSvelteParseContextForSvelteScript (
56
- svelteConfig : StaticSvelteConfig | null ,
56
+ svelteConfig : StaticSvelteConfigFile | null ,
57
57
parserOptions : NormalizedParserOptions ,
58
58
) : SvelteParseContext {
59
59
return resolveSvelteParseContext ( svelteConfig , parserOptions ) ;
60
60
}
61
61
62
62
function resolveSvelteParseContext (
63
- svelteConfig : StaticSvelteConfig | null ,
63
+ svelteConfig : StaticSvelteConfigFile | null ,
64
64
parserOptions : NormalizedParserOptions ,
65
65
) : SvelteParseContext {
66
66
return {
0 commit comments