Skip to content

Commit

Permalink
fix(generators): use export type vs export (#3246)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-steel authored Nov 8, 2023
1 parent 9243542 commit 82d30fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/generators/src/app/templates/declarations.tpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ${
: `import { ApplicationConfiguration } from './configuration'`
}
export { NextFunction }
export type { NextFunction }
// The types for app.get(name) and app.set(name)
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export const generate = (ctx: AuthenticationGeneratorContext) =>
.then(
when(
(ctx) => ctx.language === 'ts',
inject(importTemplate, before('export { NextFunction }'), toDeclarationFile)
inject(
importTemplate,
before(/export \{ NextFunction \}|export type \{ NextFunction \}/),
toDeclarationFile
)
)
)
.then(when((ctx) => ctx.language === 'ts', inject(paramsTemplate, append(), toDeclarationFile)))

0 comments on commit 82d30fd

Please sign in to comment.