Skip to content

Commit 5a03e0d

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

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
@@ -18,11 +18,29 @@ jobs:
1818

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

0 commit comments

Comments
 (0)