Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfranco committed Apr 6, 2024
1 parent 4c6a574 commit a29fb3a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const rule: Rule.RuleModule = {
JSXIdentifier(node) {
const openingElement = node.parent as JSXOpeningElement;
if (openingElement.type === "JSXOpeningElement") {
const attributes: (JSXAttribute | JSXSpreadAttribute)[] = [];

openingElement.attributes.forEach((attr: JSXAttribute | JSXSpreadAttribute) => {
if (attr.type === "JSXAttribute" && attr.name?.type === "JSXIdentifier") {
attributes.push(attr);
}
});
const attributes = openingElement.attributes
.map((attr) => {
if (attr.type === "JSXAttribute" && attr.name?.type === "JSXIdentifier") {
return attr;
}
})
.filter(Boolean);

const refAttribute = attributes.find(
(attr: JSXAttribute | JSXSpreadAttribute) =>
Expand Down

0 comments on commit a29fb3a

Please sign in to comment.