Skip to content

fix: don't crash stats when a pass has no parse timing - #334

Merged
antfu merged 2 commits into
eslint:mainfrom
official-burak:fix-stats-missing-parse-timing
Sep 11, 2026
Merged

antfu merged 2 commits into
eslint:mainfrom
official-burak:fix-stats-missing-parse-timing

Conversation

@official-burak

@official-burak official-burak commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #333.

build --stats threw when a pass had no parse bucket. Language plugins (CSS and friends) can emit that shape.

Missing parse and fix timings now count as 0, same as we already do for rules.

Summary by CodeRabbit

  • Bug Fixes

    • ESLint statistics now handle reports that omit parsing or fix timing data without errors.
    • Missing timing values are reported as zero, while other aggregated timing metrics remain accurate.
  • Tests

    • Added coverage verifying correct totals and per-file statistics when parsing or fix timings are unavailable.

Language plugins can omit parse on a pass, which crashed build --stats.
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: official-burak / name: Burak Keskin (8555441)

@eslint-github-bot eslint-github-bot Bot added the bug Something isn't working label Sep 8, 2026
@eslintbot eslintbot added this to Triage Sep 8, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bffb0e25-05fc-4e0e-a199-6ebee2023f38

📥 Commits

Reviewing files that changed from the base of the PR and between ed18ac2 and 8555441.

📒 Files selected for processing (2)
  • src/rpc/run-stats.ts
  • tests/stats.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

StatsLintResult now permits missing parse and fix timings. aggregateStats treats missing values as zero. A test verifies total and per-file aggregation for a pass without these timings.

Changes

Stats aggregation

Layer / File(s) Summary
Optional timing handling
src/rpc/run-stats.ts, tests/stats.test.ts
parse and fix timings are optional. aggregateStats defaults missing timings to zero. Tests verify total and per-file values, including other.

Priority: ➖ Normal — Schedule the stats crash fix because it restores `build --stats` for plugins that omit parse timing, with medium issue severity and a narrowly scoped change.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to f680c

Build statistics now complete when a lint pass omits parse or fix timing data, reporting those timings as zero. The targeted aggregation behavior is covered, with no remaining merge-blocking risk identified.

Suggested reviewers: antfubot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: preventing a stats crash when a pass lacks parse timing.
Linked Issues check ✅ Passed The changes satisfy issue #333. They make parse and fix timing fields optional, treat missing values as zero during aggregation, and add coverage for passes without timing data.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue. The implementation and test only address missing parse and fix timing data in stats aggregation.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antfu
antfu merged commit 48de2ef into eslint:main Sep 11, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Complete in Triage Sep 11, 2026
renovate Bot added a commit to NiGhTTraX/eslint-config that referenced this pull request Oct 1, 2026
| datasource | package                  | from  | to    |
| ---------- | ------------------------ | ----- | ----- |
| npm        | @eslint/config-inspector | 3.3.0 | 3.5.0 |


## [v3.5.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#350-2026-09-16)

##### Features

- upgrade devframe to v1.0 ([ec32c8f](eslint/config-inspector@ec32c8f))


## [v3.4.1](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#341-2026-09-11)

##### Bug Fixes

- don't crash stats when a pass has no parse timing ([#334](eslint/config-inspector#334)) ([48de2ef](eslint/config-inspector@48de2ef))


## [v3.4.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#340-2026-09-02)

##### Features

- add --stats flag to the dev and build commands ([#332](eslint/config-inspector#332)) ([f5e983c](eslint/config-inspector@f5e983c))
- add stats panel for on-demand ESLint timing analysis ([#329](eslint/config-inspector#329)) ([a006be1](eslint/config-inspector@a006be1))
renovate Bot added a commit to NiGhTTraX/eslint-config that referenced this pull request Oct 6, 2026
| datasource | package                  | from  | to    |
| ---------- | ------------------------ | ----- | ----- |
| npm        | @eslint/config-inspector | 3.3.0 | 3.5.0 |


## [v3.5.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#350-2026-09-16)

##### Features

- upgrade devframe to v1.0 ([ec32c8f](eslint/config-inspector@ec32c8f))


## [v3.4.1](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#341-2026-09-11)

##### Bug Fixes

- don't crash stats when a pass has no parse timing ([#334](eslint/config-inspector#334)) ([48de2ef](eslint/config-inspector@48de2ef))


## [v3.4.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#340-2026-09-02)

##### Features

- add --stats flag to the dev and build commands ([#332](eslint/config-inspector#332)) ([f5e983c](eslint/config-inspector@f5e983c))
- add stats panel for on-demand ESLint timing analysis ([#329](eslint/config-inspector#329)) ([a006be1](eslint/config-inspector@a006be1))
renovate Bot added a commit to NiGhTTraX/eslint-config that referenced this pull request Oct 6, 2026
| datasource | package                  | from  | to    |
| ---------- | ------------------------ | ----- | ----- |
| npm        | @eslint/config-inspector | 3.3.0 | 3.5.0 |


## [v3.5.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#350-2026-09-16)

##### Features

- upgrade devframe to v1.0 ([ec32c8f](eslint/config-inspector@ec32c8f))


## [v3.4.1](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#341-2026-09-11)

##### Bug Fixes

- don't crash stats when a pass has no parse timing ([#334](eslint/config-inspector#334)) ([48de2ef](eslint/config-inspector@48de2ef))


## [v3.4.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#340-2026-09-02)

##### Features

- add --stats flag to the dev and build commands ([#332](eslint/config-inspector#332)) ([f5e983c](eslint/config-inspector@f5e983c))
- add stats panel for on-demand ESLint timing analysis ([#329](eslint/config-inspector#329)) ([a006be1](eslint/config-inspector@a006be1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Bug: build --stats crashes when an ESLint stats pass has no parse timing

2 participants