Skip to content

Commit 0212a78

Browse files
authored
fix(no-ununsed-class-name): fixed an error with @use at-rules (#527)
1 parent 053ec69 commit 0212a78

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/smart-gifts-shake.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-svelte": patch
3+
---
4+
5+
fix(no-ununsed-class-name): fixed an error with @use at-rules

src/rules/no-unused-class-name.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ function findClassesInPostCSSNode(node: AnyNode): string[] {
116116
)
117117
return classes
118118
}
119-
if (node.type === "root" || node.type === "atrule") {
119+
if (
120+
(node.type === "root" || node.type === "atrule") &&
121+
node.nodes !== undefined
122+
) {
120123
return node.nodes.flatMap(findClassesInPostCSSNode)
121124
}
122125
return []

0 commit comments

Comments
 (0)