From 8b13c9276500f8d63c899caa1bd7a293bfdb3cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Mon, 19 Jun 2023 13:54:01 +0200 Subject: [PATCH 1/2] Only parsing styles on-demand --- src/parser/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser/index.ts b/src/parser/index.ts index 49346cf1..351deed6 100644 --- a/src/parser/index.ts +++ b/src/parser/index.ts @@ -189,7 +189,7 @@ export function parseForESLint( const styleElement = ast.body.find( (b): b is SvelteStyleElement => b.type === "SvelteStyleElement" ); - const styleContext = parseStyleContext(styleElement, ctx); + let styleContext: StyleContext | null = null; resultScript.ast = ast as any; resultScript.services = Object.assign(resultScript.services || {}, { @@ -198,6 +198,9 @@ export function parseForESLint( return resultTemplate.svelteAst.html; }, getStyleContext() { + if (styleContext === null) { + styleContext = parseStyleContext(styleElement, ctx); + } return styleContext; }, styleNodeLoc, From 7c527ebdde8b3fef0f903d071d3818f84a756fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Mon, 19 Jun 2023 14:01:25 +0200 Subject: [PATCH 2/2] Added a changeset for on-demand style parsing --- .changeset/yellow-cats-impress.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/yellow-cats-impress.md diff --git a/.changeset/yellow-cats-impress.md b/.changeset/yellow-cats-impress.md new file mode 100644 index 00000000..13ea3232 --- /dev/null +++ b/.changeset/yellow-cats-impress.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": minor +--- + +only parsing styles on-demand pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy