[FEATURE] `claude plugin test` and `claude plugin validate` do not type-check TypeScript mods
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The mod API ships full TypeScript types (.claude-plugin/types/ with a tsconfig.json that sets strict), but neither claude plugin test nor claude plugin validate runs a type check. Tests are executed with types stripped, so a plugin with type errors passes both commands.
What Should Happen?
claude plugin validatetype-checks the plugin with thetsconfig.jsonit already has, and fails on errors. This would be the natural place, since validate already reads the hooks module and lists the events,$calls and env variables it uses.- Or an opt-in flag such as
claude plugin test --typecheck. - Or at least a note in the plugin docs that both commands skip type checking, so authors know to add their own.
Error Messages/Logs
Steps to Reproduce
- In any TypeScript mod, add a file under
hooks/(or a test) with a type error:
``ts``
export const probe: number = 'a'
- Run
claude plugin validate <plugin-dir>: it prints✔ Validation passed. - Run
claude plugin test <plugin-dir>: every test passes. - Run
tsc --noEmit -p <plugin-dir>: it reportsTS2322: Type 'string' is not assignable to type 'number'.
We also saw this in a real test: a test that passed a malformed SessionUsage mock (context: undefined) ran and passed under claude plugin test, while tsc reported TS2322 for the same line.
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.289
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
We added a root package.json with typescript (pinned to 7.0.2) as a dev dependency and a script that runs tsc --noEmit -p <plugin-dir> next to claude plugin test and claude plugin validate. This works, but every mod repository has to set it up, and a plugin repo then needs Node and npm tooling even though the mod itself needs neither.
Node v24.20.0 was used.