Conversation
Add new eslint plugin to enhance linting capabilities with oxlint rules
Add oxlint plugin as recommended in the documentation to enhance linting capabilities
Add oxlint alongside eslint in test:lint and lint scripts for enhanced static analysis
Configure oxlint with a comprehensive set of rules for JavaScript/TypeScript code quality checks
- Add oxc to editor code actions on save - Update oxlint configs to use eslint, typescript, and unicorn presets - Extend ignore patterns in oxlint configuration - Simplify oxlint command in package.json scripts - Add oxlint-tsgolint dependency
- Add src/preload to eslint ignore patterns - Update oxlint env to es2022 and add environment overrides - Adjust several lint rule severities and configurations
…name The linter was changed from ESLint to oxlint, so the directive needs to be updated accordingly.
The error description was incorrectly showing in production and hiding in development. Fix the logic to show detailed errors only in development mode
|
@claude review |
|
Claude finished @EurFelux's task —— View job Code Review: Add oxlint to speed up lintingSummaryThis PR successfully integrates oxlint as a pre-linter to speed up the linting process. The implementation is well-structured and maintains compatibility with the existing eslint setup while providing significant performance improvements (18s → <1s for the entire codebase). ✅ Strengths
🔍 Observations
|
|
Note This comment was translated by Claude. Currently, eslint uses the simple-import-sort plugin, which oxlint has not implemented yet (oxc-project/oxc#7197). If we keep both, it will cause the import order to be different. Original Content目前eslint用了simple-import-sort plugin,oxlint是没有实现的(https://github.com/oxc-project/oxc/discussions/7197), 两个都保留的话,会导致这个import的顺序不一样。 |
|
Note This comment was translated by Claude. Why? If oxlint doesn't have it, won't it just use eslint's instead? There's no conflict either. Original Content
为啥?oxlint没有的话,不是就用eslint的了吗,也没有冲突啊。 |
|
Note This comment was translated by Claude. oxlint has its own sorting rules, so it's also fine to not enable oxlint's own sorting. Original Contentoxlint有自己一套排序的,那就是不要启用oxlint自己的排序也是可以的。 |
|
Note This comment was translated by Claude. I checked and there is an Original Content
看了一下,是有 |
|
Note This comment was translated by Claude. How about we try a complete replacement? If there are rule differences, we can re-lint and format all the code, and from then on use oxlint as the standard. That would be really awesome. Original Content要不就是全部替换看下,如果有规则不一样,直接代码都重新lint和format下,后面都以oxlint为准,这样就真的非常爽了。 |
|
Note This comment was translated by Claude.
If we do a complete replacement, it's best to put lint and format in one PR. After it's done, it will also be easier to update the blame ignore. Original Content
全部替换的话最好把 lint 和 format 放在一个 pr 里面,做完之后也好改 blame ignore |
|
Note This comment was translated by Claude. For example, the exhaustive-deps rule for react hooks - although oxlint will report issues, it reports them in different places. If we want to drop eslint, we'd have to change eslint-disable comments in many places. Also, the auto-fix feature for this rule won't be available, which is quite inconvenient. This rule is mainly what makes me hesitant to replace eslint. I haven't looked closely at other rules yet. Original Content比如react hooks的exhaustive-deps这个规则,oxlint虽然会报告问题,但是报告问题的地方不一样,如果要丢掉eslint的话,就要改特别多地方的eslint-disable的注释。而且这个规则的自动修复功能也用不了,还挺不方便的。主要是这个规则让我不太想替掉eslint,其他规则倒是没有细看过。 |
If eslint isn't completely replaced, the entire linting process cannot be fully accelerated, because eslint still needs to be run again after oxlint. While oxlint allows most issues to be flagged earlier, it doesn't yet support all existing rules. |
GeorgeDong32
left a comment
There was a problem hiding this comment.
我这边测试没啥问题,oxlint能覆盖基础规则尽早发现基础错误也是件好事,虽然现阶段还是要eslint兜底
| // We don't use the React plugin here because its behavior differs slightly from that of ESLint's React plugin. | ||
| "plugins": ["unicorn", "typescript", "oxc", "import"], |
There was a problem hiding this comment.
Looks like 2x issue preventing you from using react plugin.
First being a bug which should be fixed in the next version here: oxc-project/oxc#13815
The second being:
⚠ eslint-plugin-react(no-children-prop): Avoid passing children using a prop.
╭─[src/renderer/src/components/DraggableList/virtual-list.tsx:188:23]
187 │ virtualizer={virtualizer}
188 │ children={children}
· ────────
189 │ disabled={disabled}
╰────
help: The canonical way to pass children in React is to use JSX elements
Which i think you should just disable in your oxlint config as it's not enabled in your eslint config?
Thanks for using oxlint!
There was a problem hiding this comment.
Thank you for following up on this issue! no-children-prop is not a big deal because just few errors here. Once the issue with exhaustive-deps is resolved, we can replace the eslint react plugin with the oxlint React plugin.
There was a problem hiding this comment.
awesome, going to try and do a release today 🤞

What this PR does
Add oxlint to speed up the linting process without replacing eslint.
In my development environment, eslint takes about 18 seconds to lint the entire codebase, whereas oxlint takes less than 1 second. However, despite its remarkable speed, oxlint currently supports a limited set of rules, and some of its rule behaviors differ from their corresponding eslint plugins, making it impossible to fully replace eslint.
yarn test:lintwill run checks using both oxlint and eslint sequentially. By first using oxlint, we can quickly identify and eliminate most issues, throwing errors early on. This significantly improves efficiency, whether in CI or local development.Since eslint has not been completely replaced, it still needs to check every file in the CI environment, resulting in no improvement in runtime. However, because oxlint can provide an extremely fast one-time check, the PR CI will fail more quickly when there are lint errors.
Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Breaking changes
If this PR introduces breaking changes, please describe the changes and the impact on users.
Special notes for your reviewer
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note