Repository navigation
feat(lint): make Oxlint own all code lint and run every lint gate at pre-commit - #340
Merged
Merged
Conversation
…e-commit Biome now only formats and orders imports. Oxlint runs native equivalents of Biome's lint rules, a naming plugin for package sources, and the React rules that Biome's React domain never ran here. Pre-commit now runs policy lint, the style check, the suppression ban and the architecture gate, as BulletproofRepository does (ADR 0123, ADR 0124). Refs #336
Biome's React domain ran in apps/web and packages/ui, and its test domain ran under the root package. Add react/no-danger, react/no-children-prop and the jest plugin's no-focused-tests, no-export and no-duplicate-hooks. Match Biome's strength: no-unused-vars checks every argument and catch binding, no-sequences rejects parenthesised commas, and no-empty-function, func-style and no-multi-assign cover the rest of noEmptyBlockStatements, useArrowFunction and noAssignInExpressions. Enable oxc/bad-min-max-func, oxc/approx-constant and oxc/misrefactored-assign-op. Drop the nextjs/google-font-display rule, whose plugin never loaded, and the empty import plugin. The repository has no findings under the new rules.
The naming plugin covered declarations and parameters only. Add object, class and type members, import and export aliases, catch parameters, destructured, defaulted and rest bindings, function and class expression names, index signature parameters and namespaces. Enum members are PascalCase only, a top-level function may be UPPERCASE, static and readonly members may be CONSTANT_CASE, and catch parameters are camelCase. Mirror Biome's exceptions: quoted keys that are not identifiers, shorthand destructured properties, named imports kept under their own name, override members and declarations inside declare module or declare global. A 60-case Oxlint run asserts each visitor against the names Biome 2.5.1 reports on the same source.
Biome's React domain ran six rules in apps/web and packages/ui and its test domain ran three rules under the root package, so ADR 0126 now counts 230 Biome rules, maps the domain rules to their Oxlint replacements and drops the claim that none of the lost rules is a correctness check. Record that noThisInStatic, noImplicitAnyLet and noFlatMapIdentity now run in result sources only, and leave duplicate JSON keys and CSS properties as an open question with two options for the maintainer. State the naming convention's real coverage in CONVENTIONS, the empty-function and caught error rules, and the new pre-commit and lint ownership in QUALITY_GATES, the North Star and an amendment note on ADR 0002.
Oxlint cannot parse JSON or CSS, so with Biome's linter fully off nothing reported a duplicate JSON key or a duplicate CSS property. The maintainer chose to keep Biome's recommended rules for .json, .jsonc and .css files through one biome.json override; every other file stays formatter only. The staged pre-commit step and pnpm check run the override, and the tree has no finding under it. Tests seed a duplicate JSON, JSONC and CSS key and a TypeScript file that Biome must leave alone. ADR 0126, TECH_STACK, QUALITY_GATES, PR_QUALITY, the North Star and the hook label record the exception.
8 tasks done
Contributor
Enforcement sign-offRan at Sunday, the 8th of November, at 11:16 pm on commit This PR changes gated enforcement or product intent, so it needs sign-off.
@BenSheridanEdwards: tick to approve.
|
BenSheridanEdwards
added a commit
that referenced
this pull request
Nov 8, 2026
* feat(test): split present() from unwrap() for outcomes present(value) now fails a test on null or undefined only, and the new unwrap(outcome) takes only a success or failure outcome and fails the test with the failure. The api test unwraps its outcomes with unwrap(), a unit test holds the E2E fixtures copy of present() to the Jest global's behaviour, and policy/test-unwraps-values names the helper that fits. Refs #337 * fix(types): show the test globals to test files alone The web and api programs now exclude test files, and two test programs, tsconfig.test.json and tsconfig.api.test.json, check them with the present() and unwrap() declarations, so a production module that calls either fails pnpm typecheck with TS2304. The showcase inclusion test seeds that call in a web and an api module to prove it. Refs #337 * fix(lint): resolve query reads through scope in one-status-from-hooks one-status-from-hooks now counts only roots bound by a const to useQuery, useSuspenseQuery or useInfiniteQuery, reads the status inside a lookup such as LIST_STATES[list.status] (r7 and r8), and leaves error and isFetching out of the count. It and keep-rejections resolve each name through the scope chain instead of a file-wide map, so a same-named binding in another function no longer decides the result. Fixtures cover r7, r8, the four reviewed false positives and shadowed names. Refs #337 * fix(lint): match only limits written as counts in message-uses-its-limit The rule now considers module constants named as a limit (MAX, MIN, LIMIT, LENGTH and their kin, in snake or camel case) and matches the number only when a word follows it, in plain or grouped form such as 1,000. It skips JSX attribute values and import sources. Fixtures cover a grouped count, JSX text, and the reviewed false positives: COLUMNS with gap-10, ICON_SIZE with a viewBox, MAX_PERCENT with 100%, PORT in a URL and PAGE_SIZE beside "Ages 20 and over". Refs #337 * fix(lint): narrow the two test rules to the shapes they target test-unwraps-values reports an x.ok ternary only when its other branch reads x.value, so response.ok ? 'passed' : 'failed' passes. test-imports-the-type anchors its export pattern to the start of a line, so text in strings and comments no longer counts, and scans each folder once until a module in it changes. Fixtures and a unit test cover both. Refs #337 * refactor(lint): rename the re-export rule to reexport-only-from-index The rule bans every re-export in a slice module, not only types, so its name now says that. It also stops exempting a nested index file: only the slice's own index.ts is a public surface, as no-restricted-imports already holds, so src/routes/todos/components/index.ts fails too. No rebuild had a nested barrel. The ADR, conventions and architecture rows use the new name. Refs #337 * docs(lint): name the sanctioned way to ignore a rejection in ADR 0124 keep-rejections now tells the reader to settle a promise with Promise.allSettled when ignoring its failure is intended, and the ADR and conventions show both forms, which pass lint:policy, lint:anti-slop and Biome. The ADR drops the zero false-positive claim and the note about pre-commit, which PR #340 changes, and records r7 and r8 and the five shapes review found. Refs #337
BenSheridanEdwards
added a commit
that referenced
this pull request
Nov 8, 2026
Bring in #340 (Oxlint owns all code lint; ADRs 0125 and 0126). Conflicts resolved: - oxlint.config.ts: keep the E2E test-unwraps-values override and add the naming and file-name override from main. The six rebuild rules stay in the result-root override; generalRules spreads into the root. - scripts/oxlint-policy.test.ts: take main's policyOnly filter and keep the branch's slop-* fixture prefix. - tooling/trial/inclusion.test.ts: take main's Oxlint file-name test, seeded under routes/todos. - CONVENTIONS.md: take main's naming rows with the to-do examples. - PR_QUALITY.md: keep six typecheck programs; take main's lint wording.
This was referenced Nov 8, 2026
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.
Why does this feature exist?
Two engines linted this repository, so an agent had to know whether Biome or Oxlint owned each concern, and
oxlint.config.tsexcluded 47 React Doctor rules because Biome owned them. ADR 0073 already chose Oxlint for lint and Biome for formatting (tasks T16 and T17); this PR carries that out. Biome ran 230 rules onmain: 219 at the root, 2 naming rules in package sources, and 9 domain rules thatbiome ragedoes not list (6 React domain rules inapps/webandpackages/ui, 3 test domain rules under the root package). Pre-commit also ran only half the lint gates: policy lint, the style check, the suppression ban and the architecture gate waited for push, while BulletproofRepository runs them at commit.Closes #336
What changed?
Above 400 changed lines because moving lint ownership needs the engine config, its tests, the hook and the docs to change together; most of the added lines are the rule table, the naming plugin and their tests.
biome.json:linter.enabledisfalse, with one override that keeps Biome's recommended rules for.json,.jsoncand.cssfiles only, because Oxlint cannot parse them (the maintainer's choice for duplicate JSON keys and CSS properties). Every other file is formatter and import order only.tooling/oxlint-general-rules.ts(new): 170 native Oxlint rules, each naming the Biome rule it replaces, including the React domain rules (react/jsx-key,react/no-array-index-key,react/no-children-prop,react/no-danger,react/no-danger-with-children,react/no-render-return-value) and the test domain rules (jest/no-focused-tests,jest/no-export,jest/no-duplicate-hooks). They match Biome's strength:no-unused-varschecks every argument and caught error,no-sequencesrejects parenthesised commas, andno-empty-function,func-style,no-multi-assign,oxc/bad-min-max-func,oxc/approx-constantandoxc/misrefactored-assign-opare on.oxlint.config.tsspreads it into its root rules, loads thetypescript,jsx-a11y,oxcandjestplugins, and gives package sourcesnaming/naming-conventionandunicorn/filename-case.tooling/oxlint-plugin-naming.js(new): a port of BiomeuseNamingConvention(strict case, ASCII) covering variables, functions, parameters, object, class and type members, import and export aliases, catch parameters, destructured, defaulted and rest bindings, function and class expression names, index signature parameters, namespaces, types and enum members, with Biome's exceptions. A 60-case test runs real Oxlint and matches Biome 2.5.1 case for case.tooling/oxlint-plugin-policy.jsis unchanged..husky/pre-commit: typecheck, staged Biome,lint:policy,lint:styles,lint:anti-slop,check:suppressions,arch:gate,fallow:audit,secret-scan.scripts/required-gates.mjsnames pre-commit as a source for the new steps;docs/required-gates.mdis regenerated.scripts/lint-usage.mjsalso recordslint:policyfindings per attempt.packages/ui/src/Button.tsx: setstype="button"before spreading props, soreact/button-has-typepasses and a caller'stypestill wins.Behavioural Proof (with video and screenshots)
scripts/general-lint.test.ts(every new rule, the React and test domain rules, and Biome's JSON and CSS lint, against the real CLIs),tooling/oxlint-plugin-naming.test.ts(60 real Oxlint cases, one per naming selector and exception),scripts/oxlint-rule-set.test.ts,scripts/lint-usage.test.ts(runs the real hook),scripts/required-gates.test.ts.pnpm e2epasses unchanged.Verification Summary
cade095d27567e53fb511fd67e9531afac75f297cade095d27567e53fb511fd67e9531afac75f297pnpm verify,pnpm e2e):pnpm verify,pnpm e2e, the real pre-commit hook on every commit, the real pre-push hook ongit push,pnpm check:context,pnpm check:docs.pnpm verifypassed (2,977 Jest tests);pnpm e2epassed (15 tests); pre-commit and pre-push passed. The repository has no finding under the 170 general rules, the extended naming rule or the JSON and CSS override. Full pre-commit hook, median of five runs on an M2 Max under load 7 to 10: 12.2 s on a clean tree and 12.5 s with one staged file, of which 3.3 s is the lint-usage recorder in the exit trap. Lint step, median of seven interleaved runs: whole repository 0.95 s before and 0.96 s after; one staged file 1.89 s before and 1.88 s after (ADR 0125 table for every step).useNamingConventionon the 26-case benchmark: Biome flags 18; the plugin before this revision agreed on 7 of 26 (it missed all 18 member, alias, pattern, catch, namespace and enum cases and wrongly flagged adeclare moduleinterface); it now agrees on 26 of 26, and on 60 of 60 in the visitor suite..agents/project/PR_QUALITY.md) satisfied, or each gap named: satisfied, except one proposal for the maintainer, who approvesAGENTS.mdchanges separately: line 18 should readpnpm lint:policy # Oxlint: every code lint rule (general, naming, policy, Tailwind, React hooks, Compiler and Doctor), and thepnpm verifycomment should readbiome format and JSON/CSS lint → oxlintin place ofbiome → oxlint.pnpm verifypnpm e2e.agents/project/ARCHITECTURE.mdandCONVENTIONS.md; new decisions recorded as ADRs.noStringCaseMismatch, is a correctness check) and the HTML rulenoDuplicateAttributesonapps/web/index.html. The 25 CSS rules and the JSON duplicate-key rule keep running in Biome.noThisInStatic,noImplicitAnyLetandnoFlatMapIdentitynow run in result sources only, an accepted loss for scripts and tooling. Four close rules stay off: three need type-aware Oxlint andunicorn/no-useless-undefinedis broader than Biome's rule. The enforcement check reports thebiome.jsonchange as looser, so it needs the approver's sign-off. Follow-up: the lint-usage recorder re-runs staged Biome and both Oxlint configs in the exit trap (3.3 s per attempt); reusing the hook's own output needs JSON output from each step and a.huskychange, so it is left for a separate PR. Rollback: revert this PR; ADR 0126 lists the exact steps.PRD Behaviours to Review
PR Proof Law
.agents/project/PR_QUALITY.mdand.agents/skills/pr-quality-contract/SKILL.md; thePR qualitycheck verifies the proof format.