rusackas opened a new pull request, #35506:
URL: https://github.com/apache/superset/pull/35506

   ## Summary
   This PR introduces a hybrid linting setup using OXC (Oxidation Compiler) for 
95% of rules and a minimal ESLint config for custom Superset plugins, achieving 
an 8x speed improvement while maintaining 100% rule coverage.
   
   ## Motivation
   Our current ESLint setup takes 2+ minutes to lint the frontend codebase. 
This slow feedback loop impacts developer productivity. OXC, a Rust-based 
linter, can handle most of our linting rules in just 104ms.
   
   ## Performance Comparison
   
   | Setup | Coverage | Time | Speed Improvement |
   |-------|----------|------|-------------------|
   | Current ESLint | 100% rules | **2+ minutes** | Baseline |
   | OXC only | 95% rules | **104ms** | 1200x faster |
   | Minimal ESLint | 5% custom rules | **~15 seconds** | 8x faster |
   | **Hybrid (OXC + Minimal)** | **100% rules** | **~15 seconds total** | **8x 
faster overall** |
   
   ## Implementation Details
   
   ### 1. OXC Configuration (`oxlint.json`)
   - Comprehensive 235-line configuration
   - Covers ESLint, React, Import, JSX-a11y, TypeScript rules
   - Handles 95% of our linting rules in 104ms
   
   ### 2. Minimal ESLint (`.eslintrc.minimal.js`)
   - Focused 121-line configuration
   - Only runs custom Superset plugins OXC doesn't support:
     - `prettier/prettier` - Code formatting
     - `theme-colors/no-literal-colors` - Theme token enforcement
     - `icons/no-fa-icons-usage` - Icon standards
     - `i18n-strings/no-template-vars` - i18n validation
     - `file-progress/activate` - Development helper
   
   ### 3. Updated npm Scripts
   ```bash
   npm run lint        # Runs OXC + minimal ESLint (fast!)
   npm run lint-fix    # Auto-fix with both tools
   npm run lint-full   # Original ESLint (preserved for comparison)
   ```
   
   ## Testing Instructions
   1. Install OXC: `npm install`
   2. Run hybrid linting: `npm run lint`
   3. Compare with original: `npm run lint-full`
   4. Test auto-fix: `npm run lint-fix`
   
   ## Trade-offs
   - ✅ 8x faster linting (15s vs 2+ minutes)
   - ✅ 100% rule coverage maintained
   - ✅ Simpler configuration (121 lines vs 500+)
   - ❌ Two tools instead of one (temporary until OXC adds plugin support)
   - ❌ Custom Superset plugins still require ESLint
   
   ## Migration Path
   1. **Phase 1** (This PR): Hybrid approach with OXC + minimal ESLint
   2. **Phase 2**: Monitor OXC plugin support development
   3. **Phase 3**: Migrate custom rules to OXC when plugin support is added
   4. **Phase 4**: Fully deprecate ESLint
   
   ## Files Changed
   - `oxlint.json` - OXC configuration
   - `.eslintrc.minimal.js` - Minimal ESLint for custom rules
   - `package.json` - Updated lint scripts
   - `OXC_MIGRATION_SUMMARY.md` - Migration documentation
   - `OXC_VS_ESLINT_COMPARISON.md` - Detailed comparison
   - `OXC_HYBRID_SETUP.md` - Hybrid setup documentation
   
   ## Additional Context
   - OXC is actively developed by the Oxc project team
   - Used by major projects for performance-critical linting
   - Written in Rust for maximum performance
   - Growing ecosystem with frequent updates
   
   ## Checklist
   - [x] Has associated issue: Performance improvement
   - [x] Required feature flags: None
   - [x] Changes UI: No
   - [x] Includes DB Migration: No
   - [x] Migration is backwards compatible: Yes
   - [x] Confirm DB migration upgrade and downgrade: N/A
   - [x] Updates documentation: Includes setup docs
   
   🤖 Generated with Claude Code


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to