eslint-plugin-styled-component-jsx-attributes
Version:
A simple plugin for enforcing the use of the id attribute on styled components.
13 lines (10 loc) • 524 B
JavaScript
module.exports = function (attributes) {
return attributes.map(function (attribute) {
var _attribute$value, _attribute$value$expr;
if (((_attribute$value = attribute.value) === null || _attribute$value === void 0 ? void 0 : (_attribute$value$expr = _attribute$value.expression) === null || _attribute$value$expr === void 0 ? void 0 : _attribute$value$expr.type) === 'ChainExpression') {
attribute.value.expression = attribute.value.expression.expression;
}
return attribute;
});
};
;