Skip to content

Commit 1780f7c

Browse files
committed
Fix other style attribute checks
1 parent 1c8eaa8 commit 1780f7c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

eslint-plugin/lib/rules/avoid-css-animations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
(attribute) => attribute.name?.name === "style",
4141
);
4242

43-
if (styleAttribute?.value.expression) {
43+
if (styleAttribute?.value.expression?.properties) {
4444
// To prevent (for example) <div style={{ animate: 'width 2s' }}>
4545
const property = styleAttribute.value.expression.properties.find(
4646
(prop) =>

eslint-plugin/lib/rules/prefer-shorthand-css-notations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = {
8686
const styleAttribute = node.attributes.find(
8787
(attr) => attr.name?.name === "style",
8888
);
89-
if (styleAttribute) {
89+
if (styleAttribute?.value.expression?.properties) {
9090
const nodePropertyNames =
9191
styleAttribute.value.expression.properties.map(
9292
(property) => property.key.name,

0 commit comments

Comments
 (0)