Repository navigation
chore: migrate from eslint and prettier to oxlint and oxfmt - #315
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
1f3fdcd to
d19483e
Compare
d19483e to
4605b99
Compare
452ec43 to
290b0b6
Compare
|
@SocketSecurity ignore npm/oxfmt@0.72.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. |
| }, | ||
| "tabWidth": 2, | ||
| "trailingComma": "all", | ||
| "ignorePatterns": [".yarnrc.yml"] |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 72497ef. Configure here.
There was a problem hiding this comment.
We do the same in core. not an issue today.
| 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', | ||
| }, | ||
| }; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Weird, that works for the other overrides, no?
But I guess if we're removing it later, it's fine.
72497ef to
b709ec0
Compare
There was a problem hiding this comment.
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).
❌ 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.
| "@yarnpkg/types", | ||
| "prettier-plugin-packagejson", | ||
| "eslint-plugin-n", | ||
| "oxlint-tsgolint", |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit b709ec0. Configure here.
There was a problem hiding this comment.
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.
7fee62c to
67a07e1
Compare
67a07e1 to
3ec7b1d
Compare
3ec7b1d to
aa65f55
Compare


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.jsand.prettierrc.js.package.jsonwireslint/lint:fixthroughlint:oxlintandoxfmt; ESLint-related devDependencies are dropped in favor of oxlint/oxfmt packages. A largeoxlint-suppressions.jsonrecords existing rule violations so CI can pass without fixing everything upfront. Prettier stays as a dependency forauto-changelog/lint:changelog.Most of the diff is oxfmt-driven reformatting (import order, trailing commas, wrapping) across
.githubactions and scripts, with small import-order tweaks in a fewsrcfiles.depcheckrcandtsconfig.jsonare 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.