no-em-dash pre-commit hook for user-facing strings, existing em-dashes rewritten
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.
This commit is contained in:
@@ -40,6 +40,16 @@ repos:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user