Skip to content

Commit b908186

Browse files
authored
Merge pull request #262 from sstur/fixErrorStyleProp
fix: rule/no-single-element-style-arrays - exception when style prop is not an expression
2 parents c3781a3 + e259def commit b908186

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/rules/no-single-element-style-arrays.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = {
3737
return {
3838
JSXAttribute(node) {
3939
if (node.name.name !== 'style') return;
40+
if (!node.value.expression) return;
4041
if (node.value.expression.type !== 'ArrayExpression') return;
4142
if (node.value.expression.elements.length === 1) {
4243
reportNode(node);

0 commit comments

Comments
 (0)