Skip to content

Commit 83d6e45

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

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
@@ -20,12 +20,29 @@ jobs:
2020

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

0 commit comments

Comments
 (0)