Bladeren bron

fix(attachment-refs): correct routesFactory return type to Router

routesFactory is synchronous (no await; it returns the Router directly)
and its only caller passes the result straight to app.use, but it was
annotated Promise<Router>. tsgo flagged this (TS2322), which made
`pnpm lint:typecheck` and the package's .d.ts build step fail. Annotate
it as Router to match the actual synchronous return.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Yuki Takei 1 dag geleden
bovenliggende
commit
0e68683ae8
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      packages/remark-attachment-refs/src/server/routes/refs.ts

+ 1 - 1
packages/remark-attachment-refs/src/server/routes/refs.ts

@@ -66,7 +66,7 @@ const loginRequiredFallback = (_req, res) => {
   return res.status(403).send('login required');
 };
 
-export const routesFactory = (crowi): Promise<Router> => {
+export const routesFactory = (crowi): Router => {
   const loginRequired = crowi.loginRequiredFactory(
     crowi,
     true,