frontend/scripts/no-em-dash.ts walks src/ with the TypeScript parser and flags an em-dash in JSX text, string literals and template text. A bare "—" placeholder passes, separators go in no-em-dash.allow.json. The script is identical to index's copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
73 lines
2.6 KiB
YAML
73 lines
2.6 KiB
YAML
# See https://pre-commit.com for more information
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.4.0
|
|
hooks:
|
|
- id: check-added-large-files
|
|
- id: check-toml
|
|
- id: check-yaml
|
|
args:
|
|
- --unsafe
|
|
- id: end-of-file-fixer
|
|
exclude: |
|
|
(?x)^(
|
|
frontend/src/client/.*|
|
|
backend/fluksio/email-templates/build/.*
|
|
)$
|
|
- id: trailing-whitespace
|
|
exclude: ^frontend/src/client/.*
|
|
- repo: local
|
|
hooks:
|
|
# `bun run lint` runs in frontend/ and already points biome at the whole
|
|
# tree, so the staged paths must not be appended: they are relative to
|
|
# this repo root and would reach biome as frontend/frontend/… . The
|
|
# pattern only decides whether the hook runs at all — hence the
|
|
# extensions biome actually parses, so a text file dropped under
|
|
# frontend/ no longer triggers it.
|
|
- id: local-biome-check
|
|
name: biome check
|
|
entry: bun run lint
|
|
language: system
|
|
pass_filenames: false
|
|
files: ^frontend/.*\.([cm]?[jt]sx?|jsonc?|css)$
|
|
|
|
# Font sizes come from the Tailwind scale only; see the Typography
|
|
# section in the root DESIGN-GUIDELINES.md.
|
|
- id: no-arbitrary-font-size
|
|
name: no arbitrary text-[…] font sizes
|
|
entry: 'text-\[[0-9.]+(rem|px|em)\]'
|
|
language: pygrep
|
|
files: ^frontend/src/.*\.tsx$
|
|
|
|
# No em-dashes in user-facing strings; see Microcopy in the root
|
|
# DESIGN-GUIDELINES.md. A separator inside one line goes in
|
|
# frontend/scripts/no-em-dash.allow.json. Whole tree:
|
|
# `pre-commit run no-em-dash --all-files`.
|
|
- id: no-em-dash
|
|
name: no em-dashes in user-facing strings
|
|
entry: bun frontend/scripts/no-em-dash.ts
|
|
language: system
|
|
files: ^frontend/src/.*\.tsx?$
|
|
|
|
- id: local-ruff-check
|
|
name: ruff check
|
|
entry: uv run ruff check --force-exclude --fix --exit-non-zero-on-fix
|
|
require_serial: true
|
|
language: unsupported
|
|
types: [python]
|
|
|
|
- id: local-ruff-format
|
|
name: ruff format
|
|
entry: uv run ruff format --force-exclude --exit-non-zero-on-format
|
|
require_serial: true
|
|
language: unsupported
|
|
types: [python]
|
|
|
|
- id: generate-frontend-sdk
|
|
name: Generate Frontend SDK
|
|
entry: bash ./scripts/generate-client.sh
|
|
pass_filenames: false
|
|
language: unsupported
|
|
files: ^backend/.*$|^scripts/generate-client\.sh$
|