We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d42120a commit 8b13c92Copy full SHA for 8b13c92
src/parser/index.ts
@@ -189,7 +189,7 @@ export function parseForESLint(
189
const styleElement = ast.body.find(
190
(b): b is SvelteStyleElement => b.type === "SvelteStyleElement"
191
);
192
- const styleContext = parseStyleContext(styleElement, ctx);
+ let styleContext: StyleContext | null = null;
193
194
resultScript.ast = ast as any;
195
resultScript.services = Object.assign(resultScript.services || {}, {
@@ -198,6 +198,9 @@ export function parseForESLint(
198
return resultTemplate.svelteAst.html;
199
},
200
getStyleContext() {
201
+ if (styleContext === null) {
202
+ styleContext = parseStyleContext(styleElement, ctx);
203
+ }
204
return styleContext;
205
206
styleNodeLoc,
0 commit comments