Skip to content

Commit 6f98da6

Browse files
ci(antipattern): allowlist legit TS bridge/adapter paths (#8)
Same fleet-wide patch as stapeln#24 / rsr-template-repo#30. Broadens TS exclusion list (bindings/, tests/, test/, scripts/, mcp-adapter/, vscode/).
1 parent 1df20f1 commit 6f98da6

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
@@ -19,11 +19,29 @@ jobs:
1919

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

0 commit comments

Comments
 (0)