Skip to content

build(lint): register @shadcn/lint in both oxlint configs - #34

Merged
suiramdev merged 1 commit into
devfrom
build/shadcn-lint
Sep 19, 2026
Merged

suiramdev merged 1 commit into
devfrom
build/shadcn-lint

Conversation

@suiramdev

Copy link
Copy Markdown
Owner

Summary

Registers @shadcn/lint 0.1.1 as an Oxlint JS plugin in both lint configs — the root oxlint.config.ts and apps/fumadocs/.oxlintrc.json — and enables no rule of it. Setup only: the rule choice is a design decision, and upstream's SETUP.md stops at registration. Look at settings.shadcn first; it is the only thing discovery could not work out on its own.

Motivation

  • The linter reads the real components, variants and theme, so an error can name the size or token to use instead of just refusing a class.
  • Oxlint is already the only linter here and is 1.80.0, exactly the JS-plugin floor, so the plugin costs one dependency and two lines.
  • Registering it now separates the plumbing from the rule-by-rule argument, which is worth its own review.
  • packages/ui is already in ignorePatterns, which is the correct blast radius: its components are the design system.

Drawbacks

  • A plugin with no rule on is inert — it earns nothing until a rule is chosen.
  • The plugin prints a notice on every run: this project's cn is 0.2.5 and its grammar wants 0.2.6, so it falls back to its bundled copy. It therefore reasons about class merging with a slightly different grammar than the app runs.
  • Two configs now repeat the same two lines; apps/fumadocs does not inherit the root config.
  • Third-party JS plugins run in-process on every lint, including CI.

Prior art

  • The repository already runs a third-party Oxlint JS plugin, @jliocsar/begone-slop, in exactly this shape.
  • Upstream shadcn-ui/lint documents the ESLint and Oxlint setups and explicitly leaves rules off after install.
  • The cn bump was left out on purpose: it is a runtime dependency of every component, and this repo has a documented procedure for proving a class-merge version change alters no output.

Notes

  • No visual change; no runtime code touched.
  • No tests added — the change is configuration; verified by probe instead (below).
  • Docs updated: contributing/index.mdx gains the plugin and how to switch a rule on, and packages/ui/AGENTS.md records why the ignore is correct for that package.
  • Gates: bun run check clean over 649 files, bun run check-types, bun run docs:check 38 pages / 0 errors / 0 warnings, cd apps/fumadocs && bun run lint exit 0.
  • A green run with zero rules proves nothing, so the rules were forced on temporarily through the real configs, then every probe file was deleted: no-restyle quoted Button's real cva ladder (default, compact, icon, icon-compact) and its real path, no-raw-colors listed the real theme tokens, apps/fumadocs resolved against its own src/shared/ui and app.css, and both apps reported 0 warnings — an unresolved alias or theme would have shown up there.
  • Follow-up, not blocking: bump cn to 0.2.6 with the class-merge proof, then choose rules.

Adds the design-system linter as a js plugin in oxlint.config.ts and in
apps/fumadocs/.oxlintrc.json, with no rule enabled: the rule choice is a
design decision, and the upstream setup stops here.

Discovery needs one setting. apps/web/components.json already points at
@freenary/ui/components and at the theme, but neither app's own
compositions sit behind a components.json alias, so
settings.shadcn.componentImports names the @/shared/ui prefix they share.
packages/ui stays ignored: its components are the design system.

Probed with the rules temporarily forced on through the real configs:
no-restyle names the real cva ladder of Button, no-raw-colors lists the
real theme tokens, and both apps resolve against their own theme file.
Zero warnings in either app, which is what proves the aliases resolve.
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0dfa197d-0bfc-4dae-b81d-c0e66f42bfee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@suiramdev
suiramdev merged commit 11d940b into dev Sep 19, 2026
3 checks passed
@suiramdev
suiramdev deleted the build/shadcn-lint branch September 19, 2026 11:55
suiramdev added a commit that referenced this pull request Sep 19, 2026
fix(ui): declare cn 0.2.6 and verify the bump #34 shipped
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