Skip to content

Commit 352fc49

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

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
@@ -24,12 +24,29 @@ jobs:
2424

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

0 commit comments

Comments
 (0)