Skip to content

Floor lint: reject sizes between the 10px scanning size and the 11px label floor - #770

Merged
JoviDeCroock merged 1 commit into
mainfrom
followup/type-floor-lint-11px
Oct 9, 2026
Merged

JoviDeCroock merged 1 commit into
mainfrom
followup/type-floor-lint-11px

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #767.

Why

#767 moved every text-xs to text-[12px] and made design-local/no-sub-floor-text flag text-xs. The rule still only enforced a 10px minimum, so text-[10.5px] and text-[0.75rem] passed. Both are the same 10.5px that text-xs resolves to on the 14px root.

docs/design.md has three small sizes:

  • 10px for scanning-only glyphs and structural metadata
  • 11px as the floor for anything read as a label
  • 12px for compact helper copy

Under 11px, only 10px has a role. Anything else under 11px is off the scale.

What changes

  • The rule rejects any arbitrary text size under 11px except exactly 10px. This closes the gap without needing to know each element's role. Every current 10px use in src/ still passes: the disclosure glyphs, the DiffView header strip and the SeverityBar legend.
  • Units are read case-insensitively. Tailwind emits [font-size:10.5PX] as a real font size.
  • A + sign and exponents are accepted.
  • % and the absolute units (pt, pc, in, cm, mm, Q) are converted along with px, rem and em. rem, em and % are taken at 14px.
  • A 0.01px tolerance lets hand-written rem values for 10px and 11px pass.
  • New fixtures:
    • Flagged: text-[10.5px], text-[0.75rem], text-[0.75em], text-[.75rem], [font-size:10.5PX], ! with a variant, ! after the bracket, pt, %, signed values and exponents.
    • Passing: sm:, ! and uppercase-unit properties at 10px, plus 7.5pt, 0.7857rem, 11.5px, 0.875rem and text-sm.

Verification

  • pnpm run verify:quick passes.
  • test/oxlint-design-tokens.test.mjs: 6/6.
  • oxlint reports 0 problems across all 198 files in src/ with the repo config, so no source changes were needed.
  • Each spelling was checked against Tailwind 4.3.3's output.

Limits

These are not checked:

  • calc(), clamp(), var(), text-(length:--x) and viewport units
  • keywords like x-small
  • the [font:…] shorthand
  • inline style={{ fontSize }} (no uses in src/ today)

em and % assume a 14px parent. Whether a 10px string is really a glyph is still left to review.

Docs

The floor lint note in docs/design.md and the rule description in docs/tooling.md are updated.

…label floor

no-sub-floor-text only enforced a 10px floor, so text-[10.5px] and
text-[0.75rem] (the 10.5px that text-xs resolves to on the 14px root)
still passed. Below 11px the design scale has one size, 10px, so the
rule now rejects anything under 11px other than exactly 10px. That
closes the gap without role awareness: every current 10px use is a
scanning glyph or header strip and still passes.

Also reads units case-insensitively, accepts a + sign and exponents,
and converts pt/pc/in/cm/mm/Q and % alongside px/rem/em.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Detection eval report

  • generated: 2026-10-09T17:32:20.115Z
  • deterministic rules version: 1.47.0

Corpus coverage (gated)

ecosystem regression frontier benign hard-negatives
atpm 6 0 0
npm 39 12 22
pypi 15 0 0
vscode 3 0 0

Regression (gated)

metric value
malicious recall 100% (49/49)
critical recall 100% (13/13)
benign control false positives 1/14

Acknowledged positives:

  • pypi-benign-docs-metadata-and-test-fixtures (control)

Frontier (reported — truth-labeled hard cases)

recall 92% (11/12)

  • MISS npm-solana-web3js-keytheft (network-exfil)

Benign hard-negatives (gated — false-positive precision)

false positives 1/22 (5%)

  • FALSE POSITIVE legit-env-color-helper (legit-env-read)

Evasion robustness (reported)

transform samples still blocked code rules retained
splitStringLiterals 27 96% 100%
bracketifyMemberAccess 27 100% 100%
base64Wrap 27 59% 12%
pushPastWindow 27 100% 100%

Release injection (gated — payload spliced into an existing module)

shape samples release risk still at bar misses
lines 21 95% npm-assembled-require-exfil (low)
minified 21 100% none

Updated by CI for this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
staged-publish-review f267e04 Commit Preview URL

Branch Preview URL
Oct 09 2026, 05:31 PM

Base automatically changed from ia-link-logic-fixes to main October 9, 2026 17:35
@JoviDeCroock
JoviDeCroock merged commit fecbfeb into main Oct 9, 2026
6 checks passed
@JoviDeCroock
JoviDeCroock deleted the followup/type-floor-lint-11px branch October 9, 2026 18:00
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