Skip to content

Commit 9819fe9

Browse files
authored
chore: make properties in parserServices optional (#1000)
1 parent 99e67b3 commit 9819fe9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/eslint-plugin-svelte/src/rules/no-unused-class-name.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function findClassesInPostCSSNode(
111111
): string[] {
112112
if (node.type === 'rule') {
113113
let classes = node.nodes.flatMap((node) => findClassesInPostCSSNode(node, parserServices));
114-
classes = classes.concat(findClassesInSelector(parserServices.getStyleSelectorAST(node)));
114+
classes = classes.concat(findClassesInSelector(parserServices.getStyleSelectorAST!(node)));
115115
return classes;
116116
}
117117
if ((node.type === 'root' || node.type === 'atrule') && node.nodes !== undefined) {

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ export interface SourceCode {
210210
isSvelteScript?: boolean;
211211
getSvelteHtmlAst?: () => unknown;
212212
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>;
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>;
217217
svelteParseContext?: {
218218
/**
219219
* Whether to use Runes mode.

0 commit comments

Comments
 (0)