Skip to content

docs(stacks): use type-only import for AppType#860

Merged
yusukebe merged 1 commit into
honojs:mainfrom
o8n:docs/stacks-type-only-import
May 7, 2026
Merged

docs(stacks): use type-only import for AppType#860
yusukebe merged 1 commit into
honojs:mainfrom
o8n:docs/stacks-type-only-import

Conversation

@o8n
Copy link
Copy Markdown
Contributor

@o8n o8n commented May 7, 2026

Same as #622 and #744, applied to docs/concepts/stacks.md.

Both AppType imports in this page are only used as a type parameter to hc<>(), so they should be type-only imports. With verbatimModuleSyntax: true, the current example fails to compile with TS1484.

Reproduction

Node.js v22.12.0, TypeScript 6.0.3, Hono 4.12.18.

tsconfig.json

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "strict": true,
    "verbatimModuleSyntax": true,
    "skipLibCheck": true,
    "noEmit": true
  }
}

tsc --noEmit on the current example in docs/concepts/stacks.md

client.ts:1:10 - error TS1484: 'AppType' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

1 import { AppType } from './server'
           ~~~~~~~


Found 1 error in client.ts:1
image

After applying this PR, tsc --noEmit exits cleanly with no output.

Happy to adjust if anything is off.

Copy link
Copy Markdown
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Copy Markdown
Member

yusukebe commented May 7, 2026

@o8n

Nice! Thanks.

@yusukebe yusukebe merged commit c1ce58d into honojs:main May 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants