Skip to content

[DX] ESLint execution time is too slow (2-3 minutes) #4896

@huchenlei

Description

@huchenlei

Problem

The npm run lint command takes 2-3 minutes to complete, which significantly impacts:

  • Developer productivity when Claude runs lint checks
  • CI pipeline performance (2-3 minutes per run)
  • Local development workflow

Root Causes

Based on analysis of the current ESLint configuration:

  1. Large codebase: 712 files (21MB) in src/ directory
  2. Type-aware linting: ESLint configured with TypeScript project references requiring full type checking
  3. Heavy plugins: Multiple performance-intensive plugins:
    • TypeScript ESLint with @typescript-eslint/no-floating-promises rule
    • Vue plugin processing .vue files with TypeScript parser
    • i18n plugin with complex pattern matching (@intlify/vue-i18n/no-raw-text)
    • Prettier integration

Proposed Solutions

Quick wins:

  1. Enable ESLint caching: eslint src --cache
  2. Selective rule disabling: Consider if @typescript-eslint/no-floating-promises is essential
  3. File type filtering: Optimize file patterns if not all extensions needed

Long-term optimizations:

  1. Incremental linting: Only lint changed files in CI
  2. Parallel processing: Explore ESLint parallel execution options
  3. Rule audit: Review necessity of performance-heavy rules

Developer experience:

  1. Restrict automated lint execution: Add guidance to prevent Claude/automated tools from running npm run lint directly due to long execution time

Impact

  • Current: 2-3 minutes per lint run
  • Target: <30 seconds for typical development workflow
  • Benefits: Faster CI, improved developer experience, more frequent lint usage

Environment

  • Codebase: 712 files, 21MB
  • ESLint config: Type-aware with multiple heavy plugins
  • Current command: eslint src

┆Issue is synchronized with this Notion page by Unito

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions