[ci] format

This commit is contained in:
matthewp 2022-08-23 12:50:09 +00:00 committed by fredkbot
parent f40065f510
commit bc5cb85232

View file

@ -58,31 +58,27 @@ export default function tagExportsWithRenderer({
const addTag = (id: string) => {
const tags = state.get('astro:tags') ?? [];
state.set('astro:tags', [...tags, id]);
}
};
if (node.type === 'ExportNamedDeclaration' || node.type === 'ExportDefaultDeclaration') {
if (t.isIdentifier(node.declaration)) {
addTag(node.declaration.name);
}
else if (t.isFunctionDeclaration(node.declaration) && node.declaration.id?.name) {
} else if (t.isFunctionDeclaration(node.declaration) && node.declaration.id?.name) {
addTag(node.declaration.id.name);
}
else if (t.isVariableDeclaration(node.declaration)) {
node.declaration.declarations?.forEach(declaration => {
} else if (t.isVariableDeclaration(node.declaration)) {
node.declaration.declarations?.forEach((declaration) => {
if (t.isArrowFunctionExpression(declaration.init) && t.isIdentifier(declaration.id)) {
addTag(declaration.id.name);
}
});
}
else if (t.isObjectExpression(node.declaration)) {
node.declaration.properties?.forEach(property => {
} else if (t.isObjectExpression(node.declaration)) {
node.declaration.properties?.forEach((property) => {
if (t.isProperty(property) && t.isIdentifier(property.key)) {
addTag(property.key.name);
}
});
}
else if (t.isExportNamedDeclaration(node)) {
node.specifiers.forEach(specifier => {
} else if (t.isExportNamedDeclaration(node)) {
node.specifiers.forEach((specifier) => {
if (t.isExportSpecifier(specifier) && t.isIdentifier(specifier.exported)) {
addTag(specifier.local.name);
}