Skip to content

Commit cdeaf0e

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 every dependency with 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. Keep eslint-plugin-react and read-package-up: both are still runtime dependencies of oxlint's jsPlugins bridge and custom rules, respectively.
1 parent 41a0afe commit cdeaf0e

9 files changed

Lines changed: 13 additions & 909 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
@@ -63,7 +63,6 @@
6363
"@commitlint/config-conventional": "^21.2.0",
6464
"@emotion/cache": "^11.14.0",
6565
"@emotion/react": "^11.14.0",
66-
"@eslint/js": "^9.39.4",
6766
"@instructure/browserslist-config-instui": "workspace:*",
6867
"@instructure/ui-babel-preset": "workspace:*",
6968
"@instructure/ui-scripts": "workspace:*",
@@ -78,7 +77,6 @@
7877
"@vitejs/plugin-react": "^5.2.0",
7978
"@vitest/browser": "4.1.9",
8079
"@vitest/browser-playwright": "4.1.9",
81-
"@vitest/eslint-plugin": "^1.6.20",
8280
"@vitest/ui": "4.1.9",
8381
"babel-loader": "^10.1.1",
8482
"babel-plugin-add-import-extension": "^1.6.0",
@@ -92,15 +90,7 @@
9290
"cz-git": "^1.13.1",
9391
"esbuild": "^0.28.1",
9492
"esbuild-loader": "^4.5.0",
95-
"eslint": "^9.39.4",
96-
"eslint-config-prettier": "^10.1.8",
97-
"eslint-import-resolver-node": "^0.4.0",
98-
"eslint-module-utils": "2.13.0",
99-
"eslint-plugin-compat": "^7.0.2",
100-
"eslint-plugin-jsx-a11y": "^6.10.2",
101-
"eslint-plugin-notice": "^1.0.0",
10293
"eslint-plugin-react": "^7.37.5",
103-
"globals": "^17.7.0",
10494
"husky": "^9.1.7",
10595
"jsdom": "^29.1.1",
10696
"lerna": "9.0.7",
@@ -112,7 +102,6 @@
112102
"react": "18.3.1",
113103
"read-package-up": "^12.0.0",
114104
"typescript": "6.0.3",
115-
"typescript-eslint": "^8.62.1",
116105
"vitest": "^4.1.9",
117106
"vitest-browser-react": "2.2.0",
118107
"webpack": "^5.107.2"
@@ -121,8 +110,6 @@
121110
"scripts": "The '--' at the end of commands is needed so user parameters are passed forward",
122111
"danger": "^11.3.1 -- add this back if we use it in pr-validation.yml",
123112
"tar": "Lerna 8 needs tar for this fixed(?) bug: https://github.com/lerna/lerna/issues/4005",
124-
"eslint-import-resolver-typescript": "^3.6.1 not supported by ESLint 9",
125-
"eslint-plugin-import-x": "^3.1.0 not supported by ESLint 9",
126113
"@types/jest": "needed because https://github.com/testing-library/jest-dom/issues/544 recheck if fixed",
127114
"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'"
128115
},
@@ -138,7 +125,7 @@
138125
},
139126
"lint-staged": {
140127
"*.{js,ts,tsx}": [
141-
"eslint --quiet",
128+
"oxlint -c .oxlintrc.json --fix",
142129
"prettier --write"
143130
],
144131
"*.{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
"yargs": "^18.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)