Skip to content

Commit 1607b8a

Browse files
committed
feat: replace ESLint with oxlint across the workspace
Wire oxlint into lint-staged, ui-scripts lint, and regression-test's lint script, replacing ESLint everywhere it ran. Remove ESLint's config files, its now-superseded custom plugin, and dependencies that have no remaining consumer: eslint, @eslint/js, @vitest/eslint-plugin, eslint-config-prettier, eslint-import-resolver-node, eslint-module-utils, eslint-plugin-compat, eslint-plugin-jsx-a11y, eslint-plugin-notice, globals, and typescript-eslint. eslint-plugin-react and read-package-up are kept - both are still runtime dependencies of oxlint's jsPlugins bridge and custom rules, respectively.
1 parent e9b856e commit 1607b8a

9 files changed

Lines changed: 13 additions & 955 deletions

File tree

eslint.config.mjs

Lines changed: 0 additions & 230 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@commitlint/config-conventional": "^21.2.0",
6060
"@emotion/cache": "^11.14.0",
6161
"@emotion/react": "^11.14.0",
62-
"@eslint/js": "^9.39.4",
6362
"@instructure/browserslist-config-instui": "workspace:*",
6463
"@instructure/ui-babel-preset": "workspace:*",
6564
"@instructure/ui-scripts": "workspace:*",
@@ -72,7 +71,6 @@
7271
"@types/react": "18.3.26",
7372
"@types/react-dom": "18.3.1",
7473
"@vitejs/plugin-react": "^5.2.0",
75-
"@vitest/eslint-plugin": "^1.6.20",
7674
"babel-loader": "^10.1.1",
7775
"babel-plugin-add-import-extension": "^1.6.0",
7876
"chai": "^4.4.1",
@@ -85,15 +83,7 @@
8583
"cz-git": "^1.13.1",
8684
"esbuild": "^0.28.1",
8785
"esbuild-loader": "^4.5.0",
88-
"eslint": "^9.39.4",
89-
"eslint-config-prettier": "^10.1.8",
90-
"eslint-import-resolver-node": "^0.4.0",
91-
"eslint-module-utils": "2.13.0",
92-
"eslint-plugin-compat": "^7.0.2",
93-
"eslint-plugin-jsx-a11y": "^6.10.2",
94-
"eslint-plugin-notice": "^1.0.0",
9586
"eslint-plugin-react": "^7.37.5",
96-
"globals": "^17.7.0",
9787
"husky": "^9.1.7",
9888
"jsdom": "^29.1.1",
9989
"lerna": "9.0.7",
@@ -103,16 +93,13 @@
10393
"react": "18.3.1",
10494
"read-package-up": "^12.0.0",
10595
"typescript": "6.0.3",
106-
"typescript-eslint": "^8.62.1",
10796
"vitest": "^4.1.9",
10897
"webpack": "^5.107.2"
10998
},
11099
"//dependency-comments": {
111100
"scripts": "The '--' at the end of commands is needed so user parameters are passed forward",
112101
"danger": "^11.3.1 -- add this back if we use it in pr-validation.yml",
113102
"tar": "Lerna 8 needs tar for this fixed(?) bug: https://github.com/lerna/lerna/issues/4005",
114-
"eslint-import-resolver-typescript": "^3.6.1 not supported by ESLint 9",
115-
"eslint-plugin-import-x": "^3.1.0 not supported by ESLint 9",
116103
"@types/jest": "needed because https://github.com/testing-library/jest-dom/issues/544 recheck if fixed",
117104
"git-raw-commits>dargs": "Force dargs@7.0.0 (CommonJS) for git-raw-commits@3.0.0 used by lerna. pnpm hoisting was causing ESM dargs@8.1.0 to be resolved instead, breaking 'pnpm run bump' with 'TypeError: dargs is not a function'"
118105
},
@@ -128,7 +115,7 @@
128115
},
129116
"lint-staged": {
130117
"*.{js,ts,tsx}": [
131-
"eslint --quiet",
118+
"oxlint -c .oxlintrc.json --fix",
132119
"prettier --write"
133120
],
134121
"*.{json,jsx,md,mdx,html}": [

packages/ui-scripts/lib/__node_tests__/lint.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('lint handler', () => {
4040

4141
it('lints "." when no positional paths are provided', async () => {
4242
await lint.handler({ _: ['lint'] })
43-
expect(runMock).toHaveBeenCalledWith('eslint', ['.'])
43+
expect(runMock).toHaveBeenCalledWith('oxlint', ['.'])
4444
})
4545

4646
it('keeps only .js, .jsx, .ts, .tsx paths', async () => {
@@ -56,23 +56,23 @@ describe('lint handler', () => {
5656
expect(runMock).not.toHaveBeenCalled()
5757
})
5858

59-
it('passes --fix to eslint when argv.fix is true', async () => {
59+
it('passes --fix to oxlint when argv.fix is true', async () => {
6060
await lint.handler({ _: ['lint', 'a.ts'], fix: true })
61-
expect(runMock).toHaveBeenCalledWith('eslint', ['a.ts', '--fix'])
61+
expect(runMock).toHaveBeenCalledWith('oxlint', ['a.ts', '--fix'])
6262
})
6363

6464
it('does not pass --fix when argv.fix is false', async () => {
6565
await lint.handler({ _: ['lint', 'a.ts'], fix: false })
66-
expect(runMock).toHaveBeenCalledWith('eslint', ['a.ts'])
66+
expect(runMock).toHaveBeenCalledWith('oxlint', ['a.ts'])
6767
})
6868

6969
it('does not pass --fix when argv.fix is undefined', async () => {
7070
await lint.handler({ _: ['lint', 'a.ts'] })
71-
expect(runMock).toHaveBeenCalledWith('eslint', ['a.ts'])
71+
expect(runMock).toHaveBeenCalledWith('oxlint', ['a.ts'])
7272
})
7373

7474
it('appends --fix even when linting the default "." path', async () => {
7575
await lint.handler({ _: ['lint'], fix: true })
76-
expect(runMock).toHaveBeenCalledWith('eslint', ['.', '--fix'])
76+
expect(runMock).toHaveBeenCalledWith('oxlint', ['.', '--fix'])
7777
})
7878
})

packages/ui-scripts/lib/commands/lint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
)
4444
}
4545
if (jspaths.length) {
46-
runCommandSync('eslint', argv.fix ? [...jspaths, '--fix'] : jspaths)
46+
runCommandSync('oxlint', argv.fix ? [...jspaths, '--fix'] : jspaths)
4747
}
4848
}
4949
}

packages/ui-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"read-package-up": "^12.0.0"
4141
},
4242
"peerDependencies": {
43-
"eslint": "^9",
43+
"oxlint": "^1.72.0",
4444
"react": ">=18 <=19",
4545
"webpack": "^5"
4646
},

0 commit comments

Comments
 (0)