chore: add no-emdash/endash rule to agent instructions and CI lint (#24375)

Add a lint check that prevents introduction of Unicode emdash (U+2014)
and endash (U+2013) characters. These are almost exclusively introduced
by AI agents and conflict with the project writing style.

The lint script (scripts/check_emdash.sh) checks only added lines in
the current diff by default, so existing violations do not block CI.
Pass --all to scan the entire repo for auditing.

Agent instructions in AGENTS.md, site/AGENTS.md, and the docs style
guide now explicitly ban emdash, endash, and " -- " as punctuation,
with guidance to use commas, semicolons, or periods instead.
This commit is contained in:
Mathias Fredriksson
2026-04-21 13:55:24 +03:00
committed by GitHub
parent 9d0469fc4c
commit 623e72d72d
5 changed files with 146 additions and 3 deletions
+4 -1
View File
@@ -71,8 +71,11 @@ When investigating or editing TypeScript/React code, always use the TypeScript l
If sibling components initialize state with `useMemo`, don't switch to
`useState(initialFn)` in the same file without reason.
- Match errors by error code or HTTP status, never by comparing error
message strings. String matching is brittle — messages change, get
message strings. String matching is brittle; messages change, get
localized, or get reformatted.
- Do not use emdash (U+2014), endash (U+2013), or ` -- ` as punctuation
in code, comments, string literals, or documentation. Use commas,
semicolons, or periods instead. Restructure the sentence if needed.
## TypeScript Type Safety