Skip to content

Commit

Permalink
chore: ignore non panda files in no-dynamic-styling (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 authored Sep 24, 2024
1 parent b74af36 commit b004285
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-lemons-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pandacss/eslint-plugin': patch
---

Ignore non panda files
5 changes: 5 additions & 0 deletions .changeset/tender-chefs-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pandacss/eslint-plugin': patch
---

Fix array syntax in `no-dynamic-styling`
7 changes: 7 additions & 0 deletions plugin/src/rules/no-dynamic-styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const rule: Rule = createRule({
}

if (!isPandaProp(node, context)) return
if (isArrayExpression(node.value.expression)) {
return checkElements(node.value.expression, context)
}

context.report({
node: node.value,
Expand Down Expand Up @@ -82,6 +85,10 @@ const rule: Rule = createRule({

if (!isPandaAttribute(node, context)) return

if (isArrayExpression(node.value)) {
return checkElements(node.value, context)
}

context.report({
node: node.value,
messageId: 'dynamic',
Expand Down

0 comments on commit b004285

Please sign in to comment.