Skip to content

chore: use oxfmt and oxlint in 41-x-y - #51443

Merged
MarshallOfSound merged 2 commits into
41-x-yfrom
chore/oxfmt-oxlint--41-x-y
May 2, 2026
Merged

MarshallOfSound merged 2 commits into
41-x-yfrom
chore/oxfmt-oxlint--41-x-y

Conversation

@ckerr

@ckerr ckerr commented May 2, 2026

Copy link
Copy Markdown
Member

Description of Change

Manually backport #50691 to 41-x-y. See that PR for details.
Manually backport #50692 to 41-x-y. See that PR for details.
Partial fix for #51429.

The project's old and new formatting styles are not 100% consistent with each other, so recently we've had several trops/backporrts where a human has to manually check out the backport -> run the formatter -> push up the update. This PR fixes the issue for 41-x-y by copying the oxfmt/oxlint tooling from main.

All reviews welcomed, CC @MarshallOfSound, @nikwen as stakeholders.

Checklist

Release Notes

Notes: none.

Replace ESLint and its plugin ecosystem with oxlint (oxc.rs).
Add oxfmt alongside oxlint for JS/TS formatting and import sorting.

- Consolidate root .eslintrc.json plus 13 nested configs into .oxlintrc.json
- script/lint.js spawns oxlint binary directly instead of ESLint Node API
- Per-process no-restricted-imports rules preserved as oxlintrc overrides
- mocha/no-exclusive-tests replaced by in-repo plugin (no-only-tests.mjs)
- docs ESLint pass replaced by inline node: protocol check in lint.js
- .oxfmtrc.json matching repo style (single quotes, semicolons, 2-space)
- yarn lint:fmt (oxfmt --check) chained into yarn lint
- yarn format (oxfmt --write) for local fixup
- lint-staged runs oxfmt --write on staged JS/TS files

This commit contains only rule/tooling infrastructure changes and is
intended to be cherry-picked to other maintenance branches, where
formatting and lint fixes can be applied separately.

Manual backport of e1af67c698 (#50691) and
3c7fd34f47 (#50692).
@ckerr ckerr added the backport This is a backport PR label May 2, 2026
@ckerr
ckerr requested review from a team as code owners May 2, 2026 00:12
@ckerr
ckerr requested a review from a team as a code owner May 2, 2026 00:12
@ckerr
ckerr marked this pull request as draft May 2, 2026 00:12
@ckerr ckerr changed the title Chore/oxfmt oxlint 41 x y chore: use oxfmt & oxlint in 41-x-y May 2, 2026
@ckerr ckerr changed the title chore: use oxfmt & oxlint in 41-x-y chore: use oxfmt and oxlint in 41-x-y May 2, 2026
@socket-security

socket-security Bot commented May 2, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedoxfmt@​0.42.0901008996100
Addedoxlint@​1.61.0991009196100

View full report

One-time application of the new linting and formatting rules to the
41-x-y codebase:

- yarn format (oxfmt --write) over all JS/TS sources
- oxlint --fix to restore curly braces where oxfmt removed them
- Prefix unused parameters with _ (no-unused-vars)
- Add eslint-disable-next-line comments for intentional patterns:
  - prefer-promise-reject-errors in desktop-capturer.ts
  - no-throw-literal in preload.ts
  - no-only-tests/no-only-tests in spec-helpers.ts
- Restore bare require() in preload-sandbox.js test assertions
  (oxfmt incorrectly converted bare specifiers to node: protocol,
  defeating the equivalence test)

Pure formatting and lint suppression; no behavioral changes.
@ckerr
ckerr force-pushed the chore/oxfmt-oxlint--41-x-y branch from c1d0cc3 to 195291a Compare May 2, 2026 02:46
@ckerr
ckerr marked this pull request as ready for review May 2, 2026 13:30
@MarshallOfSound
MarshallOfSound merged commit 8e548db into 41-x-y May 2, 2026
114 of 115 checks passed
@MarshallOfSound
MarshallOfSound deleted the chore/oxfmt-oxlint--41-x-y branch May 2, 2026 22:22
@release-clerk

release-clerk Bot commented May 2, 2026

Copy link
Copy Markdown

No Release Notes

@ckerr ckerr mentioned this pull request May 5, 2026
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants