Skip to content

Commit ce2d7ee

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

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
@@ -26,12 +26,29 @@ jobs:
2626

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

0 commit comments

Comments
 (0)