瀏覽代碼

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 天之前
父節點
當前提交
0e68683ae8
共有 1 個文件被更改,包括 1 次插入1 次删除
  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,