Skip to content

Commit bd67a66

Browse files
committed
fix: scan .ts/.tsx in scanDynamic and correct pre-commit timeout in docs
- scanDynamic() now processes .ts and .tsx files in addition to .js, preventing TypeScript dynamic imports from being invisible to the public API allowlist check - Update ai-agent-guide pre-commit.sh timeout example from 30 to 60, matching the actual value in settings.json
1 parent b74246c commit bd67a66

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.claude/hooks/pre-commit-checks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ try {
127127
function scanDynamic(dir) {
128128
for (const ent of fs.readdirSync(dir, { withFileTypes: true })) {
129129
if (ent.isDirectory()) { scanDynamic(path.join(dir, ent.name)); continue; }
130-
if (!ent.name.endsWith('.js')) continue;
130+
if (!/\.(js|ts|tsx)$/.test(ent.name)) continue;
131131
try {
132132
const src = fs.readFileSync(path.join(dir, ent.name), 'utf8');
133133
for (const m of src.matchAll(/const\s*\{([^}]+)\}\s*=\s*(?:await\s+)?import\s*\(['"]/gs)) {

docs/guides/ai-agent-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ Add to `.claude/settings.json`:
831831
{
832832
"type": "command",
833833
"command": "bash .claude/hooks/pre-commit.sh",
834-
"timeout": 30
834+
"timeout": 60
835835
},
836836
{
837837
"type": "command",

0 commit comments

Comments
 (0)