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; } | {