Skip to content

chore(audit-docs): honour omitted style props - #1367

Merged
tenphi merged 1 commit into
mainfrom
fix-audit-docs-omitted-style-props
Aug 26, 2026
Merged

chore(audit-docs): honour omitted style props#1367
tenphi merged 1 commit into
mainfrom
fix-audit-docs-omitted-style-props

Conversation

@tenphi

@tenphi tenphi commented Aug 26, 2026

Copy link
Copy Markdown
Member

What

detectStyleProps in scripts/audit-docs.mjs derives a component's expected style props from the list named in its extractStyles(...) call. It had no awareness of the props interface dropping entries from that list.

Board declares Omit<ContainerStyleProps, 'margin'> and destructures margin as the grid gap — so margin never reaches extractStyles and is not a style prop on Board. The audit still reported:

Board (src/components/layout/Board/Board.docs.mdx)
  - Style props in code, not in docs: margin

which would push the docs into listing a prop the component does not accept. This surfaced while correcting Board.docs.mdx in fa0e467.

How

Collect the names removed by an Omit<…StyleProps | …BaseProps, …> in the component's own file and subtract them from the detected list. Non-style names in an Omit (children, onDrag, …) are simply absent from the list, so filtering them is a no-op.

Verification

Diffed the full audit output across every component, before and after:

  • issues removed: Style props in code, not in docs: margin (Board) — exactly one
  • issues introduced: none

Tooling only — nothing about the published package changes, hence an empty changeset.


Note

Low Risk
Changes only affect the internal audit-docs script; runtime components and published APIs are unchanged.

Overview
The audit-docs script no longer treats every name from an extractStyles(...) style list as a documented style prop when the component’s props type drops those names via Omit<…StyleProps | …BaseProps, …>.

It adds extractOmittedStyleProps to collect omitted keys from the main component file and detectStyleProps filters them out before comparing docs to code. That fixes false positives such as Board, where margin is omitted from ContainerStyleProps and used as grid gap instead of a CSS margin—the audit had incorrectly required margin in Style Properties.

Verbose mode logs which props were treated as omitted. Tooling only; no published package API change (empty changeset).

Reviewed by Cursor Bugbot for commit 788053c. Bugbot is set up for automated code reviews on this repo. Configure here.

`detectStyleProps` read the style list named in a component's `extractStyles` call and knew nothing about the props interface dropping entries from it. `Board` declares `Omit<ContainerStyleProps, 'margin'>` and destructures `margin` as the grid gap, so `margin` never reaches `extractStyles` — yet the audit reported "Style props in code, not in docs: margin" and would have pushed the docs into listing a prop `Board` does not accept.

Collect the names an `Omit<…StyleProps | …BaseProps, …>` removes and subtract them from the detected list. Across the whole repo this drops exactly that one false positive and introduces none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 788053c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview Aug 26, 2026 10:56am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-4a4b42a.

@github-actions

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 500.28 KB (0% 🟰) Yes 🎉
Tree shaking (just a Button) 118.96 KB (0% 🟰) Yes 🎉

Compared against main at fa0e467run 32960485115, 2026-08-26T10:52:59Z.

To see which modules changed, download the size-limit-statoscope-report artifact from this run and open report.html.

@tenphi
tenphi merged commit 224b7e1 into main Aug 26, 2026
16 checks passed
@tenphi
tenphi deleted the fix-audit-docs-omitted-style-props branch August 26, 2026 11:02
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