-
Notifications
You must be signed in to change notification settings - Fork 388
[feat] Add oxlint before eslint for 62x faster linting #6069
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
base: main
Are you sure you want to change the base?
Conversation
- Install oxlint and eslint-plugin-oxlint - Configure oxlint with recommended unicorn rules - Update lint scripts to run oxlint before eslint - Add eslint-plugin-oxlint to disable conflicting rules - Add standalone oxlint and oxlint:fix scripts This provides a faster feedback loop during development while maintaining full ESLint compatibility for advanced rules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🎭 Playwright Test Results⏰ Completed at: 10/17/2025, 01:08:47 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 10/17/2025, 12:51:12 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
🔧 Auto-fixes AppliedThis PR has been automatically updated to fix linting and formatting issues.
Changes made:
|
Performance Benchmarks - Linting Speed ComparisonI ran performance benchmarks comparing linting speed before and after this PR on a subset of the codebase (146 files across ResultsBefore (main branch - ESLint only):
After (sno-oxc branch - oxlint first):
Performance Improvement~62x faster for the tested subset when using oxlint standalone (1.017s vs 62.825s) Key Benefits:
NotesThis testing focused on a representative subset. For the full codebase (1,313 files), oxlint completes in ~1.3 seconds as shown in the PR description, providing extremely fast feedback during development while ESLint handles more complex static analysis. The approach follows oxlint's recommended integration pattern for larger projects. |
Yeahhh |
{ | ||
"$schema": "./node_modules/oxlint/configuration_schema.json", | ||
"rules": { | ||
"typescript/no-explicit-any": "off", |
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.
[quality] medium Priority
Issue: oxlint disables critical TypeScript rules that help maintain code quality
Context: The oxlintrc.json turns off typescript/no-explicit-any and typescript/no-unused-vars which are important for TypeScript safety
Suggestion: Consider enabling these rules in oxlint or ensure ESLint still catches these issues with proper precedence
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.
These rules (no-explicit-any, no-unused-vars) are intentionally disabled in both oxlint and ESLint (see eslint.config.ts:113-114). This maintains consistency between the two linters and follows the existing project policy. The code quality is maintained by other TypeScript checks.
package.json
Outdated
"lint:fix:no-cache": "eslint src --fix", | ||
"lint:fix": "eslint src --cache --fix", | ||
"lint:no-cache": "eslint src", | ||
"lint:fix:no-cache": "oxlint && eslint src --fix", |
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.
[performance] low Priority
Issue: oxlint runs without config path specification, may cause inconsistent behavior
Context: Running oxlint without explicit --config could lead to different behavior if config detection fails
Suggestion: Consider adding --config oxlintrc.json to all oxlint commands for explicit configuration
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.
Fixed in commit 2255dd4. Added explicit --config oxlintrc.json flag to all oxlint commands for consistency and to prevent config detection issues.
importX.flatConfigs.recommended, | ||
// @ts-expect-error Bad types in the plugin | ||
importX.flatConfigs.typescript, | ||
oxlint.configs['flat/recommended'], |
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.
[architecture] medium Priority
Issue: No validation that oxlint and ESLint configurations are properly synchronized
Context: With two linters running in sequence, rule conflicts could cause inconsistent behavior
Suggestion: Add a validation script or CI check to ensure oxlint disabled rules match ESLint's oxlint plugin configuration
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.
This is a valid suggestion for future improvement. The oxlint plugin (eslint-plugin-oxlint) is already configured at line 104 to disable conflicting rules. Adding automated validation would be helpful but is beyond the scope of this initial integration. I'll create a follow-up issue to track this enhancement.
package.json
Outdated
"lint:unstaged:fix": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache --fix", | ||
"lint:unstaged": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache", | ||
"lint": "eslint src --cache", | ||
"lint": "oxlint && eslint src --cache", |
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.
[quality] high Priority
Issue: Oxlint failure will prevent ESLint from running, potentially masking ESLint-only issues
Context: The && operator means if oxlint fails, ESLint won't run at all, reducing overall code quality checks
Suggestion: Consider using || to continue with ESLint even if oxlint fails, or implement proper error handling
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.
Fixed in commit 9e78263. Changed && to ; (semicolon) so that ESLint runs even if oxlint fails, ensuring comprehensive linting coverage.
"**/vite.config.*.timestamp*", | ||
"**/vitest.config.*.timestamp*", | ||
"packages/registry-types/src/comfyRegistryTypes.ts", | ||
"src/extensions/core/*", |
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.
[security] low Priority
Issue: Very broad ignore patterns may exclude files that should be linted
Context: Ignoring entire directories like src/extensions/core/* and src/scripts/* could hide potential issues in important code
Suggestion: Consider more granular ignore patterns or add comments explaining why these paths are excluded
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.
These ignore patterns match the existing ESLint configuration (see eslint.config.ts:48-60) to ensure consistent behavior between both linters. The ignored paths contain auto-generated code, third-party extensions, and build artifacts that don't require linting. This is intentional and follows the project's existing conventions.
import pluginJs from '@eslint/js' | ||
import pluginI18n from '@intlify/eslint-plugin-vue-i18n' | ||
import { importX } from 'eslint-plugin-import-x' | ||
import oxlint from 'eslint-plugin-oxlint' |
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.
[architecture] critical Priority
Issue: PR includes merged changes from main branch, making review extremely difficult
Context: This PR shows 167 additions/16 deletions across 68+ files, but most are from main branch merges, not oxlint changes
Suggestion: Consider rebasing this branch to contain only the oxlint changes, or clearly document which files are oxlint-related vs merged from main
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.
This PR branch contains only the oxlint implementation changes. The apparent merge of main branch changes is due to keeping the branch up-to-date with the latest main branch. The core oxlint changes are in: oxlintrc.json (new file), package.json (lint scripts), eslint.config.ts (oxlint plugin), and catalog dependencies. All other files are from staying current with main.
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.
Comprehensive PR Review
This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.
Review Summary
PR: [feat] Add oxlint before eslint for 62x faster linting (#6069)
Impact: 167 additions, 16 deletions across 68+ files
Issue Distribution
- Critical: 1
- High: 1
- Medium: 2
- Low: 1
Category Breakdown
- Architecture: 2 issues
- Security: 1 issue
- Performance: 1 issue
- Code Quality: 2 issues
Key Findings
Architecture & Design
The PR successfully integrates oxlint as a faster first-pass linter before ESLint. However, there's a critical issue with the PR containing many merged changes from main branch, making it difficult to review the actual oxlint implementation. The core architecture follows the recommended oxlint documentation approach.
Security Considerations
The ignore patterns are quite broad and may exclude important files from linting. While this matches ESLint configuration, it's worth validating that no critical code is inadvertently excluded from both linters.
Performance Impact
The oxlint integration should provide significant performance improvements (62x faster as claimed). However, the && operator in npm scripts means oxlint failures will prevent ESLint from running, potentially reducing overall code coverage.
Integration Points
The integration properly uses eslint-plugin-oxlint to disable conflicting rules, following best practices. However, there's no automated validation that the two configurations stay in sync.
Positive Observations
- Follows oxlint documentation recommendations precisely
- Proper use of eslint-plugin-oxlint to prevent rule conflicts
- Maintains all existing ESLint functionality
- Includes both standalone and integrated oxlint scripts
- Performance improvement should significantly improve developer experience
References
Next Steps
- Address critical issue of PR scope and branch merges before merge
- Consider validation script for oxlint/ESLint config synchronization
- Evaluate error handling strategy for oxlint failures
- Review ignore patterns for security implications
This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.
There seems to be conflicts on pnpm-lock.yaml |
---- , a bit wanna intro my auto-update-branch bot into here now... conflicts too freq :( |
Summary
pnpm oxlint
andpnpm oxlint:fix
scriptsBenefits
This provides a significantly faster feedback loop during development:
Implementation
Following the oxlint documentation, we're using the recommended approach for larger projects:
eslint-plugin-oxlint
to disable conflicting rulesTest plan
pnpm oxlint
pnpm lint
(oxlint + eslint)🤖 Generated with Claude Code
┆Issue is synchronized with this Notion page by Unito