Conversation
Run Oxlint for all JS/TS/TSX linting, including type-aware rules via oxlint-tsgolint, and reduce ESLint to the three things Oxlint cannot do: `import-x/order`, Markdown, and `package.json`. `eslint-plugin-oxlint` reads `.oxlintrc.json` and turns off every rule Oxlint already covers, so the two stages never disagree. Notes on `.oxlintrc.json`, which is generated from the previous ESLint config with several fixes applied: - `overrides[].files` do not support extglob alternatives such as `@(ts|tsx)`. The migration tool emits `**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)` from eslint-plugin-storybook, which silently matches nothing and leaves every Storybook rule inert (oxc-project/oxc#21525). Brace globs are used instead. - JS plugin specifiers are relative to the repo root. Absolute paths through the pnpm store embed peer-dependency hashes that change on every dependency bump, and bare package names do not resolve for ESM-only plugins. - The architecture guards (`ContextManager`, `CommandManager`, `vscodeProposed.env.remoteAuthority`) are kept via `oxlint-plugin-eslint`'s `no-restricted-syntax`, with two additions that catch numeric operands in JSX `&&` (the case `@eslint-react/no-leaked-conditional-rendering` covered). - The 60 `package-json/*` rules the migration tool generated were dropped: Oxlint only lints source extensions, so they can never run. `packages/ui` keeps its boundary two ways now. `rootDir` in its tsconfig makes a file reaching outside the package a compile error, which is structural and covers cases a lint rule misses. The lint guard stays as defence in depth and needs `"../../../**"` rather than `"../../../*"`, because Oxlint's pattern matching does not implement single-star wildcards. Reducing ESLint to these rules also removes the need to raise `--max-old-space-size`: the full type-aware config needed more than the default heap and aborted with an out-of-memory error. Both that and the default heap limit reproduce on the previous commit. Two `eslint-disable` comments became `oxlint-disable`, since Oxlint now owns `no-console` and `no-explicit-any`. `test/unit/oxlintConfig.test.ts` guards the extglob and plugin-path regressions.
Replace `{value && <Element />}` with ternaries in the four places the
left-hand operand is not provably boolean.
`@eslint-react/no-leaked-conditional-rendering` flagged non-boolean
operands here, but it requires type information, so it cannot run as an
Oxlint JS plugin. It also only reports number, bigint, and NaN operands:
strings and plain booleans are allowed on React 18 and later, so these
four sites were already safe. Making them explicit keeps the intent
obvious and means dropping the rule costs no coverage.
Replace Prettier with Oxfmt for formatting and drop the `--cache` flags, which Oxfmt does not support. `.oxfmtrc.json` comes from `oxfmt --migrate prettier`, which reads `.prettierrc.json` and `.prettierignore` and preserves the verbatim-write exclusions for golden snapshots and generated VS Code themes. The `*.jsonc` override could not be migrated automatically and is written by hand. `printWidth` stays at 80 to match the previous output. `sortImports` is left off: it reorders imports differently from `import-x/order` and is not a drop-in. This reformats 22 files. Both differences are formatting-only, and output is deterministic and idempotent: - Union types are expanded to leading-pipe style. This is a known divergence, oxfmt currently matches Prettier 3.4 rather than 3.9 (oxc-project/oxc#25841). - One `yield` operand in `src/telemetry/export/writers/json.ts` is wrapped in parentheses. Prettier stays a devDependency: Oxfmt delegates Markdown, HTML, YAML, and Vue to it internally, and the residual ESLint config still formats against it.
Use TypeScript 7 for typechecking while keeping the TypeScript 6 API available to typescript-eslint, which refuses to load against TypeScript 7 (its peer range is `>=4.8.4 <6.1.0`, and support is still tracked upstream). Following the official side-by-side guidance: - `typescript` is aliased to `@typescript/typescript6`, which re-exports the 6.0 API that typescript-eslint consumes. Its binary is `tsc6`. - `@typescript/native` is aliased to `typescript@^7`, providing the `tsc` binary used by `pnpm typecheck` and editors. Measured on this repo: typechecking the root config drops from 1701ms to 371ms, and the test config from 3768ms to 903ms. tsgolint already embeds the TypeScript 7 engine, so Oxlint's type-aware rules were already running on it; this brings `pnpm typecheck` onto the same engine. When TypeScript 7 ships an API, drop `@typescript/native` and point `typescript` back at a single version.
The migration tool turned 12 React rules off. `eslint-plugin-react-hooks`'s `disable-conflict-eslint-plugin-react-hooks` preset sets `react-hooks/*` to off because `@eslint-react` ships the same rules; the tool copied those disables across as `react/*`, which is Oxlint's own plugin namespace. The effect was that `@eslint-react`'s rules were disabled and nothing replaced them. Concretely, rules like `rules-of-hooks`, `static-components`, `no-missing-key`, `no-nested-component-definitions` and `web-api-no-leaked-fetch` stopped reporting. A planted conditional hook and a missing list key were caught on the previous commit and silently passed here. Restore them two ways: - Rules Oxlint implements natively are set to the severities the previous config used. - The 52 rules it does not implement are loaded from `@eslint-react` as a JS plugin aliased `react-x`. All 52 were verified to load and report. `no-leaked-conditional-rendering` is the only rule that needs type information, so it cannot run as a JS plugin and stays dropped. `eslint-js/no-useless-assignment` is added since the plugin is already loaded: Oxlint omits the rule, and the JS plugin implements it. Rule coverage per file is now within 4-8 rules of the previous ESLint config, and every remaining difference is accounted for.
Both tools default to one thread per core. Thread startup is a fixed per-thread cost, so on machines with many cores it outweighs the parallelism it buys. Measured on this repo (511 files) on a 128-core machine: | | default | capped | | --- | --- | --- | | oxlint --type-aware | 4.0s | 2.1s | | oxfmt --check | 1.8s | 0.23s | Degradation starts above roughly 32 cores. From 2 to 16 cores the cap makes no measurable difference, because the default already equals it, and CI runners (4 vCPU) detect 4 either way, so this only affects large dev boxes. The value is capped rather than pinned, so smaller machines and CI keep their own optimal thread count instead of being pushed into an oversubscribed one. A fixed number would have made a 2-core machine 1.6x slower. The helper script is run through Node rather than a `$(...)` substitution in the npm scripts, so it behaves identically on Windows. Warm `pnpm lint` drops from 4.5s to 2.9s and `pnpm format:check` from 1.8s to 0.31s. Upstream tracking: oxc-project/oxc#21672.
Tighten the wording added in the oxlint/oxfmt migration: drop em-dashes, trim wordy sentences, and shorten the thread-cap comment in run-oxc.mjs to the load-bearing facts. Fix the TypeScript 7 announcement URL in CONTRIBUTING.md, which was missing the /typescript/ path segment.
- Remove comments from .vscode/settings.json - Condense comments in packages/ui/tsconfig.json and pnpm-workspace.yaml - Use block comments in scripts/run-oxc.mjs - Document why sortPackageJson is disabled in .oxfmtrc.json - Drop ignorePatterns for paths nothing generates (.nyc_output, .claude, pnpm-debug.log) - Remove redundant empty rules object from .oxlintrc.json - Slim test/unit/oxlintConfig.test.ts by inlining single-use helpers - Trim the eslint-plugin-oxlint implementation detail from AGENTS.md
Switch .oxlintrc.json from an explicit 59-rule list to categories.correctness: error, keeping only the 7 rules not in the category. This enables 36 additional rules; fix the 5 findings: - treeTransition.ts: spread on string breaks emoji code points - cliManager.ts: spread on AxiosHeaders loses class prototype - deploymentManager.test.ts, loginCoordinator.test.ts: spread on class in vi.mock drops prototype - localJsonlSink.test.ts: toSorted() without comparator sorts lexicographically Extract the react/react-x override into .oxlintrc.react.json via oxlint extends.
EhabY
marked this pull request as ready for review
September 17, 2026 13:04
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 and why
Move linting to Oxlint and formatting to Oxfmt, keeping a small residual ESLint for what Oxlint cannot do (
import-x/order, Markdown,package.json).Benchmarks
Interleaved A/B against
mainon the same host, minimum of 3–5 rounds, corroborated in CPU time. Negative Δ is faster.pnpm lintcoldpnpm lintat default heappnpm format:checkcoldpnpm typecheck(root + test)pnpm lintwarmReal CI agrees: Lint went from 94s on
mainto 39s here (run 35145079125).The warm regression. Oxlint and Oxfmt have no cache, so warm local lint is genuinely slower than cached ESLint. Two mitigations, both applied or documented:
perf(lint)): both tools default tonprocthreads; above ~32 cores the per-thread startup outweighs the parallelism. Capping at 8 cut oxlint 4.0s→2.1s and oxfmt 1.8s→0.23s on a 128-core box, and is a no-op on CI (4 vCPU) and typical laptops. Upstream: oxc#21672.react-xplugin, inherent to the bridge. Editor latency is unaffected; the Oxc LSP measures 60ms init and <1ms diagnostics ondidChange.Rule coverage
I diffed every rule enabled on
mainagainst the effective rules here, per file, using--print-config. Everything left out is accounted for:@eslint-react/no-leaked-conditional-renderingno-restricted-syntaxselectors cover numeric JSX&&.curlymain:eslint-config-prettierset it to0, so it never ran. Enabling it fresh fails on 69 pre-existing sites, so it stays off rather than blocking this PR.@typescript-eslint/prefer-optional-chainno-undeftsc+ strict mode covers it.import-x/no-unresolvedtscreports TS2307 and runs earlier in CI.import-x/no-relative-packagesrootDir, which is stricter (catches even valid cross-package relative imports).no-dupe-args,no-octalreact-hooks/config,react-hooks/gatingreact-compilersettings and no gating options are configured.no-useless-assignmenteslint-jsplugin.React regression, found and fixed. The migration tool copied
disable-conflict-eslint-plugin-react-hooks'sreact-hooks/*: offentries across asreact/*(Oxlint's own namespace), silently disabling@eslint-reactrules with no replacement.fix(lint)restores the 17 natively-implemented rules at their previous severities and loads the other 52 from@eslint-reactas a JS plugin aliasedreact-x; a probe with a conditional hook, missing key, leaked fetch, and nested component reports the same 5 findings asmain.Upstream workarounds
Both guarded by
test/unit/oxlintConfig.test.ts:**/*.stories.@(ts|tsx|...), leaving every Storybook rule inert. Brace globs instead.Also:
no-restricted-importspatterns understand only**and literal paths, not single*, so the UI guard is"../../../**".Formatting
22 files reformat from exactly two divergence classes, both deterministic and idempotent: union types expand to leading-pipe style (known upstream divergence, oxc#25841) and one
yieldoperand is parenthesised. Prettier stays a devDependency because Oxfmt delegates Markdown/YAML to it internally.TypeScript 7
TS 7 has no programmatic API and
typescript-eslintrefuses to load against it, so they run side-by-side per the official guidance:typescriptaliased to@typescript/typescript6(API,tsc6) and@typescript/nativetotypescript@^7(thetscbinary). This also fixes the default-heap OOM: the full type-aware ESLint config exceeded the default heap, and dropping that config removes the need for--max-old-space-size.Reviewer checklist
import-x/orderis acceptable (the alternative is a 153-filesortImportsreformat)style(format)is formatting-onlytypescript-eslintTS7 supportThis PR was generated by Coder Agents.