File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 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(
189189 const styleElement = ast . body . find (
190190 ( b ) : b is SvelteStyleElement => b . type === "SvelteStyleElement"
191191 ) ;
192- const styleContext = parseStyleContext ( styleElement , ctx ) ;
192+ let styleContext : StyleContext | null = null ;
193193
194194 resultScript . ast = ast as any ;
195195 resultScript . services = Object . assign ( resultScript . services || { } , {
@@ -198,6 +198,9 @@ export function parseForESLint(
198198 return resultTemplate . svelteAst . html ;
199199 } ,
200200 getStyleContext ( ) {
201+ if ( styleContext === null ) {
202+ styleContext = parseStyleContext ( styleElement , ctx ) ;
203+ }
201204 return styleContext ;
202205 } ,
203206 styleNodeLoc,
You can’t perform that action at this time.
0 commit comments