The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe } from "@effect/vitest"; |
| 2 | |
| 3 | import { createOxlintRuleHarness } from "../test/utils.ts"; |
| 4 | |
| 5 | const rule = createOxlintRuleHarness("t3code/no-em-dash-copy", { |
| 6 | filename: "apps/web/src/components/Example.tsx", |
| 7 | }); |
| 8 | |
| 9 | describe("t3code/no-em-dash-copy", () => { |
| 10 | rule.valid( |
| 11 | "allows em dashes in comments and regex literals", |
| 12 | ` |
| 13 | // Parses titles like "Issue — Browser". |
| 14 | const title = /^ [–—-] \\S/u; |
| 15 | `, |
| 16 | ); |
| 17 | |
| 18 | rule.valid("allows hyphens and en dashes", `const label = "Refresh failed - retry 1–2";`); |
| 19 | |
| 20 | rule.invalid("reports a string literal", `const label = "Refresh failed — retry";`); |
| 21 | |
| 22 | rule.invalid("reports a template literal", "const label = `${name} — ${kind}`;"); |
| 23 | |
| 24 | rule.invalid("reports JSX text", `const node = <p>Run a prompt — on an interval</p>;`); |
| 25 | }); |