Spaces:
Runtime error
Runtime error
Download frontend/scripts/check-no-em-dash.mjs from firebird-technologies/NoteStack-Test: direct link, hf CLI and curl.
- Browser
- Download file 600 Bytes
-
https://huggingface.co/spaces/firebird-technologies/NoteStack-Test/resolve/main/frontend/scripts/check-no-em-dash.mjs
- Command line
-
hf download hf://spaces/firebird-technologies/NoteStack-Test/frontend/scripts/check-no-em-dash.mjs
-
curl -L -o check-no-em-dash.mjs https://huggingface.co/spaces/firebird-technologies/NoteStack-Test/resolve/main/frontend/scripts/check-no-em-dash.mjs
600 Bytes
| // Fails the build if any em dash sneaks into UI copy or blog content. | |
| import { readdirSync, readFileSync, statSync } from "node:fs"; | |
| import { join } from "node:path"; | |
| const bad = []; | |
| const walk = (dir) => { | |
| for (const name of readdirSync(dir)) { | |
| const p = join(dir, name); | |
| if (statSync(p).isDirectory()) walk(p); | |
| else if (/\.(tsx?|css|html|md)$/.test(name) && readFileSync(p, "utf8").includes("—")) bad.push(p); | |
| } | |
| }; | |
| walk("src"); | |
| walk("public"); | |
| if (bad.length) { | |
| console.error("Em dashes found in:\n" + bad.join("\n")); | |
| process.exit(1); | |
| } | |
| console.log("No em dashes found."); | |