Skip to content

chore(repo): move oxlint and oxfmt to native root configs - #6311

Merged
jgoux merged 7 commits into
developfrom
kanad-claude/monorepo-task-runner-alternatives-bb6b48
Aug 25, 2026
Merged

chore(repo): move oxlint and oxfmt to native root configs#6311
jgoux merged 7 commits into
developfrom
kanad-claude/monorepo-task-runner-alternatives-bb6b48

Conversation

@kanadgupta

Copy link
Copy Markdown
Member

What

Replaces the per-package nx-inferred lint/format targets with tool-native configuration at the repo root, so oxlint and oxfmt work standalone (pnpm exec oxlint, pnpm exec oxfmt) and the oxc VSCode extension sees the exact rules CI enforces.

Three commits, meant to be reviewed separately:

  1. chore: fix type-aware oxlint findings across the monorepo — the ~30 findings that block enabling type-aware linting repo-wide (no-floating-promises, no-base-to-string, redundant union constituents, = undefined optional params, …), plus two TS7 modernizations tsgolint forced in tools/nx-plugins (drop node10 module resolution; replace the Function('return import(...)') transpile workaround with a plain import(), obsolete under Node 24 type stripping).
  2. chore: format the full repo surface with oxfmt — mechanical one-time pass over surface the per-package targets never covered: docs markdown, workflow YAML, root/wrapper manifests, tools/, apps/docs. Generated docs outputs are excluded so they stay byte-identical with their generator.
  3. chore: move oxlint and oxfmt to native root configs — the actual restructuring (details below).

Why

  • Tool configuration lived in nx plugin code (--deny-warnings, --type-aware via a package.json side-channel) where only nx could see it; the oxlint VSCode extension had no config to discover at all.
  • Type-aware linting was scoped to packages/api only. Repo-wide it costs ~3.5s and immediately caught real issues (e.g. floating promises) — it is now on everywhere via options.typeAware/options.denyWarnings in .oxlintrc.json.
  • Spawning 7 per-package processes through nx for millisecond-fast Rust tools cost more than one whole-repo pass (~1s fmt, ~3.5s type-aware lint).

Key changes

  • Root .oxlintrc.json: type-aware + deny-warnings, ignore list (.repos, apps/cli-go, fixtures, generated output), Effect-idiom rule exclusions (no-misused-spread, unbound-method — both false-positive on Data.Class copy-with-update and .pipe(sem.withPermit) patterns), and a legacy-scoped no-base-to-string override.
  • Root .oxfmtrc.json: ignore list only (style defaults unchanged); replaces apps/cli-e2e/.prettierignore, which only worked when oxfmt ran from that cwd.
  • lint:*/fmt:* are now plain command targets on @supabase/root (declared in the root package.json nx field); oxlint.plugin.ts and oxfmt.plugin.ts are deleted. Root pnpm check:all/fix:all and CI entrypoints are unchanged; per-package check:all/fix:all add @supabase/root to their --projects list.
  • The oxc devDependencies, knip ignores for them, and the oxlint.typeAware package.json channel are removed from every package — the tools are root devDependencies only.
  • Lint/format now also cover previously unchecked surface: tools/, apps/docs, root scripts, docs markdown, and workflow YAML.

🤖 Generated with Claude Code

kanadguptaand others added 3 commits August 24, 2026 01:59
Preparation for enabling `oxlint --type-aware` repo-wide: fix the
findings from the valuable type-aware rules (no-floating-promises,
no-base-to-string, no-redundant-type-constituents,
no-useless-default-assignment, no-duplicate-type-constituents,
require-array-sort-compare), modernize tools/nx-plugins/tsconfig.json
for TypeScript 7 (tsgolint rejects the removed node10 module
resolution), and replace the Function-constructor dynamic import in
test.plugin.ts with a plain import() (Node 24 runs the plugins with
native type stripping, so the transpile workaround is obsolete).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical one-time pass from `oxfmt` at the repo root, covering files
that the per-package targets never reached: docs markdown, workflow
YAML, root and binary-wrapper package manifests, apps/docs, and
tools/release. Generated docs outputs (apps/docs/public,
apps/docs/content/docs/commands) are excluded to stay byte-identical
with their generator.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the per-package nx-inferred lint/format targets with tool-native
configuration at the repo root, so oxlint and oxfmt work standalone
(`pnpm exec oxlint`, `pnpm exec oxfmt`) and the oxc VSCode extension
sees the same rules CI enforces:
- Add root `.oxlintrc.json` (type-aware linting via `options.typeAware`,
ignores, Effect-idiom rule exclusions, a legacy-scoped
`no-base-to-string` override) and `.oxfmtrc.json` (ignores, replacing
apps/cli-e2e/.prettierignore). Type-aware linting is now repo-wide
instead of packages/api-only; the whole-repo run takes ~3.5s.
- Declare `lint:check`/`lint:fix`/`fmt:check`/`fmt:fix` as plain,
uncached command targets on the `@supabase/root` project and delete
oxlint.plugin.ts and oxfmt.plugin.ts. `pnpm check:all`/`fix:all` are
unchanged; each package's `check:all`/`fix:all` adds `@supabase/root`
to its `--projects` list so the repo-wide lint/format checks run
alongside the package-scoped ones.
- Drop the oxfmt/oxlint/oxlint-tsgolint devDependencies, knip ignores,
and the `oxlint.typeAware` package.json channel from every package —
the tools are root devDependencies only.
- Update CONTRIBUTING, AGENTS.md, docs/nx-inference-plugins.md, and
api-package-sync.yml.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…epo-task-runner-alternatives-bb6b48
# Conflicts:
#	CONTRIBUTING.md
#	apps/cli/package.json
#	docs/adr/0013-live-e2e-bypasses-replay-server.md
#	docs/adr/README.md
@kanadgupta
kanadgupta marked this pull request as ready for review August 24, 2026 14:59
@kanadgupta
kanadgupta requested a review from a team as a code ownerAugust 24, 2026 14:59
@github-actions

github-actionsBot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@7b8a1b205f7cb7526e266a342fa2a4a86784f2d5

Preview package for commit 7b8a1b2.

@jgoux
jgoux added this pull request to the merge queueAug 25, 2026
Merged via the queue into develop with commit 4d934c6Aug 25, 2026
16 checks passed
@jgoux
jgoux deleted the kanad-claude/monorepo-task-runner-alternatives-bb6b48 branch August 25, 2026 08:49
Coly010 added a commit that referenced this pull request Aug 25, 2026
…nitialized
CI never hits this (fresh clones leave submodules uninitialized), but any
local tree after `pnpm repos:install` fails the new root targets from
#6311/#6312: oxlint's nested-config discovery loads
.repos/effect/.oxlintrc.json and dies on its uninstalled JS plugin
(ignorePatterns does not gate config discovery — this repo is
single-root-config by design, so disable nested configs), and knip
reports ~1.1k .repos files as unused (submodule contents are invisible
to git status but not to knip's project glob).
pullBot pushed a commit to chizee/cli that referenced this pull request Aug 25, 2026
## What
Stacked on supabase#6311. Applies the same exercise to knip: replaces the
per-package nx-inferred knip targets with knip's native monorepo
support, so `pnpm exec knip-bun` from the repo root just works and knip
gains cross-workspace awareness.
## Why
Same rationale as supabase#6311 — knip configuration lived in per-package
`package.json` `knip` objects wired together by an nx plugin, and
per-package runs couldn't see across workspace boundaries. The root run
immediately proved the point: knip itself flagged ~15 pieces of now-dead
config that the per-package setup required, including every
`ignoreBinaries: ["nx"]` entry (per-package runs couldn't resolve the
root `nx` devDependency; a root run can), four stale
`ignoreDependencies` in `apps/cli`, and `packages/api` entry patterns
its own package.json `exports` already imply. `packages/config` needs no
knip config at all anymore.
## Key changes
- Root `knip.json` using the `workspaces` map, absorbing each package's
former `knip` object; the `--exclude catalogReferences` CLI flag moves
into the config (`exclude`).
- New root-workspace surface configured explicitly: `.github/scripts`
and `tools/release` as entries, `apps/cli-go/**` ignored,
`verdaccio`/`go` ignored (referenced via spawn paths knip cannot trace),
and `apps/docs`'s `mdx-components.tsx` convention entry.
- `knip:check`/`knip:fix` are plain command targets on `@supabase/root`;
`knip.plugin.ts` is deleted; the `knip` devDependency and config object
are removed from every package (root devDependency only).
- `docs/nx-inference-plugins.md` now documents only the remaining
typescript/test/go plugins.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julien Goux <hi@jgoux.dev>
Sign up for freeto 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.

3 participants

@kanadgupta@avallete@jgoux