Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/explicit-config-hook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@systemfsoftware/claude-code-comment-checker": patch
---

The `PostToolUse` hook command now invokes `deno run --config <plugin>/hooks/deno.jsonc … <plugin>/hooks/run.ts` explicitly. The config file is what makes Deno treat the hook as a first-class module instead of node-compat material: without it, a hook living under `node_modules` (as an installed plugin does) cannot resolve `@std/*` or `arktype` and never reaches the checker. Passing the config restores the TypeScript source (`run.ts`) with its real imports, replacing the compiled `run.js` shipped in 0.3.1.
3 changes: 0 additions & 3 deletions hooks/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"lock": "./deno.lock",
"compilerOptions": {
"checkJs": true
},
"imports": {
"@std/fs": "jsr:@std/fs@1.0.19",
"@std/io": "jsr:@std/io@0.225.2",
Expand Down
4 changes: 2 additions & 2 deletions hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run.js\"",
"command": "deno run --config \"${CLAUDE_PLUGIN_ROOT}/hooks/deno.jsonc\" --allow-read --allow-run=comment-checker,direnv --allow-env=CLAUDE_PROJECT_DIR,PATH,HOME \"${CLAUDE_PLUGIN_ROOT}/hooks/run.ts\"",
"timeout": 30
}
]
}
]
}
}
6 changes: 1 addition & 5 deletions hooks/run.js → hooks/run.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ if (env instanceof type.errors) {
Deno.exit(1)
}

/** @param {string} cmd
* @param {string[]} args
* @returns {Promise<number | undefined>}
*/
async function run(cmd, args) {
async function run(cmd: string, args: string[]): Promise<number | undefined> {
try {
const { code } = await new Deno.Command(cmd, {
args,
Expand Down