Skip to content

Commit 5fccf72

Browse files
committed
ci(antipattern): allowlist legit TS bridge/adapter paths
1 parent 6f8b6d1 commit 5fccf72

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,29 @@ jobs:
2727

2828
- name: Check for TypeScript
2929
run: |
30-
# Exclude bindings/deno/ - those are Deno FFI files using Deno.dlopen, not plain TypeScript
31-
# Exclude .d.ts files - those are TypeScript type declarations for ReScript FFI
32-
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) | grep -v node_modules | grep -v 'bindings/deno' | grep -v '\.d\.ts$' || true)
30+
# Allowlist (TS legitimate as a bridge/adapter to a non-ReScript ecosystem):
31+
# bindings/ - language bindings (Deno/TS/AssemblyScript FFI to ReScript core)
32+
# *.d.ts - TypeScript type declarations for ReScript FFI
33+
# tests/, test/ - Deno test runners verifying ReScript output
34+
# scripts/ - Deno build scripts (bundle, dev-server, etc.)
35+
# mcp-adapter/ - MCP server adapters (MCP protocol is Deno/TS-typed by spec)
36+
# vscode/ - VSCode extensions (TS is the ecosystem default)
37+
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) \
38+
| grep -v node_modules \
39+
| grep -v '/bindings/' \
40+
| grep -v '\.d\.ts$' \
41+
| grep -v '/tests/' \
42+
| grep -v '/test/' \
43+
| grep -v '/scripts/' \
44+
| grep -v '/mcp-adapter/' \
45+
| grep -v '/vscode/' \
46+
|| true)
3347
if [ -n "$TS_FILES" ]; then
3448
echo "❌ TypeScript files detected - use ReScript instead"
3549
echo "$TS_FILES"
3650
exit 1
3751
fi
38-
echo "✅ No TypeScript files (Deno FFI bindings excluded)"
52+
echo "✅ No TypeScript files outside allowlisted bridge/adapter paths"
3953
4054
- name: Check for Go
4155
run: |

0 commit comments

Comments
 (0)