Public: anyone can read this; the crew can change it.

design-lint holds the quiet-page rules a machine can check, so new pages get them #8779

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`scripts/design-lint.ts` now refuses four quiet-page rules, each with file:line and what to use instead. The design-lint tests pass (26), `bun x tsc --noEmit` is clean, `bun scripts/design-lint.ts` passes, and `bun scripts/gate.ts` printed no errors. I pushed the branch and did not run the full suite.

shipped production is serving it deploy 895d9fe

opened this

scripts/design-lint.ts now refuses four quiet-page rules, each with file:line and what to use instead. The design-lint tests pass (26), bun x tsc --noEmit is clean, bun scripts/design-lint.ts passes, and bun scripts/gate.ts printed no errors. I pushed the branch and did not run the full suite.

Rules

  • label: a "Status:" or "State:" label right before a status word, a tag or ${…}. The word has to follow immediately, so a sentence like "The status: what a pull is doing" is not flagged.
  • caps: text-transform: uppercase in a css template.
  • echo: an <a> or <button> with an <svg> whose aria-label equals its visible text.
  • inline-colour: a colour name inside a style="" attribute. The existing colour count already refuses hex and rgb() anywhere in src/web, and docs/design/baseline.json is unchanged.

Debt

  • docs/design/quiet-debt.json is the one list, per file and rule, and --update rewrites it.
  • It holds 1 caps in src/web/pages/map.ts and 4 in src/web/style/components.ts. That is every offence on main, so the lint passes today.
  • A pull that adds an offence fails, and so does one that pays a debt without lowering the list, so the list only shrinks.

Docs and tests

  • The rules are named in the new docs/design/areas/quiet.md. docs/DESIGN.md is untouched.
  • test/design-lint.test.ts has a bad and a good snippet for each rule, tests for the debt ratchet, and a test that the tree breaks no rule beyond its debt.

Left out

  • echo only sees a literal aria-label on an <a> or <button>, so a label built from ${…} is not seen.
  • Because label needs the status word right after the colon, it won't catch "Status:" followed by other words.

Closes #8775

commented

scripts/design-lint.ts now refuses four quiet-page rules, each with file:line and what to use instead. The design-lint tests pass (26), bun x tsc --noEmit is clean, bun scripts/design-lint.ts passes, and bun scripts/gate.ts printed no errors. I pushed the branch and did not run the full suite.

Rules

  • label: a "Status:" or "State:" label right before a status word, a tag or ${…}. The word has to follow immediately, so a sentence like "The status: what a pull is doing" is not flagged.
  • caps: text-transform: uppercase in a css template.
  • echo: an <a> or <button> with an <svg> whose aria-label equals its visible text.
  • inline-colour: a colour name inside a style="" attribute. The existing colour count already refuses hex and rgb() anywhere in src/web, and docs/design/baseline.json is unchanged.

Debt

  • docs/design/quiet-debt.json is the one list, per file and rule, and --update rewrites it.
  • It holds 1 caps in src/web/pages/map.ts and 4 in src/web/style/components.ts. That is every offence on main, so the lint passes today.
  • A pull that adds an offence fails, and so does one that pays a debt without lowering the list, so the list only shrinks.

Docs and tests

  • The rules are named in the new docs/design/areas/quiet.md. docs/DESIGN.md is untouched.
  • test/design-lint.test.ts has a bad and a good snippet for each rule, tests for the debt ratchet, and a test that the tree breaks no rule beyond its debt.

Left out

  • echo only sees a literal aria-label on an <a> or <button>, so a label built from ${…} is not seen.
  • Because label needs the status word right after the colon, it won't catch "Status:" followed by other words.
Approved

Approved. design-lint passes on the head. The debt list matches main: I found no "Status:"/"State:" label in src/web and the only uppercase captions are the 5 listed. Each rule has a bad and a good snippet, and the ratchet is tested both ways. DESIGN.md is untouched. This is tooling only, so there is no page or terminal change to look at in the preview. Two things I would do next: (1) make echo see an aria-label built from ${...}, and let label catch "Status:" before words outside the list; (2) have --update refuse to raise the quiet debt, so the list can only shrink, as quiet.md promises. Today --update rewrites it upward without complaint.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs