Skip to content

chore: clean-up - #15900

Merged
kgryte merged 3 commits into
developfrom
claude/cool-johnson-ngge4u
Oct 13, 2026
Merged

kgryte merged 3 commits into
developfrom
claude/cool-johnson-ngge4u

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes the JSDoc @returns annotation of the synchronous export of @stdlib/fs/read-file-list. readFileListSync returns an error object when a file read fails, but the annotation declared only ObjectArray. The annotation now reads (ObjectArray|Error), consistent with the package's TypeScript declaration (Array<File> | Error), REPL text, and README. Among @stdlib/fs sync exports which return an error object on failure, 11 of 12 (92%) already include Error in the @returns type.
  • replaces new Array( len ) with an array literal and push in fs/read-file-list/lib/sync.js, resolving a stdlib/no-new-array lint error. Reads are sequential, so output order is unchanged.
  • fixes dependency stubbing in the _tools/search/pkg-index error-path tests, which run as dependents of fs/read-file-list. The tests proxyquired lib/index.js, while the stubbed dependencies are required by lib/main.js, so the stubs never applied.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Identified by a cross-package consistency check over the 16 packages in @stdlib/fs. No change in public behavior.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code, which ran an automated cross-package API drift analysis over @stdlib/fs, applied the resulting documentation fix, and resolved the CI failures surfaced by the change.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG

The synchronous export returns an error object when a file read fails. Updated the JSDoc `@returns` type from `ObjectArray` to `(ObjectArray|Error)`, matching the TypeScript declaration, REPL text, and README. The `@returns` type of every other error-returning sync export in `@stdlib/fs` (11 of 12, 92%) already includes `Error`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG
@stdlib-bot

stdlib-bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
fs/read-file-list $\\color{green}480/480$
$\\color{green}+0.00\\%$
$\\color{green}46/46$
$\\color{green}+0.00\\%$
$\\color{green}8/8$
$\\color{green}+0.00\\%$
$\\color{green}480/480$
$\\color{green}+0.00\\%$

The above coverage report was generated for the changes in this PR.

Replaces `new Array( len )` with an array literal and `push`, resolving the `stdlib/no-new-array` lint error reported for this file. Files are read sequentially, so the output order is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG

Copy link
Copy Markdown
Member Author

CI status on this PR:

  • Lint Changed Files: failed on an existing stdlib/no-new-array error in fs/read-file-list/lib/sync.js, which lint checks because this PR touches the file. Fixed in 97b5071 (array literal + push; output unchanged because the reads are sequential).
  • Run affected tests: fails in @stdlib/_tools/search/pkg-index/test/test.js (two returns expected value asserts at lines 130 and 165). This failure is not caused by this PR. It runs only because pkg-index depends on fs/read-file-list. The test proxyquires ./../lib/index.js to stub @stdlib/_tools/pkgs/readmes and @stdlib/fs/read-file-list, but lib/main.js is the module that requires them, so the stubs never take effect. The function then runs against the real fixture directory and calls back with null. No fix exists yet. Proposed patch (separate PR, not included here):
-	pkgIndex = proxyquire( './../lib/index.js', {
+	pkgIndex = proxyquire( './../lib/main.js', {

applied to both error-path tests in _tools/search/pkg-index/test/test.js.


Generated by Claude Code

@kgryte

kgryte commented Oct 12, 2026

Copy link
Copy Markdown
Member

Go ahead and resolve the issue with the affected tests in this PR.

The error-path tests proxyquired `lib/index.js`, but `@stdlib/_tools/pkgs/readmes` and `@stdlib/fs/read-file-list` are required by `lib/main.js`. The stubs therefore never applied, and the tests searched the real package directory and received `null` instead of an error. Proxyquire `lib/main.js` directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG

Copy link
Copy Markdown
Member Author

Fixed in c7bf408. Both error-path tests now proxyquire ./../lib/main.js, so the readmes and read-file-list stubs apply. Locally the two returns expected value failures reproduce on the original test, and all 21 tests pass with the change.


Generated by Claude Code

@kgryte
kgryte marked this pull request as ready for review October 13, 2026 10:34
@kgryte
kgryte requested a review from a team October 13, 2026 10:34
@kgryte kgryte changed the title docs: fix @returns annotation in fs/read-file-list chore: clean-up Oct 13, 2026
@kgryte
kgryte merged commit 32dd475 into develop Oct 13, 2026
17 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-ngge4u branch October 13, 2026 10:35
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants