Skip to content

Commit 111560d

Browse files
committed
update if early return
1 parent ce16ab5 commit 111560d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/next/src/server/typescript/rules/metadata.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,25 @@ const metadata = {
160160
const diagnostics: tsModule.Diagnostic[] = []
161161

162162
const exportClause = node.exportClause
163-
if (exportClause && ts.isNamedExports(exportClause)) {
163+
if (!node.isTypeOnly && exportClause && ts.isNamedExports(exportClause)) {
164164
for (const e of exportClause.elements) {
165+
if (e.isTypeOnly) {
166+
continue
167+
}
165168
const exportName = e.name.getText()
166169
if (exportName !== 'metadata' && exportName !== 'generateMetadata') {
167170
continue
168171
}
169172

170173
const symbol = typeChecker.getSymbolAtLocation(e.name)
171-
if (!symbol) continue
174+
if (!symbol) {
175+
continue
176+
}
172177

173178
const originalSymbol = typeChecker.getAliasedSymbol(symbol)
174-
if (!originalSymbol) continue
179+
if (!originalSymbol) {
180+
continue
181+
}
175182

176183
const declarations = originalSymbol.getDeclarations()
177184
if (!declarations) {

0 commit comments

Comments
 (0)