Skip to content

Commit fb2c97e

Browse files
authored
fix: false positive in array of object value (#151)
1 parent 2214da3 commit fb2c97e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

plugin/src/rules/no-dynamic-styling.ts

-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ const rule: Rule = createRule({
7979

8080
// Don't warn for objects. Those are conditions
8181
if (isObjectExpression(node.value)) return
82-
if (isArrayExpression(node.value)) {
83-
return checkElements(node.value, context)
84-
}
8582

8683
if (!isPandaAttribute(node, context)) return
8784

plugin/tests/no-dynamic-styling.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ function App(){
3535
return <styled.div color='red.100' />;
3636
}`,
3737
},
38+
{
39+
code: javascript`
40+
const foo = 'foo'
41+
const nonStyles = {bar: [foo]}
42+
`,
43+
},
3844
]
3945

4046
const invalids = [

0 commit comments

Comments
 (0)