From cad39d898496353c5352bdb7c59e20854daf5d2d Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 3 May 2026 16:33:44 +0100 Subject: [PATCH] ci(antipattern): allowlist legit TS bridge/adapter paths --- .github/workflows/rsr-antipattern.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rsr-antipattern.yml b/.github/workflows/rsr-antipattern.yml index f24ab9d..5162f4a 100644 --- a/.github/workflows/rsr-antipattern.yml +++ b/.github/workflows/rsr-antipattern.yml @@ -17,12 +17,29 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Check for TypeScript run: | - if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then + # Allowlist (TS legitimate as a bridge/adapter to a non-ReScript ecosystem): + # bindings/ - language bindings (Deno/TS/AssemblyScript FFI to ReScript core) + # *.d.ts - TypeScript type declarations for ReScript FFI + # tests/, test/ - Deno test runners verifying ReScript output + # scripts/ - Deno build scripts (bundle, dev-server, etc.) + # mcp-adapter/ - MCP server adapters (MCP protocol is Deno/TS-typed by spec) + # vscode/ - VSCode extensions (TS is the ecosystem default) + TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) \ + | grep -v node_modules \ + | grep -v '/bindings/' \ + | grep -v '\.d\.ts$' \ + | grep -v '/tests/' \ + | grep -v '/test/' \ + | grep -v '/scripts/' \ + | grep -v '/mcp-adapter/' \ + | grep -v '/vscode/' \ + || true) + if [ -n "$TS_FILES" ]; then echo "❌ TypeScript files detected - use ReScript instead" - find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules + echo "$TS_FILES" exit 1 fi - echo "✅ No TypeScript files" + echo "✅ No TypeScript files outside allowlisted bridge/adapter paths" - name: Check for Go run: | if find . -name "*.go" | grep -q .; then