-
Notifications
You must be signed in to change notification settings - Fork 19
Fully switch to oxlint #2998
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
Fully switch to oxlint #2998
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This reverts commit 135becf.
| "name": "playwright", | ||
| "specifier": "eslint-plugin-playwright" | ||
| } | ||
| // eslint-plugin-react-hook-form won't work — all its rules use context.getScope() |
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.
Is this still the case? I believe getScope() may be implemented on the most recent releases of oxlint? https://github.com/oxc-project/oxc/blob/e9d346f1f219025229013da47386d387823c220e/apps/oxlint/src-js/plugins/scope.ts#L359
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.
Looks like it, though only the access control rule errors like this. The other two don't seem to work, though — at least with the destructuring rule, I see things that should fail but aren't getting caught.
× Error running JS plugin.
│ File path: /Users/david/oxide/console/app/components/form/fields/TlsCertsField.tsx
│ TypeError: context.getScope is not a function
│ at check (/Users/david/oxide/console/node_modules/eslint-plugin-react-hook-form/lib/rules/no-access-control.js:43:12)
│ at file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:20177:17
│ at walkVariableDeclarator (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:18336:70)
│ at walkNode (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:17746:4)
│ at walkNode (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:17467:33)
│ at walkVariableDeclaration (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:18332:109)
│ at walkNode (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:17743:4)
│ at walkNode (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:17467:33)
│ at walkBlockStatement (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:18108:109)
│ at walkNode (file:///Users/david/oxide/console/node_modules/oxlint/dist/lint.js:17575:4)
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.
Warnings/errors aren't integrated into the editor extension yet for JS plugin violations, just in case you're expecting those to show up.
Otherwise, may be worth opening an issue in the oxc repo about this particular plugin having problems so they can be investigated. 🙇♂️
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.
Thanks, putting it on my todo list.
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.
While putting together a repro at https://github.com/david-crespo/oxlint-rhf-plugin-repro, Claude notes:
Note: Had to use ESLint 8.57.1 because
eslint-plugin-react-hook-formalso usescontext.getScope()which was removed in ESLint 9 (replaced withsourceCode.getScope()). The plugin itself needs updating for ESLint 9 compatibility.
This could explain the above.
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.
@david-crespo Looks like that is planned for support, though it won't be until late next month at the absolute earliest: oxc-project/oxc#17130
Reach out if you run into any other problems!
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.
Thank you! Subscribed to that issue.
oxidecomputer/console@e8b79c3...a5fc417 * [a5fc417d](oxidecomputer/console@a5fc417d) oxidecomputer/console#2984 * [8009ce4d](oxidecomputer/console@8009ce4d) oxidecomputer/console#2998 * [c7c2278e](oxidecomputer/console@c7c2278e) oxidecomputer/console#2997 * [be1cfc63](oxidecomputer/console@be1cfc63) oxidecomputer/console#2989 * [b1fba783](oxidecomputer/console@b1fba783) oxidecomputer/console#2992 * [08d801f0](oxidecomputer/console@08d801f0) oxidecomputer/console#2995 * [46a6b5ef](oxidecomputer/console@46a6b5ef) oxidecomputer/console#2996 * [43df666b](oxidecomputer/console@43df666b) oxidecomputer/console#2994 * [4b1a7569](oxidecomputer/console@4b1a7569) oxidecomputer/console#2993 * [867e4dae](oxidecomputer/console@867e4dae) oxidecomputer/console#2991 * [ff400c34](oxidecomputer/console@ff400c34) oxidecomputer/console#2988
Oxlint runs in 800ms without caching. Eslint runs in 14 seconds without caching, 600ms with a warm cache and no changes. So Oxlint without caching is about the same as eslint with caching.
We've been running both eslint and oxlint for a while. Now that oxlint supports type-aware rules and JS plugins, I think it's time to drop eslint. The playwright plugin runs via oxlint's experimental JS plugin support. We do lose
eslint-plugin-react-hook-formfor now because all 3 rules usecontext.getScope(), which oxlint doesn't support yet. I'll make an issue to add it back when it's supported.