Repository navigation
chore: clean-up - #15900
Merged
Merged
chore: clean-up#15900
Conversation
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
Contributor
Coverage Report
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
Member
Author
|
CI status on this PR:
- pkgIndex = proxyquire( './../lib/index.js', {
+ pkgIndex = proxyquire( './../lib/main.js', {applied to both error-path tests in Generated by Claude Code |
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
Member
Author
|
Fixed in c7bf408. Both error-path tests now proxyquire Generated by Claude Code |
kgryte
marked this pull request as ready for review
October 13, 2026 10:34
kgryte
approved these changes
Oct 13, 2026
@returns annotation in fs/read-file-list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
@returnsannotation of the synchronous export of@stdlib/fs/read-file-list.readFileListSyncreturns an error object when a file read fails, but the annotation declared onlyObjectArray. The annotation now reads(ObjectArray|Error), consistent with the package's TypeScript declaration (Array<File> | Error), REPL text, and README. Among@stdlib/fssync exports which return an error object on failure, 11 of 12 (92%) already includeErrorin the@returnstype.new Array( len )with an array literal andpushinfs/read-file-list/lib/sync.js, resolving astdlib/no-new-arraylint error. Reads are sequential, so output order is unchanged._tools/search/pkg-indexerror-path tests, which run as dependents offs/read-file-list. The tests proxyquiredlib/index.js, while the stubbed dependencies are required bylib/main.js, so the stubs never applied.Related Issues
No.
Questions
No.
Other
Identified by a cross-package consistency check over the 16 packages in
@stdlib/fs. No change in public behavior.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
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