Skip to content

chore: migrate from eslint and prettier to oxlint and oxfmt - #315

Merged
cryptodev-2s merged 10 commits into
chore/upgrade-yarnfrom
chore/migrate-to-oxlint
Nov 17, 2026
Merged

cryptodev-2s merged 10 commits into
chore/upgrade-yarnfrom
chore/migrate-to-oxlint

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Replaces eslint and prettier with oxlint and oxfmt using the MetaMask oxlint configs and core's formatter settings (prettier stays as a dependency because the release changelog action formats through auto-changelog with it), with existing violations recorded in a suppressions file.


Note

Low Risk
Tooling and formatting-only changes; workflow script behavior is unchanged aside from style. Prettier remains for changelog validation.

Overview
Replaces ESLint and Prettier with oxlint and oxfmt as the repo’s primary lint/format stack. Adds oxlint.config.mts (MetaMask oxlint presets, TypeScript-aware linting, and overrides for .github/** and tests), .oxfmtrc.json (import sorting and package.json formatting), and removes .eslintrc.js and .prettierrc.js.

package.json wires lint / lint:fix through lint:oxlint and oxfmt; ESLint-related devDependencies are dropped in favor of oxlint/oxfmt packages. A large oxlint-suppressions.json records existing rule violations so CI can pass without fixing everything upfront. Prettier stays as a dependency for auto-changelog / lint:changelog.

Most of the diff is oxfmt-driven reformatting (import order, trailing commas, wrapping) across .github actions and scripts, with small import-order tweaks in a few src files. depcheckrc and tsconfig.json are updated for the new tooling.

Reviewed by Cursor Bugbot for commit aa65f55. Bugbot is set up for automated code reviews on this repo. Configure here.

@cryptodev-2s
cryptodev-2s added this pull request to stack #319 November 11, 2026 21:12
@socket-security

socket-security Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Network access: npm eslint-plugin-n in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/eslint-plugin-n@18.5.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/eslint-plugin-n@18.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
Potential code anomaly (AI signal): npm graceful-fs is 68.0% likely to have a medium risk anomaly

Notes: The fragment is a legitimate Graceful FS implementation designed to gracefully handle EMFILE/ENFILE errors by queuing and retrying I/O operations. It coordinates across multiple instances via a shared queue and patches core fs APIs accordingly. Primary risks are complexity and potential unintended interactions in large apps due to global patches, not malicious activity or data exfiltration.

Confidence: 0.68

Severity: 0.50

From: package.json → npm/eslint-plugin-n@18.5.0 → npm/@swc/cli@0.1.62 → npm/@types/jest@28.1.7 → npm/unzipper@0.12.3 → npm/jest@28.1.3 → npm/depcheck@1.4.3 → npm/ts-jest@28.0.8 → npm/@lavamoat/allow-scripts@2.3.1 → npm/graceful-fs@4.2.12

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/graceful-fs@4.2.12. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
Potential code anomaly (AI signal): npm tapable is 62.0% likely to have a medium risk anomaly

Notes: No overt malicious behavior (no IO, network, filesystem, credential access, or persistence) is present in this fragment. The main security concern is that it uses runtime code generation (new Function) and emits executable JavaScript assembled from options-driven metadata (args/taps/interceptors). If these configuration fields or any emitted expressions are attacker-influenced, it can enable arbitrary code execution in the host. Even with safe codegen, executing provided taps/interceptors means malicious plugins can run arbitrary code with the caller’s privileges.

Confidence: 0.62

Severity: 0.56

From: package.json → npm/eslint-plugin-n@18.5.0 → npm/tapable@2.3.3

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tapable@2.3.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

Ignoring alerts on:

  • oxfmt@0.72.0
  • tinypool@2.2.0

View full report

@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch 3 times, most recently from 1f3fdcd to d19483e Compare November 12, 2026 10:25
@cryptodev-2s
cryptodev-2s marked this pull request as ready for review November 12, 2026 10:26
@cryptodev-2s cryptodev-2s self-assigned this Nov 12, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread oxlint.config.mts Resolved
@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch from d19483e to 4605b99 Compare November 12, 2026 10:33
@cryptodev-2s cryptodev-2s changed the title chore: migrate from eslint to oxlint chore: migrate from eslint and prettier to oxlint and oxfmt Nov 12, 2026
@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch 2 times, most recently from 452ec43 to 290b0b6 Compare November 16, 2026 10:11

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread package.json Resolved
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/oxfmt@0.72.0
@SocketSecurity ignore npm/tinypool@2.2.0

oxfmt is the oxc formatter (MIT) and we already use it in other repos. It pulls in tinypool, and the child_process use there is how it forks its worker processes.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .oxfmtrc.json Outdated
},
"tabWidth": 2,
"trailingComma": "all",
"ignorePatterns": [".yarnrc.yml"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yarn vendor files no longer ignored

High Severity

Dropping .yarn/** from ignorePatterns leaves committed Yarn vendor files eligible for formatting. .gitignore un-ignores .yarn/releases and .yarn/plugins, and oxfmt formats .cjs natively, so lint:misc can rewrite the Yarn binary and plugins that oxlint still excludes.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 72497ef. Configure here.

@cryptodev-2s cryptodev-2s Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do the same in core. not an issue today.

Comment thread oxlint.config.mts
Comment on lines +7 to +19
type Override = NonNullable<
Parameters<typeof createConfig>[0]['overrides']
>[number];

const nodeTestOverride: Override = {
files: ['.github/scripts/**/*.test.mts'],
extends: [nodejs, vitest],
rules: {
// The top level `test()` calls of the `node:test` tests return promises
// that the test runner tracks, so they are not floating.
'typescript/no-floating-promises': 'off',
},
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined failed with TS2322 on the array: Types of property 'concat' are incompatible … Property 'extends' is missing in type 'OxlintOverride'.
Work around will be removed in https://github.com/MetaMask/github-tools/pull/317/changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, that works for the other overrides, no?

But I guess if we're removing it later, it's fine.

@cryptodev-2s
cryptodev-2s removed this pull request from stack #319 November 16, 2026 13:59
@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch from 72497ef to b709ec0 Compare November 16, 2026 14:00
@cryptodev-2s
cryptodev-2s added this pull request to stack #329 November 16, 2026 14:00

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b709ec0. Configure here.

Comment thread .depcheckrc.json
"@yarnpkg/types",
"prettier-plugin-packagejson",
"eslint-plugin-n",
"oxlint-tsgolint",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier unused by depcheck

Medium Severity

prettier stays a runtime dependency for auto-changelog --prettier, but lint:misc no longer invokes the prettier binary and .prettierrc.js is gone. depcheck therefore treats prettier as unused, so yarn lint:dependencies --check fails. eslint-plugin-n and oxlint-tsgolint were added to .depcheckrc.json ignores for the same kind of indirect use, but prettier was not.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b709ec0. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this, depcheck doesn't flag it. It counts prettier as used because it's a peer dependency of auto changelog, which the changelog check script imports, so lint:dependencies passes.

Mrtenz
Mrtenz previously approved these changes Nov 16, 2026
@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch 2 times, most recently from 7fee62c to 67a07e1 Compare November 17, 2026 09:07
@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch from 67a07e1 to 3ec7b1d Compare November 17, 2026 09:46
@cryptodev-2s
cryptodev-2s requested a review from Mrtenz November 17, 2026 09:48
@cryptodev-2s
cryptodev-2s force-pushed the chore/migrate-to-oxlint branch from 3ec7b1d to aa65f55 Compare November 17, 2026 10:27
@cryptodev-2s
cryptodev-2s merged commit 3386a1d into main Nov 17, 2026
17 checks passed
@cryptodev-2s
cryptodev-2s deleted the chore/migrate-to-oxlint branch November 17, 2026 12:10
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.

2 participants