From ee0c676b83aec9db6e824f765ce4e9328db43091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 14 Dec 2024 13:59:55 +0100 Subject: [PATCH] fix(styles): fixed missing types on parser services --- src/parser/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/parser/index.ts b/src/parser/index.ts index 084b9002..f7ad5aa8 100644 --- a/src/parser/index.ts +++ b/src/parser/index.ts @@ -2,6 +2,7 @@ import { KEYS } from "../visitor-keys.js"; import { Context } from "../context/index.js"; import type { Comment, + SourceLocation, SvelteProgram, SvelteScriptElement, SvelteStyleElement, @@ -10,8 +11,11 @@ import type { import type { Program } from "estree"; import type { ScopeManager } from "eslint-scope"; import { Variable } from "eslint-scope"; -import type { Rule } from "postcss"; -import type { Root as SelectorRoot } from "postcss-selector-parser"; +import type { Rule, Node } from "postcss"; +import type { + Node as SelectorNode, + Root as SelectorRoot, +} from "postcss-selector-parser"; import { parseScript, parseScriptInSvelte } from "./script.js"; import type * as SvAST from "./svelte-ast-types.js"; import type * as Compiler from "./svelte-ast-types-for-v5.js"; @@ -89,6 +93,11 @@ type ParseResult = { getSvelteHtmlAst: () => SvAST.Fragment | Compiler.Fragment; getStyleContext: () => StyleContext; getStyleSelectorAST: (rule: Rule) => SelectorRoot; + styleNodeLoc: (node: Node) => Partial; + styleNodeRange: ( + node: Node, + ) => [number | undefined, number | undefined]; + styleSelectorNodeLoc: (node: SelectorNode) => Partial; svelteParseContext: SvelteParseContext; } | {