Skip to content

Commit 0b1e9c6

Browse files
ci(antipattern): allowlist legit TS bridge/adapter paths (#3)
1 parent 16f3c0b commit 0b1e9c6

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,29 @@ jobs:
1717
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1818
- name: Check for TypeScript
1919
run: |
20-
if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then
20+
# Allowlist (TS legitimate as a bridge/adapter to a non-ReScript ecosystem):
21+
# bindings/ - language bindings (Deno/TS/AssemblyScript FFI to ReScript core)
22+
# *.d.ts - TypeScript type declarations for ReScript FFI
23+
# tests/, test/ - Deno test runners verifying ReScript output
24+
# scripts/ - Deno build scripts (bundle, dev-server, etc.)
25+
# mcp-adapter/ - MCP server adapters (MCP protocol is Deno/TS-typed by spec)
26+
# vscode/ - VSCode extensions (TS is the ecosystem default)
27+
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) \
28+
| grep -v node_modules \
29+
| grep -v '/bindings/' \
30+
| grep -v '\.d\.ts$' \
31+
| grep -v '/tests/' \
32+
| grep -v '/test/' \
33+
| grep -v '/scripts/' \
34+
| grep -v '/mcp-adapter/' \
35+
| grep -v '/vscode/' \
36+
|| true)
37+
if [ -n "$TS_FILES" ]; then
2138
echo "❌ TypeScript files detected - use ReScript instead"
22-
find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules
39+
echo "$TS_FILES"
2340
exit 1
2441
fi
25-
echo "✅ No TypeScript files"
42+
echo "✅ No TypeScript files outside allowlisted bridge/adapter paths"
2643
- name: Check for Go
2744
run: |
2845
if find . -name "*.go" | grep -q .; then

0 commit comments

Comments
 (0)