Skip to content

Commit 7e7abe8

Browse files
committed
fix(parser): fixed missing types on parser services
1 parent 342ae8c commit 7e7abe8

File tree

1 file changed

+7
-0
lines changed
  • packages/eslint-plugin-svelte/src

1 file changed

+7
-0
lines changed

packages/eslint-plugin-svelte/src/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import type { Linter, Rule, SourceCode as ESLintSourceCode } from 'eslint';
33
import type { AST, StyleContext, SvelteConfig } from 'svelte-eslint-parser';
44
import type { TSESTree } from '@typescript-eslint/types';
55
import type { ScopeManager, Scope, Variable } from '@typescript-eslint/scope-manager';
6+
import type { Rule as StyleRule, Node } from 'postcss';
7+
import type { Root as SelectorRoot, Node as SelectorNode } from 'postcss-selector-parser';
68
import type { ASTNode, ASTNodeWithParent, ASTNodeListener } from './types-for-node.js';
79
import type * as TS from 'typescript';
10+
import type { SourceLocation } from 'svelte-eslint-parser/lib/ast/common.js';
811

912
export type { ASTNode, ASTNodeWithParent, ASTNodeListener };
1013
export interface RuleListener extends ASTNodeListener {
@@ -207,6 +210,10 @@ export interface SourceCode {
207210
isSvelteScript?: boolean;
208211
getSvelteHtmlAst?: () => unknown;
209212
getStyleContext?: () => StyleContext;
213+
getStyleSelectorAST: (rule: StyleRule) => SelectorRoot;
214+
styleNodeLoc: (node: Node) => Partial<SourceLocation>;
215+
styleNodeRange: (node: Node) => [number | undefined, number | undefined];
216+
styleSelectorNodeLoc: (node: SelectorNode) => Partial<SourceLocation>;
210217
svelteParseContext?: {
211218
/**
212219
* Whether to use Runes mode.

0 commit comments

Comments
 (0)