Skip to content

chore: fix JavaScript lint errors (issue #11247)#11672

Open
mvanhorn wants to merge 1 commit intostdlib-js:developfrom
mvanhorn:fix/11247-jsdoc-doctest-sync-entry-points
Open

chore: fix JavaScript lint errors (issue #11247)#11672
mvanhorn wants to merge 1 commit intostdlib-js:developfrom
mvanhorn:fix/11247-jsdoc-doctest-sync-entry-points

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Resolves #11247.

Description

What is the purpose of this pull request?

This pull request:

  • Replaces the incorrect `// returns [{...}]` doctest annotation with `// throws ` in the `@example` block of `_tools/pkgs/entry-points/lib/sync.js`. The example passes `/foo/bar/baz` (a non-existent path) to `entryPoints()`, which causes the function to throw synchronously while resolving the package path, so the `// returns [{...}]` annotation fails the `stdlib/jsdoc-doctest` check. The linter itself suggested the `// throws ` annotation in the failure message captured in the issue.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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.

The companion `async.js` in the same directory uses a similarly non-existent path (`./some/nonexistent/path`) but has no `// returns` / `// throws` annotation because results are delivered via callback, so doctest does not flag that variant and no change is needed there.

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

This PR was authored with Claude Code. I reviewed the `stdlib/jsdoc-doctest` failure in the issue, confirmed the behavior manually (non-existent path causes `entryPoints()` to throw), and the model's suggested swap matches the linter's own hint.


@stdlib-js/reviewers

The @example block in `_tools/pkgs/entry-points/lib/sync.js` passes
`/foo/bar/baz` (a non-existent path) to `entryPoints()`, which
causes the function to throw synchronously while resolving the package
path. The existing `// returns [{...}]` annotation therefore fails
the `stdlib/jsdoc-doctest` check, which suggests a `// throws
<Error>` annotation instead.

Swap the annotation so the doctest matches the runtime behavior.

Closes stdlib-js#11247
@mvanhorn mvanhorn requested a review from a team April 20, 2026 14:21
@stdlib-bot stdlib-bot added Tools Issue or pull request related to project tooling. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review. Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants