Skip to content

Commit 11afac8

Browse files
author
Jonathan D.A. Jewell
committed
chore: Add ReScript enforcement (RSR policy)
1 parent 2816289 commit 11afac8

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.claude/CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Project Instructions
2+
3+
## Language Policy (RSR)
4+
5+
- **REQUIRED**: ReScript for all JS-target code
6+
- **FORBIDDEN**: New TypeScript/JavaScript files
7+
- **ALLOWED**: Generated .res.js files

.github/workflows/ts-blocker.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: TypeScript/JavaScript Blocker
2+
on: [push, pull_request]
3+
jobs:
4+
check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Block new TypeScript/JavaScript
9+
run: |
10+
NEW_TS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(ts|tsx)$' | grep -v '\.gen\.' || true)
11+
NEW_JS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(js|jsx)$' | grep -v '\.res\.js$' | grep -v '\.gen\.' | grep -v 'node_modules' || true)
12+
13+
if [ -n "$NEW_TS" ] || [ -n "$NEW_JS" ]; then
14+
echo "❌ New TS/JS files detected. Use ReScript instead."
15+
[ -n "$NEW_TS" ] && echo "$NEW_TS"
16+
[ -n "$NEW_JS" ] && echo "$NEW_JS"
17+
exit 1
18+
fi
19+
echo "✅ ReScript policy enforced"

0 commit comments

Comments
 (0)