Skip to content

Commit 10ea698

Browse files
committed
ci(antipattern): allowlist legit TS bridge/adapter paths
1 parent 343bb54 commit 10ea698

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,29 @@ jobs:
2323

2424
- name: Check for TypeScript
2525
run: |
26-
if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then
27-
echo "::error::TypeScript files found! Use ReScript instead (per RSR policy)"
26+
# Allowlist (TS legitimate as a bridge/adapter to a non-ReScript ecosystem):
27+
# bindings/ - language bindings (Deno/TS/AssemblyScript FFI to ReScript core)
28+
# *.d.ts - TypeScript type declarations for ReScript FFI
29+
# tests/, test/ - Deno test runners verifying ReScript output
30+
# scripts/ - Deno build scripts (bundle, dev-server, etc.)
31+
# mcp-adapter/ - MCP server adapters (MCP protocol is Deno/TS-typed by spec)
32+
# vscode/ - VSCode extensions (TS is the ecosystem default)
33+
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) \
34+
| grep -v node_modules \
35+
| grep -v '/bindings/' \
36+
| grep -v '\.d\.ts$' \
37+
| grep -v '/tests/' \
38+
| grep -v '/test/' \
39+
| grep -v '/scripts/' \
40+
| grep -v '/mcp-adapter/' \
41+
| grep -v '/vscode/' \
42+
|| true)
43+
if [ -n "$TS_FILES" ]; then
44+
echo "❌ TypeScript files detected - use ReScript instead"
45+
echo "$TS_FILES"
2846
exit 1
2947
fi
30-
echo " No TypeScript files found"
48+
echo " No TypeScript files outside allowlisted bridge/adapter paths"
3149
3250
- name: Check for Go
3351
run: |

0 commit comments

Comments
 (0)