Skip to content

Commit 869e8cd

Browse files
committed
ci(antipattern): allowlist legit TS bridge/adapter paths
1 parent c5c2af9 commit 869e8cd

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
@@ -33,15 +33,29 @@ jobs:
3333

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

0 commit comments

Comments
 (0)