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:
2026-10-15 22:03:36 +02:00
parent 8d3165c8c4
commit baa73bb3a3
16 changed files with 115 additions and 27 deletions
+3 -3
View File
@@ -125,7 +125,7 @@ function ThisBrowser() {
if (!webpush.supported()) {
return (
<p className="text-sm text-muted-foreground">
This browser cannot receive notifications. They need HTTPS — over plain
This browser cannot receive notifications. They need HTTPS. Over plain
http on a local address, no browser will allow them.
</p>
)
@@ -215,7 +215,7 @@ function AlertsForm({ initial }: { initial: AlertsConfig }) {
<span className="text-sm text-muted-foreground">
{draft.enabled
? "Failures reach the channels below."
: "Switched off — failures only reach the log."}
: "Switched off. Failures only reach the log."}
</span>
</div>
<Switch
@@ -313,7 +313,7 @@ function AlertsForm({ initial }: { initial: AlertsConfig }) {
disabled={dirty || test.isPending}
title={
dirty
? "Save first — the engine sends through the stored channel"
? "Save first. The engine sends through the stored channel"
: "Send one alert through this channel"
}
data-testid="test-channel"
+2 -2
View File
@@ -147,8 +147,8 @@ function Modules() {
className="text-sm text-muted-foreground"
data-testid="modules-adopted"
>
Adopted — this is the environment Fluksio itself is installed in.
Add a package the way you added the rest:{" "}
Adopted. This is the environment Fluksio itself is installed in. Add
a package the way you added the rest:{" "}
<span className="font-mono">pip install …</span>, then sync or
restart so the workers pick it up. For a venv the engine owns
instead, set <span className="font-mono">NODE_VENV=managed</span>.
+3 -3
View File
@@ -117,12 +117,12 @@ function Machines() {
{String(provisioner.name)} can start{" "}
{(provisioner.profiles as string[]).join(", ")}
{outstanding.length > 0
? ` — asked for ${outstanding
? `. Asked for ${outstanding
.map((job) => `${job.profile} (job ${job.job})`)
.join(", ")}`
: ""}
{provisioner.last_error
? ` — last failed: ${String(provisioner.last_error)}`
? `. Last failed: ${String(provisioner.last_error)}`
: ""}
</p>
)
@@ -269,7 +269,7 @@ function Flavors() {
<span className="font-mono text-xs text-muted-foreground">
{flavor.cpus} cpu · {Math.round((flavor.ram ?? 0) / 1024)} GB
{flavor.gpus ? ` · ${flavor.gpus} gpu` : ""}
{flavor.description ? ` — ${flavor.description}` : ""}
{flavor.description ? ` · ${flavor.description}` : ""}
</span>
</span>
{mayEdit ? (