Skip to content

tools: enforce iterator result property order - #63526

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:eslint-iterator-result-object-done-value
May 26, 2026
Merged

tools: enforce iterator result property order#63526
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:eslint-iterator-result-object-done-value

Conversation

@trivikr

Copy link
Copy Markdown
Member

Adds a custom ESLint rule to enforce done before value in iterator result objects.

This keeps iterator result object literals consistent across lib/, and includes a fixer
that swaps the properties when they are in the wrong order.

The existing iterator result object literals in lib/ have been updated to match the new rule.

Refs: #63521 (comment)


Assisted-by: openai:gpt-5.5

Add a custom ESLint rule requiring iterator result objects to place
`done` before `value`, and update existing lib iterator result objects
to follow the rule.
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams
  • @nodejs/url

@nodejs-github-botnodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 24, 2026
@trivikr
trivikr requested a review from jasnellMay 24, 2026 00:42
@codecov

codecovBot commented May 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.33%. Comparing base (837910d) to head (d25477b).
⚠️ Report is 39 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/streams/iter/push.js75.00%2 Missing ⚠️
lib/internal/vfs/watcher.js83.33%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #63526 +/- ##
=======================================
Coverage 90.33% 90.33% =======================================
Files 730 730 Lines 234205 234205 Branches 43927 43931 +4 =======================================
+ Hits 211559 211560 +1 + Misses 14370 14366 -4 - Partials 8276 8279 +3 
Files with missing linesCoverage Δ
lib/events.js99.59% <100.00%> (ø)
lib/internal/fs/promises.js92.87% <100.00%> (ø)
lib/internal/url.js93.17% <100.00%> (ø)
lib/internal/webstreams/readablestream.js98.54% <100.00%> (ø)
lib/internal/vfs/watcher.js95.20% <83.33%> (ø)
lib/internal/streams/iter/push.js92.20% <75.00%> (ø)

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trivikrtrivikr added the request-ci Add this label to start a Jenkins CI on a PR. label May 24, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 24, 2026
@nodejs-github-bot

This comment was marked as outdated.

@trivikrtrivikr added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 24, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikrtrivikr added the commit-queue Add this label to land a pull request using GitHub Actions. label May 26, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 26, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 92f48f4 into nodejs:mainMay 26, 2026
86 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 92f48f4

@trivikr
trivikr deleted the eslint-iterator-result-object-done-value branch May 27, 2026 07:49
aduh95 pushed a commit that referenced this pull request Jun 20, 2026
Add a custom ESLint rule requiring iterator result objects to place
`done` before `value`, and update existing lib iterator result objects
to follow the rule.
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: #63526
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@trivikr@nodejs-github-bot@jasnell@MattiasBuelens