Skip to content

Add a stats audit to the eslint plugin that lists the top [N] slowest rules/files #1070

@BioPhoton

Description

@BioPhoton

User story

As a developer I want to have insights in the performance of my eslint run.

I want to be able to configure stats audit listing slow rules or files

Acceptance criteria

  • The plugin accepts an optional param for enabling the stats audit
  • The audit always passes
  • The audit is configurable
    • { type: rule, takeFirst: number}
    • { type: file, takeFirstFiles: number, takeFirstRules: number}

Implementation details

Example - Top 10 Rules

⚙️ Rule ⚡ Time ↓ 🚨 Errors ⚠️ Warnings
@typescript-eslint/no-unused-vars 20.03 ms 0 0
@typescript-eslint/triple-slash-reference 10.20 ms 0 0
@nx/enforce-module-boundaries 9.35 ms 1 0
@typescript-eslint/no-unused-vars 7.87 ms 1 0
no-control-regex 4.70 ms 1 0
no-unused-private-class-members 2.10 ms 1 0
@typescript-eslint/no-empty-function 2.10 ms 1 0
no-useless-escape 2.10 ms 1 0
no-misleading-character-class 2.10 ms 1 0
no-regex-spaces 2.10 ms 1 0

Example - Top 5 Files 2 Rules

📁 File → ⚙️ Rule ⚡ Time ↓ 🚨 Errors ⚠️ Warnings
.../eslint-stats/eslint.config.mjs ▄▂▁▃ 20.57 ms 0 0
- @typescript-eslint/no-unused-vars 2.03 ms 0 0
- @typescript-eslint/triple-slash-reference 0.20 ms 0 0
.../bin/eslint-stats-command.integration.test.ts ▄▄▁▂ 18.36 ms 1 1
- @nx/enforce-module-boundaries 4.87 ms 1 0
- @typescript-eslint/no-unused-vars 1.35 ms 0 1
.../stats/eslint-stats-table.ts ▅▂▁▂ 17.15 ms 2 0
- @typescript-eslint/no-unused-vars 1.21 ms 0 0
- @nx/enforce-module-boundaries 0.75 ms 0 0
.../eslint-stats/package.json ▁▇▁▁ 15.76 ms 2 0
- @nx/dependency-checks 13.56 ms 2 0
.../analyse/interactive.ts ▅▂▁▂ 14.72 ms 0 6
- @typescript-eslint/no-unused-vars 1.21 ms 0 4
- @nx/enforce-module-boundaries 1.07 ms 0 2

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions