Repository navigation
chore: replace ESLint with Oxlint #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import base, { createConfig } from '@metamask/oxlint-config'; | ||
| import commonjs from '@metamask/oxlint-config-commonjs'; | ||
| import nodejs from '@metamask/oxlint-config-nodejs'; | ||
| import typescript from '@metamask/oxlint-config-typescript'; | ||
| import vitest from '@metamask/oxlint-config-vitest'; | ||
|
|
||
| export default createConfig({ | ||
| extends: [base], | ||
|
|
||
| ignorePatterns: ['.yarn/**', 'dist/**', 'lavamoat/**'], | ||
|
|
||
| options: { | ||
| reportUnusedDisableDirectives: 'error', | ||
| typeAware: true, | ||
| }, | ||
|
|
||
| overrides: [ | ||
| { | ||
| files: ['**/*.ts', '**/*.mts', '**/*.cts'], | ||
| extends: [typescript], | ||
| }, | ||
|
|
||
| { | ||
| files: ['**/*.cjs', '**/*.cts'], | ||
| extends: [nodejs, commonjs], | ||
| rules: { | ||
| 'import/unambiguous': 'off', | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| files: ['.github/**', 'yarn.config.cjs', '**/scripts/**'], | ||
| extends: [nodejs], | ||
| }, | ||
|
|
||
| { | ||
| files: ['**/*.test.ts', '**/test/**', '**/tests/**'], | ||
| extends: [nodejs, vitest], | ||
| rules: { | ||
| 'node/no-sync': 'off', | ||
| 'node/no-process-env': 'off', | ||
| }, | ||
| }, | ||
| ], | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,15 +29,15 @@ | |
| "scripts": { | ||
| "build": "tsc --project tsconfig.build.json", | ||
| "build:docs": "typedoc", | ||
| "lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog", | ||
| "lint": "yarn lint:oxlint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog", | ||
| "lint:changelog": "auto-changelog validate --formatter oxfmt", | ||
| "lint:constraints": "yarn constraints", | ||
| "lint:dependencies": "yarn lint:dependencies:depcheck && yarn lint:dependencies:dedupe --check", | ||
| "lint:dependencies:depcheck": "depcheck", | ||
| "lint:dependencies:dedupe": "yarn dedupe", | ||
| "lint:dependencies:fix": "yarn lint:dependencies:depcheck && yarn lint:dependencies:dedupe", | ||
| "lint:eslint": "eslint .", | ||
| "lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies:fix && yarn lint:changelog --fix", | ||
| "lint:oxlint": "oxlint .", | ||
| "lint:fix": "yarn lint:oxlint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies:fix && yarn lint:changelog --fix", | ||
| "lint:misc": "oxfmt --ignore-path .gitignore", | ||
| "prepack": "./scripts/prepack.sh", | ||
| "test": "vitest", | ||
|
|
@@ -47,29 +47,23 @@ | |
| "@lavamoat/allow-scripts": "^5.1.0", | ||
| "@lavamoat/preinstall-always-fail": "^2.0.0", | ||
| "@metamask/auto-changelog": "^6.2.1", | ||
| "@metamask/eslint-config": "^15.0.0", | ||
| "@metamask/eslint-config-nodejs": "^15.0.0", | ||
| "@metamask/eslint-config-typescript": "^15.0.0", | ||
| "@metamask/eslint-config-vitest": "^15.0.0", | ||
| "@metamask/oxlint-config": "^0.1.1", | ||
| "@metamask/oxlint-config-commonjs": "^0.1.1", | ||
| "@metamask/oxlint-config-nodejs": "^0.1.1", | ||
| "@metamask/oxlint-config-typescript": "^0.1.1", | ||
| "@metamask/oxlint-config-vitest": "^0.1.1", | ||
| "@types/node": "^18.18", | ||
| "@typescript-eslint/utils": "^8.6.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused Vitest ESLint plugin remainsLow Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit 5c914cf. Configure here. |
||
| "@typescript/native": "npm:typescript@^7.0.2", | ||
| "@vitest/coverage-istanbul": "^4.1.4", | ||
| "@vitest/eslint-plugin": "^1.1.4", | ||
| "@yarnpkg/types": "^4.0.0-rc.52", | ||
| "depcheck": "^1.4.3", | ||
| "eslint": "^9.11.0", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-import-resolver-typescript": "^3.6.3", | ||
| "eslint-plugin-import-x": "^4.3.0", | ||
| "eslint-plugin-jsdoc": "^50.2.4", | ||
| "eslint-plugin-n": "^17.10.3", | ||
| "eslint-plugin-prettier": "^5.2.1", | ||
| "eslint-plugin-promise": "^7.1.0", | ||
| "eslint-plugin-n": "^18.3.0", | ||
| "oxfmt": "^0.45.0", | ||
| "oxlint": "^1.83.0", | ||
| "oxlint-tsgolint": "^7.0.2002", | ||
| "typedoc": "^0.26.11", | ||
| "typescript": "npm:@typescript/typescript6@^6.0.2", | ||
| "typescript-eslint": "^8.48.1", | ||
| "vite": "^8.0.8", | ||
| "vitest": "^4.1.4" | ||
| }, | ||
|
|
@@ -89,8 +83,7 @@ | |
| "packageManager": "yarn@4.18.0+sha256.fb8b1d20be72a0b544a35bcec4c7ed0ff55a9b173c01f191b02ba164b2051db5", | ||
| "lavamoat": { | ||
| "allowScripts": { | ||
| "@lavamoat/preinstall-always-fail": false, | ||
| "eslint-plugin-import-x>unrs-resolver": false | ||
| "@lavamoat/preinstall-always-fail": false | ||
| } | ||
| }, | ||
| "scriptsConfig": { | ||
|
|
@@ -102,7 +95,7 @@ | |
| "lint:dependencies": "lavamoat/scripts.yarn.json", | ||
| "lint:dependencies:fix": "lavamoat/scripts.yarn.json", | ||
| "lint:dependencies:dedupe": "lavamoat/scripts.yarn.json", | ||
| "lint:eslint": "lavamoat/scripts.lint.json", | ||
| "lint:oxlint": "lavamoat/scripts.lint.json", | ||
| "lint:fix": "lavamoat/scripts.yarn.json", | ||
| "lint:misc": "lavamoat/scripts.lint.json", | ||
| "prepack": "lavamoat/scripts.yarn.json", | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depcheck ignores miss oxlint packages
Medium Severity
The ignore list dropped the
eslint-plugin-*wildcard and never addedoxlint-tsgolint, soeslint-plugin-nandoxlint-tsgolintlook unused to depcheck.yarn lint:dependenciesfails even though both packages are required peers of the oxlint configs.Reviewed by Cursor Bugbot for commit 5c914cf. Configure here.