Repository navigation
feat(lint): lint the shape of every packages/react part - #571
Merged
kianbazza merged 1 commit intoSep 29, 2026
Conversation
kianbazza
added this pull request to stack #572
September 29, 2026 13:48
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds `bazza/use-client`, `bazza/forward-ref-named`, `bazza/part-namespace` and `bazza/data-attrs-enum`, and turns on Biome `noDefaultExport` for `packages/react/src`. Files that break a rule today are allowlisted per rule. `packages/react/AGENTS.md` documents each convention.
kianbazza
force-pushed
the
ui-616-lint-the-shape-of-every-part
branch
from
September 29, 2026 15:08
f5b164d to
bd463a3
Compare
kianbazza
marked this pull request as ready for review
September 29, 2026 15:41
This branch was successfully deployed
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.
Summary
Four rules and one Biome setting check the shape of every part in
packages/react/src. Test files are exempt.bazza/use-client:.tsxand*-context.tsfiles start with'use client'.bun run check:fixadds it.bazza/forward-ref-named:forwardRefwraps either a named function expression or the name of a function declared in the same module. Arrows and imported functions are reported, because parts don't setdisplayName.bazza/part-namespace: an exportedforwardRefpart, includingmemo(forwardRef(…)), exportsPropsfrom its namespace. It also exportsStatewhen its own render function passesstatetouseRender. If the rule can't read the render function, it reports that instead of passing.bazza/data-attrs-enum: data-attribute and CSS-variable files export only enums named*DataAttributes/*CssVars, which is all the docs type generator reads. A re-export is accepted only when it comes from another data-attribute file.packages/react/AGENTS.md: the "Component Pattern", "Data Attributes File" and "CSS Variables File" sections now describe each convention. Every rule message points to its section.Files that break these rules today are allowlisted per rule in
.oxlintrc.json:as constobjects. That is why tables likeComboboxInputDataAttributesrender empty on the docs site.PopupMenuListPrimitive,DataListInner).'use client'.Evidence
export const ItemDataAttributes = { … } as constpassedbun run check, and its docs table rendered empty.After:
bun run lint:oxlintexits 0. The allowlists contain exactly the files that break a rule today.forward-ref-namedreports nothing in the codebase, including the genericforwardRef(SelectItemImpl) as <…>parts.tooling/linttests grow to 46. Each rule has fixtures that must fail and fixtures that must pass, plus a repo-config test that checks the rules apply only to shipped source.Merge Danger
Door: two-way
Blast Radius: tooling
New parts, context modules and data-attribute files in
packages/react/srcthat don't follow these conventions now failbun run checkand CI. Existing files are unaffected until someone removes them from an allowlist.Closes UI-616