File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " svelte-eslint-parser " : minor
3
+ ---
4
+
5
+ only parsing styles on-demand
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ export function parseForESLint(
189
189
const styleElement = ast . body . find (
190
190
( b ) : b is SvelteStyleElement => b . type === "SvelteStyleElement"
191
191
) ;
192
- const styleContext = parseStyleContext ( styleElement , ctx ) ;
192
+ let styleContext : StyleContext | null = null ;
193
193
194
194
resultScript . ast = ast as any ;
195
195
resultScript . services = Object . assign ( resultScript . services || { } , {
@@ -198,6 +198,9 @@ export function parseForESLint(
198
198
return resultTemplate . svelteAst . html ;
199
199
} ,
200
200
getStyleContext ( ) {
201
+ if ( styleContext === null ) {
202
+ styleContext = parseStyleContext ( styleElement , ctx ) ;
203
+ }
201
204
return styleContext ;
202
205
} ,
203
206
styleNodeLoc,
You can’t perform that action at this time.
0 commit comments