Changeset 0c6b92a for imaps-frontend/node_modules/eslint-plugin-react/lib/rules/style-prop-object.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/style-prop-object.js
rd565449 r0c6b92a 19 19 }; 20 20 21 /** @type {import('eslint').Rule.RuleModule} */ 21 22 module.exports = { 22 23 meta: { … … 81 82 && node.arguments.length > 1 82 83 ) { 83 if ( node.arguments[0].name) {84 if ('name' in node.arguments[0] && node.arguments[0].name) { 84 85 // store name of component 85 86 const componentName = node.arguments[0].name; … … 92 93 } 93 94 if (node.arguments[1].type === 'ObjectExpression') { 94 const style = node.arguments[1].properties.find((property) => property.key && property.key.name === 'style' && !property.computed); 95 if (style) { 95 const style = node.arguments[1].properties.find((property) => ( 96 'key' in property 97 && property.key 98 && 'name' in property.key 99 && property.key.name === 'style' 100 && !property.computed 101 )); 102 103 if (style && 'value' in style) { 96 104 if (style.value.type === 'Identifier') { 97 105 checkIdentifiers(style.value);
Note:
See TracChangeset
for help on using the changeset viewer.