From a3e0e7fbc1b3ad2c5fc6f2a7246e5c05c192e007 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 3 May 2026 16:10:09 +0100 Subject: [PATCH] ci(antipattern): allowlist legit TS bridge/adapter paths Broadens the TS exclusion list to cover all standard bridge/adapter conventions (bindings/, tests/, test/, scripts/, mcp-adapter/, vscode/). Hard-stop on plain TypeScript application code outside these paths is preserved. Same change applied estate-wide; landed in stapeln as #24. --- .github/workflows/rsr-antipattern.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rsr-antipattern.yml b/.github/workflows/rsr-antipattern.yml index e81eafa..da004dc 100644 --- a/.github/workflows/rsr-antipattern.yml +++ b/.github/workflows/rsr-antipattern.yml @@ -27,15 +27,29 @@ jobs: - name: Check for TypeScript run: | - # Exclude bindings/deno/ - those are Deno FFI files using Deno.dlopen, not plain TypeScript - # Exclude .d.ts files - those are TypeScript type declarations for ReScript FFI - TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) | grep -v node_modules | grep -v 'bindings/deno' | grep -v '\.d\.ts$' || true) + # 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" echo "$TS_FILES" exit 1 fi - echo "✅ No TypeScript files (Deno FFI bindings excluded)" + echo "✅ No TypeScript files outside allowlisted bridge/adapter paths" - name: Check for Go run: |