8000 feat(lint): five interface-craft floors from the interfaces.dev cheat sheet by jangtrinh · Pull Request #189 · jangtrinh/design-os · GitHub
[go: up one dir, main page]

Skip to content

feat(lint): five interface-craft floors from the interfaces.dev cheat sheet - #189

Merged
jangtrinh merged 2 commits into
mainfrom
feat/interfaces-cheatsheet-floor
Aug 19, 2026
Merged

jangtrinh merged 2 commits into
mainfrom
feat/interfaces-cheatsheet-floor

Conversation

@jangtrinh
Copy link
Copy Markdown
Owner

What

Adopts the five machine-checkable rules from the interfaces.dev cheat sheet that our linter families did not yet cover, each as an emitter+linter pair per the paired-standard rule:

Check Family Severity Rule
dumb-punctuation content-lint warning typewriter .../'/" in visible copy — typeset copy uses … ' curly quotes; scripts/styles/attributes never fire
bare-confirm-button content-lint warning a bare OK/Okay/Yes/No label — start with a verb, repeat the consequence
paste-blocked a11y-lint error (WCAG 3.3.8) an onpaste that cancels, or a paste listener calling preventDefault — breaks password managers and OTP entry
sticky-hover-unguarded validate-layout warning raw CSS :hover outside @media (hover: hover) on a mobile-intent document; Tailwind hover: utilities and desktop-only pages never fire
data-numbers-not-tabular taste-lint warning (Typography) ≥3 number-shaped table cells with no tabular-nums and no mono face

Emitter side

  • Kit Button/Breadcrumb :hover rules move behind @media (hover: hover) (static .is-hover specimens untouched) — the kit passes the floor it now enforces (sweep: 0 findings across 27 components).
  • Table already emitted tabular-nums; the rubric now states the rule it practised.

Verification

  • Red-first: all new tests failed before implementation (9 failing), pass after.
  • The hover check's first sweep flagged its own emitter comment (:hover in prose) — fixed at the check layer (CSS comments blanked first) with a pinned test.
  • Break-to-verify: all five checks fire through the built CLI on a violation fixture.
  • Gates: typecheck, lint, build, full suite 3517 passed / 10 skipped.

Prose-only cheat-sheet items (press-scale, icon cross-fade, will-change discipline, text-wrap, image outline, underline tuning, writing rules) are recorded as gaps e1689–e1691 for the librarian loop, not hand-edited into knowledge/.

🤖 Generated with Claude Code

… sheet

content-lint gains dumb-punctuation (typewriter ellipsis/quotes in visible
copy) and bare-confirm-button (OK/Yes labels); a11y-lint gains paste-blocked
(error — cancelled paste breaks password managers and one-time codes);
validate-layout gains sticky-hover-unguarded (raw :hover outside
@media (hover: hover) on a mobile-intent document); taste-lint gains
data-numbers-not-tabular (numeric table columns without tabular figures),
with the rubric sentence the Table emitter already practised.

The kit's Button and Breadcrumb hover rules move behind @media (hover: hover)
so the kit passes the floor it now enforces; the hover check blanks CSS
comments first, which its own emitter comment proved necessary.
@jangtrinh
jangtrinh force-pushed the feat/interfaces-cheatsheet-floor branch from ece3c92 to d2a811d Compare August 19, 2026 06:05
…ion line truth, guarded floors

paste-blocked scopes its search to the paren-matched listener handler (a
neighboring handler's preventDefault can no longer bleed in), exempts
clipboard re-inserts (paste-as-plain-text is the opposite of blocking), and
the scripted-listener form downgrades to warning; lintA11y strips HTML
comments first via the now-shared stripCommentsPreservingOffsets, so no a11y
check fires inside <!-- -->.

dumb-punctuation blanks regions newline-preserving so findings point at the
ORIGINAL source line, blanks pre/code/kbd/samp alongside script/style,
skips prime marks after a digit, and refuses quote pairs spanning a sentence
boundary. checkDumbPunctuation reaches the public lint surface via re-export;
bare-confirm-button reads single-quoted and unquoted values too.

The kit gate now asserts none of the five new checkIds fire (warnings
included) — proven red with a broken guard, green restored. hasViewportMeta
is one shared definition across a11y-checks and layout-checks-hover.
@jangtrinh
jangtrinh force-pushed the feat/interfaces-cheatsheet-floor branch from d2a811d to 679189b Compare August 19, 2026 06:05
@jangtrinh
Copy link
Copy Markdown
Owner Author

Stage-4 review resolved (fix round in 679189b, all reproduced with fixtures first):

  • C1 paste-blocked: search is paren-matched to the listener's own argument list (a neighboring handler's preventDefault can no longer bleed in); clipboard re-inserts (clipboardData/getData/insertText/execCommand) are exempt — paste-as-plain-text never fires; the scripted-listener form is downgraded to warning, the onpaste attribute form stays error. lintA11y now strips HTML comments first (shared stripCommentsPreservingOffsets, third consumer → moved to taste-checks-shared), fixing the commented-out-markup class for every a11y check.
  • H1: dumb-punctuation blanks regions newline-preserving — findings now point at the original source line (pinned by a multi-line-<style> test).
  • H2: <pre>/<code>/<kbd>/<samp> are blanked; prime marks after a digit are skipped; a quote pair may not contain .!?; docstring corrected to match.
  • M1: the kit gate asserts none of the five new checkIds fire, warnings included — proven red with a deliberately broken guard, green restored.
  • M2 hasViewportMeta shared; M3 checkDumbPunctuation re-exported onto the public lint surface (tests import it from content-checks.js); low: bare-confirm-button reads single-quoted/unquoted values; hover brace-in-string limit documented.

Gates re-run on the exact merge tree: typecheck, lint, build, 3526 passed / 10 skipped.

Follow-ups (not this PR): bringing site/index.html + guide slides to the punctuation floor; the 17 frozen showcase artifacts firing sticky-hover-unguarded (warnings, accepted noise for now); a real-data positive corpus for data-numbers-not-tabular.

@jangtrinh
jangtrinh merged commit fb17b72 into main Aug 19, 2026
4 checks passed
@jangtrinh
jangtrinh deleted the feat/interfaces-cheatsheet-floor branch August 19, 2026 06:10
jangtrinh added a commit that referenced this pull request Oct 29, 2026
… sheet (#189)

* feat(lint): five interface-craft floors from the interfaces.dev cheat sheet

content-lint gains dumb-punctuation (typewriter ellipsis/quotes in visible
copy) and bare-confirm-button (OK/Yes labels); a11y-lint gains paste-blocked
(error — cancelled paste breaks password managers and one-time codes);
validate-layout gains sticky-hover-unguarded (raw :hover outside
@media (hover: hover) on a mobile-intent document); taste-lint gains
data-numbers-not-tabular (numeric table columns without tabular figures),
with the rubric sentence the Table emitter already practised.

The kit's Button and Breadcrumb hover rules move behind @media (hover: hover)
so the kit passes the floor it now enforces; the hover check blanks CSS
comments first, which its own emitter comment proved necessary.

* fix(lint): resolve stage-4 review — paste-blocked precision, punctuation line truth, guarded floors

paste-blocked scopes its search to the paren-matched listener handler (a
neighboring handler's preventDefault can no longer bleed in), exempts
clipboard re-inserts (paste-as-plain-text is the opposite of blocking), and
the scripted-listener form downgrades to warning; lintA11y strips HTML
comments first via the now-shared stripCommentsPreservingOffsets, so no a11y
check fires inside <!-- -->.

dumb-punctuation blanks regions newline-preserving so findings point at the
ORIGINAL source line, blanks pre/code/kbd/samp alongside script/style,
skips prime marks after a digit, and refuses quote pairs spanning a sentence
boundary. checkDumbPunctuation reaches the public lint surface via re-export;
bare-confirm-button reads single-quoted and unquoted values too.

The kit gate now asserts none of the five new checkIds fire (warnings
included) — proven red with a broken guard, green restored. hasViewportMeta
is one shared definition across a11y-checks and layout-checks-hover.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0