Skip to content

chore(lint): upgrade oxlint to 1.71 + enable 7 new rules (autofixed backlog) - #6841

Merged
nwparker merged 2 commits into
mainfrom
nwparker/oxlint-update
Jun 30, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/oxlint-update

Conversation

@nwparker

@nwparker nwparker commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Upgrade oxlint 1.67.0 → 1.71.0 and turn on 7 new lint rules mined from the rule catalog and validated against the real Orca tree. The version bump itself is a verified no-op on the existing config — all value is in the newly-enabled rules.

Targeted 1.71 rather than the just-released 1.72 because the repo's .npmrc enforces a 3-day minimum-release-age supply-chain quarantine (1.72.0 shipped today). All 7 rules below exist in 1.71; nothing here needs 1.72.

Rules enabled

error — existing backlog autofixed to zero in this commit (run oxlint --fix, then flip on), so CI stays green:

Rule Sites fixed What it does
unicorn/prefer-node-protocol ~1531 bare builtin imports → node: prefix (completes a half-done migration; disambiguates builtins)
typescript/no-import-type-side-effects ~36 all-inline-type imports → import type (pre-empts a real footgun under verbatimModuleSyntax)
unicorn/no-array-reverse 19 copy-then-reverse() → alias-safe toReversed()

warn — real signal, but current fires are test-only / already-correct, so warn avoids gating CI on correct code:

Rule Fires Why
unicorn/no-array-fill-with-reference-type 3 catches new Array(n).fill({}) aliasing — the bug that silently flips every row in a state array
typescript/no-unsafe-function-type 21 bans bare Function (accepts any args, returns any); all current fires are mocks in one test file
unicorn/prefer-array-flat-map 1 .map(fn).flat() → .flatMap(fn)
unicorn/prefer-regexp-test 1 .match() in boolean context → .test()

mobile/.oxlintrc.json extends the root config, so it inherits all 7; the autofix ran from root and covered mobile/ too.

Why these (and not others)

I empirically scanned every currently-disabled rule against the codebase, read each candidate's docs, and adversarially verified the shortlist against the team's deliberately-curated config. These 7 are the ones that are either safe-autofixable value-adds or clear bug-catchers. High-noise / stylistic rules (no-await-in-loop, prefer-string-replace-all, prefer-single-call, no-console, the full react-perf category, etc.) were rejected — see the "considered but skipped" notes in the PR discussion.

Autofix safety review

The autofix touched 631 files. I verified the semantic-changing rewrites by hand:

  • node: rewrites are AST-only — embedded require('fs') / require('net') string payloads shipped to remote SSH/CLI hosts (agent-status-extension-source.ts, ssh-remote-commands.ts, the payload sections of ssh-relay-deploy.ts / hook-service.ts) were not modified. Only real top-level import/require statements changed.
  • .reverse() → .toReversed() is mutating → non-mutating. I inspected all 19 sites: every one operates on a fresh copy ([...x], .slice(), Array.from(), or a function returning a new array) or a write-once local iterated exactly once — no code relied on in-place mutation.
  • import type consolidation is pure module-syntax; mixed value+type imports were left alone.

Verification (all green)

Gate Result
oxlint --format github (CI's exact cmd) 0 errors (+ 26 warns from the new warn-rules + 1 pre-existing)
mobile self-lint + react-doctor + switch-exhaustiveness configs 0 errors
oxfmt --check on changed files clean
pnpm typecheck (node + cli + web) pass
pnpm test (vitest) 22795 passed, 30 skipped, 0 failed (2217 files)
build:electron-vite + build:web + build:cli all succeed

No functional regressions.

Deferred (intentionally not in this PR)

  • react-perf plugin is loaded but its perf category is off — those rules currently enforce nothing. Separate decision: enable the specific react-perf/* rules at warn (a hard flip is infeasible — jsx-no-new-function-as-prop alone is ~3k prod sites) or drop the plugin. Not bundled here to keep this PR mechanical.
  • unicorn/prefer-import-meta-properties (36) — autofix orphans the now-unused node:url/node:path imports, which no-unused-vars=error then fails on; needs a manual-cleanup PR.
  • unicorn/prefer-export-from (18 w/ checkUsedVariables:false) — suggestion-only; needs --fix-suggestions + pnpm format.

Made with Orca 🐋

nwparker and others added 2 commits June 29, 2026 21:49
Upgrade oxlint 1.67.0 -> 1.71.0 (1.72 was blocked by the repo's 3-day
minimum-release-age supply-chain guard; nothing here needs it). The
bump is a no-op on the existing config.

Enable 3 error rules (backlog autofixed to zero in this commit) and
4 warn rules (surface signal without gating CI):

error (autofixed, behavior-preserving):
- unicorn/prefer-node-protocol        (~1531 sites: bare builtin -> node:)
- typescript/no-import-type-side-effects (~36: all-inline-type -> import type)
- unicorn/no-array-reverse            (19: copy-then-reverse -> toReversed)

warn (real signal, current fires are test-only/correct):
- unicorn/no-array-fill-with-reference-type  (aliasing footgun guard)
- typescript/no-unsafe-function-type         (bans bare Function type)
- unicorn/prefer-array-flat-map              (map().flat() -> flatMap())
- unicorn/prefer-regexp-test                 (.match() in bool ctx -> .test())

mobile/.oxlintrc.json extends root, so it inherits all 7; the autofix
ran from root and covered mobile/ too.

Verification (all green): oxlint 0 errors (root+mobile+aux configs),
oxfmt clean, typecheck (node+cli+web), vitest 22795 passed / 0 failed,
builds (electron-vite + web + cli) succeed. node: rewrites confirmed to
skip embedded SSH/CLI string payloads (AST-only); all toReversed sites
verified to operate on fresh copies or write-once locals.
mobile/ is a standalone pnpm project pinning its own [email protected], which
lacks unicorn/no-array-fill-with-reference-type (needs >=1.70). Since
mobile/.oxlintrc.json extends the root config, mobile CI's 'cd mobile &&
oxlint' failed to parse the new rule. Bump mobile to match root (1.71).

Verified in mobile/: oxlint 0 errors, oxfmt --check clean, tsc --noEmit
pass, vitest 978 passed / 0 failed.

Co-authored-by: Orca <[email protected]>
@nwparker
nwparker merged commit 46646d7 into main Jun 30, 2026
10 checks passed
AmethystLiang added a commit that referenced this pull request Jun 30, 2026
The oxlint 1.71 upgrade (#6841) autofixed these imports to the node:
protocol, which Metro can't resolve in a React Native bundle, breaking
the Android release build ("Unable to resolve module node:buffer").
Revert to the npm 'buffer' polyfill and disable prefer-node-protocol for
the mobile package so the autofix can't reintroduce the regression.

Co-authored-by: Orca <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…acklog) (stablyai#6841)

* chore(lint): upgrade oxlint to 1.71 and enable 7 new rules

Upgrade oxlint 1.67.0 -> 1.71.0 (1.72 was blocked by the repo's 3-day
minimum-release-age supply-chain guard; nothing here needs it). The
bump is a no-op on the existing config.

Enable 3 error rules (backlog autofixed to zero in this commit) and
4 warn rules (surface signal without gating CI):

error (autofixed, behavior-preserving):
- unicorn/prefer-node-protocol        (~1531 sites: bare builtin -> node:)
- typescript/no-import-type-side-effects (~36: all-inline-type -> import type)
- unicorn/no-array-reverse            (19: copy-then-reverse -> toReversed)

warn (real signal, current fires are test-only/correct):
- unicorn/no-array-fill-with-reference-type  (aliasing footgun guard)
- typescript/no-unsafe-function-type         (bans bare Function type)
- unicorn/prefer-array-flat-map              (map().flat() -> flatMap())
- unicorn/prefer-regexp-test                 (.match() in bool ctx -> .test())

mobile/.oxlintrc.json extends root, so it inherits all 7; the autofix
ran from root and covered mobile/ too.

Verification (all green): oxlint 0 errors (root+mobile+aux configs),
oxfmt clean, typecheck (node+cli+web), vitest 22795 passed / 0 failed,
builds (electron-vite + web + cli) succeed. node: rewrites confirmed to
skip embedded SSH/CLI string payloads (AST-only); all toReversed sites
verified to operate on fresh copies or write-once locals.

* chore(lint): bump mobile oxlint to 1.71 so inherited rules parse

mobile/ is a standalone pnpm project pinning its own [email protected], which
lacks unicorn/no-array-fill-with-reference-type (needs >=1.70). Since
mobile/.oxlintrc.json extends the root config, mobile CI's 'cd mobile &&
oxlint' failed to parse the new rule. Bump mobile to match root (1.71).

Verified in mobile/: oxlint 0 errors, oxfmt --check clean, tsc --noEmit
pass, vitest 978 passed / 0 failed.

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
The oxlint 1.71 upgrade (stablyai#6841) autofixed these imports to the node:
protocol, which Metro can't resolve in a React Native bundle, breaking
the Android release build ("Unable to resolve module node:buffer").
Revert to the npm 'buffer' polyfill and disable prefer-node-protocol for
the mobile package so the autofix can't reintroduce the regression.

Co-authored-by: Orca <[email protected]>
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