refactor(hello): enable isolated declarations (#1198)

pull/1206/head
Jonathan Haines 2025-06-09 19:17:27 +10:00 committed by GitHub
parent ab390305fb
commit e1eae2078f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/hello': patch
---
Add explicit `MiddlewareHandler` return type

View File

@ -1,6 +1,7 @@
import type { MiddlewareHandler } from 'hono'
import { createMiddleware } from 'hono/factory'
export const hello = (message: string = 'Hello!') => {
export const hello = (message: string = 'Hello!'): MiddlewareHandler => {
return createMiddleware(async (c, next) => {
await next()
c.res.headers.append('X-Message', message)

View File

@ -4,7 +4,8 @@
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
"emitDeclarationOnly": false
"emitDeclarationOnly": false,
"isolatedDeclarations": true
},
"include": ["src/**/*.ts"],
"exclude": ["**/*.test.ts"],