Skip to content

Commit 83a4ff3

Browse files
committed
try to fix
1 parent 98d23f5 commit 83a4ff3

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/parser/index.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ export function parseForESLint(code: string, options?: any): ParseResult {
125125
) {
126126
const trimmed = code.trim();
127127
if (!trimmed.startsWith("<") && !trimmed.endsWith(">")) {
128-
const svelteParseContext = resolveSvelteParseContextForSvelteScript(
129-
svelteConfig,
130-
parserOptions,
131-
);
128+
const svelteParseContext =
129+
resolveSvelteParseContextForSvelteScript(svelteConfig);
132130
return parseAsScript(code, parserOptions, svelteParseContext);
133131
}
134132
}
@@ -152,7 +150,6 @@ function parseAsSvelte(
152150
);
153151
const svelteParseContext = resolveSvelteParseContextForSvelte(
154152
svelteConfig,
155-
parserOptions,
156153
resultTemplate.svelteAst,
157154
);
158155

src/parser/svelte-parse-context.ts

+3-11
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function isEnableRunes(
3434

3535
export function resolveSvelteParseContextForSvelte(
3636
svelteConfig: SvelteConfig | null,
37-
parserOptions: NormalizedParserOptions,
3837
svelteAst: Compiler.Root | SvAST.AstLegacy,
3938
): SvelteParseContext {
4039
const svelteOptions = (svelteAst as Compiler.Root).options;
@@ -47,25 +46,18 @@ export function resolveSvelteParseContextForSvelte(
4746
}
4847

4948
return {
50-
runes: isEnableRunes(svelteConfig, parserOptions),
49+
runes: false,
5150
compilerVersion,
5251
svelteConfig,
5352
};
5453
}
5554

5655
export function resolveSvelteParseContextForSvelteScript(
5756
svelteConfig: SvelteConfig | null,
58-
parserOptions: NormalizedParserOptions,
59-
): SvelteParseContext {
60-
return resolveSvelteParseContext(svelteConfig, parserOptions);
61-
}
62-
63-
function resolveSvelteParseContext(
64-
svelteConfig: SvelteConfig | null,
65-
parserOptions: NormalizedParserOptions,
6657
): SvelteParseContext {
6758
return {
68-
runes: isEnableRunes(svelteConfig, parserOptions),
59+
// .svelte.js files are always in Runes mode.
60+
runes: true,
6961
compilerVersion,
7062
svelteConfig,
7163
};

0 commit comments

Comments
 (0)