chore(audit-docs): honour omitted style props - #1367
Merged
Conversation
`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 detectedLatest commit: 788053c The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
🧪 Storybook is successfully deployed!
|
Contributor
📦 NPM canary releaseDeployed canary version 0.0.0-canary-4a4b42a. |
Contributor
🏋️ Size limit report
Compared against main at fa0e467 — run 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
detectStylePropsinscripts/audit-docs.mjsderives a component's expected style props from the list named in itsextractStyles(...)call. It had no awareness of the props interface dropping entries from that list.BoarddeclaresOmit<ContainerStyleProps, 'margin'>and destructuresmarginas the grid gap — somarginnever reachesextractStylesand is not a style prop onBoard. The audit still reported:which would push the docs into listing a prop the component does not accept. This surfaced while correcting
Board.docs.mdxin 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 anOmit(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:
Style props in code, not in docs: margin(Board) — exactly oneTooling 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 viaOmit<…StyleProps | …BaseProps, …>.It adds
extractOmittedStylePropsto collect omitted keys from the main component file anddetectStylePropsfilters them out before comparing docs to code. That fixes false positives such asBoard, wheremarginis omitted fromContainerStylePropsand used as grid gap instead of a CSS margin—the audit had incorrectly requiredmarginin 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.