docs: fix @returns annotation in fs/read-file-list - #15900
Draft
Planeshifter wants to merge 2 commits into
Draft
Planeshifter wants to merge 2 commits into
Planeshifter wants to merge 2 commits into
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 |
This branch has not been deployed
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.Related Issues
No.
Questions
No.
Other
Identified by a cross-package consistency check over the 16 packages in
@stdlib/fs. Documentation-only change; no change in behavior or test expectations.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/fsand applied the resulting documentation fix.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG
Generated by Claude Code