Skip to content

Commit 5962a09

Browse files
ci(antipattern): broaden TS allowlist v2 (#13)
Same fleet-wide v2 patch. Adds /cli/, mod.ts, lsp-server, *vscode*, /deno-*/
1 parent 3087fcf commit 5962a09

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,38 @@ jobs:
2323

2424
- name: Check for TypeScript
2525
run: |
26-
if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then
26+
# Allowlist (TS legitimate as a bridge/adapter to a non-ReScript ecosystem):
27+
# bindings/ - language bindings (Deno/TS/AssemblyScript FFI)
28+
# *.d.ts - TypeScript type declarations for ReScript FFI
29+
# tests/, test/ - Deno test runners
30+
# scripts/ - Deno build scripts
31+
# mcp-adapter/ - MCP server adapters (MCP is Deno/TS-typed by spec)
32+
# *vscode* - VSCode extensions (TS is the ecosystem default)
33+
# cli/ - CLI entry points (Deno scripts)
34+
# mod.ts - canonical Deno module entrypoint
35+
# *lsp-server.ts, *lsp.ts - Language Server Protocol implementations
36+
# deno-*/ - subprojects explicitly named for Deno
37+
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) \
38+
| grep -v node_modules \
39+
| grep -v '/bindings/' \
40+
| grep -v '\.d\.ts$' \
41+
| grep -v '/tests/' \
42+
| grep -v '/test/' \
43+
| grep -v '/scripts/' \
44+
| grep -v '/mcp-adapter/' \
45+
| grep -Ev '/[^/]*vscode[^/]*/' \
46+
| grep -v '/cli/' \
47+
| grep -v '/mod\.ts$' \
48+
| grep -Ev 'lsp[-_]?server\.ts$' \
49+
| grep -Ev '[/-]lsp\.ts$' \
50+
| grep -Ev '/deno-[^/]+/' \
51+
|| true)
52+
if [ -n "$TS_FILES" ]; then
2753
echo "❌ TypeScript files detected - use ReScript instead"
28-
find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules
54+
echo "$TS_FILES"
2955
exit 1
3056
fi
31-
echo "✅ No TypeScript files"
57+
echo "✅ No TypeScript files outside allowlisted bridge/adapter paths"
3258
3359
- name: Check for Go
3460
run: |

0 commit comments

Comments
 (0)