Skip to content

Commit

Permalink
fix: false positive in array of object value (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
makotot authored Sep 25, 2024
1 parent 2214da3 commit fb2c97e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions plugin/src/rules/no-dynamic-styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ const rule: Rule = createRule({

// Don't warn for objects. Those are conditions
if (isObjectExpression(node.value)) return
if (isArrayExpression(node.value)) {
return checkElements(node.value, context)
}

if (!isPandaAttribute(node, context)) return

Expand Down
6 changes: 6 additions & 0 deletions plugin/tests/no-dynamic-styling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ function App(){
return <styled.div color='red.100' />;
}`,
},
{
code: javascript`
const foo = 'foo'
const nonStyles = {bar: [foo]}
`,
},
]

const invalids = [
Expand Down

0 comments on commit fb2c97e

Please sign in to comment.