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/run-js-hook-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@systemfsoftware/claude-code-comment-checker": patch
---

The `PostToolUse` hook is shipped as compiled `run.js` instead of `run.ts`, so it runs on Deno versions that refuse type-stripping inside `node_modules`. Type-checking is preserved through JSDoc annotations and `checkJs` in `hooks/deno.jsonc`.
3 changes: 3 additions & 0 deletions hooks/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"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
2 changes: 1 addition & 1 deletion hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run.ts\"",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run.js\"",
"timeout": 30
}
]
Expand Down
6 changes: 5 additions & 1 deletion hooks/run.ts → hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ if (env instanceof type.errors) {
Deno.exit(1)
}

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