Skip to content

Commit 8009ce4

Browse files
authored
Fully switch to oxlint (#2998)
* upgrade oxlint * use playwright plugin in oxlint * drop eslint * explicit format check for CI * test format check fail in CI * Revert "test format check fail in CI" This reverts commit 135becf. * update vscode suggestions * oxlint 1.36 and fix new errors
1 parent c7c2278 commit 8009ce4

File tree

10 files changed

+312
-3088
lines changed

10 files changed

+312
-3088
lines changed

.github/workflows/lintBuildTest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
run: npx tsc
4545
- name: Lint
4646
run: npm run lint
47+
- name: Check formatting
48+
run: npm run fmt:check
4749
- name: Test
4850
run: npm test run
4951
- name: Build

.oxlintrc.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"jsPlugins": [
4+
{
5+
"name": "playwright",
6+
"specifier": "eslint-plugin-playwright"
7+
}
8+
// eslint-plugin-react-hook-form won't work — all its rules use context.getScope()
9+
],
310
"plugins": [
411
"import",
512
"react",
613
"jsx-a11y",
714
"promise",
815
// defaults (see https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins)
16+
"eslint",
917
"unicorn",
1018
"typescript",
1119
"oxc"
@@ -74,7 +82,19 @@
7482
// catch unawaited Playwright calls in e2e tests
7583
"files": ["test/e2e/**/*.ts"],
7684
"rules": {
77-
"@typescript-eslint/no-floating-promises": "error"
85+
"@typescript-eslint/no-floating-promises": "error",
86+
"playwright/expect-expect": [
87+
"warn",
88+
{
89+
"assertFunctionNames": [
90+
"expectVisible",
91+
"expectRowVisible",
92+
"expectOptions",
93+
"expectRowMenuStaysOpen"
94+
]
95+
}
96+
],
97+
"playwright/no-force-option": "off"
7898
}
7999
}
80100
],

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint",
3+
"oxc.oxc-vscode",
44
"esbenp.prettier-vscode",
55
"bradlc.vscode-tailwindcss"
66
]

.vscode/settings.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
{
22
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
33
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
4-
"[javascript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" },
5-
"[javascriptreact]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" },
6-
"[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" },
7-
"[typescriptreact]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" },
4+
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
5+
"[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
6+
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
7+
"[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
88
"typescript.tsdk": "node_modules/typescript/lib",
99
"editor.formatOnSave": true,
10-
"eslint.format.enable": true,
1110
"tailwindCSS.experimental.classRegex": ["classed.[a-z]+`([^`]*)`"],
1211
"css.customData": ["./.vscode/css.json"],
1312
"explorer.fileNesting.enabled": true,
1413
"explorer.fileNesting.expand": false,
1514
"explorer.fileNesting.patterns": {
1615
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
17-
"package.json": "package-lock.json, .babelrc, .editorconfig, .eslint*, .figma*, .github*, .huskyrc*, plopfile*, .prettier*, .vscode*, playwright.config.*, prettier*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts, mockServiceWorker.js, vercel.json, .licenserc.yaml, LICENSE"
16+
"package.json": "package-lock.json, .babelrc, .editorconfig, .figma*, .github*, .huskyrc*, plopfile*, .oxlintrc*, .prettier*, .vscode*, playwright.config.*, prettier*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts, mockServiceWorker.js, vercel.json, .licenserc.yaml, LICENSE"
1817
},
1918
"vite.browserType": "system",
2019
"vite.buildCommand": "npm run build",

app/components/form/fields/RadioField.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export function RadioField<
8080
</div>
8181
<RadioGroup
8282
defaultChecked={field.value}
83+
// oxlint-disable-next-line jsx-a11y/aria-proptypes -- https://github.com/oxc-project/oxc/issues/17465
8384
aria-labelledby={`${id}-label`}
8485
onChange={(e) =>
8586
parseValue ? field.onChange(parseValue(e.target.value)) : field.onChange(e)

app/components/form/fields/TextField.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export const TextFieldInner = <
117117
title={label}
118118
type={type}
119119
error={!!error}
120+
// oxlint-disable-next-line jsx-a11y/aria-proptypes -- https://github.com/oxc-project/oxc/issues/17465
120121
aria-labelledby={`${id}-label ${id}-help-text`}
121122
onChange={(e) => onChange(transform ? transform(e.target.value) : e.target.value)}
122123
{...fieldRest}

app/table/cells/BooleanCell.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* Copyright Oxide Computer Company
77
*/
88

9-
/* eslint-disable jsx-a11y/aria-proptypes */
109
// there seems to be a bug in the linter. it doesn't want you to use the string
1110
// "true" because it insists it's a boolean
1211
import { Disabled12Icon, Success12Icon } from '@oxide/design-system/icons/react'

eslint.config.ts

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

0 commit comments

Comments
 (0)