Skip to content

chore: fix JavaScript lint errors#11860

Open
mvanhorn wants to merge 1 commit intostdlib-js:developfrom
mvanhorn:fix/11852-lint-errors
Open

chore: fix JavaScript lint errors#11860
mvanhorn wants to merge 1 commit intostdlib-js:developfrom
mvanhorn:fix/11852-lint-errors

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Resolves #11852.

Description

Fix the two JavaScript lint errors reported by run 25140647799:

factory.js
  95:3  error  Function 'done' should be moved to outer function scope  stdlib/no-unnecessary-nested-functions

binary-dtype-signatures/lib/index.js
  21:1  error  Displayed return value is `[ 'float64', 'float64', 'float64', ... ]`, but expected `[ 'float32', 'float32', ..., 'uint8', 'int32' ]` instead  stdlib/jsdoc-doctest

_tools/github/star-repo/lib/factory.js

Move done out of star so it sits at the same scope as star. done only references clbk from the outer factory scope, so the nested form was unnecessary. This matches the convention used by the recent repl/presentation/lib/commands/end.js fix (#11813) and by sibling files in _tools/github/.

strided/base/binary-dtype-signatures/lib/index.js

Update the @example doctest to match the actual return value. With dtypes = [ 'float64', 'float32', 'int32', 'uint8' ], the implementation calls dt3.sort() which mutates the shared dt1/dt2/dt3 array (since dt3 = dt1 aliases the same reference), so iteration starts from the smallest sorted dtype 'float32'. The first three signature triple elements are therefore 'float32', 'float32', 'float32', not 'float64'. The sibling main.js already documents the correct form.

Related Issues

Questions

No.

Other

No.

Checklist

AI Assistance

  • Yes

  • No

  • Code generation (e.g., when writing an implementation or fixing a bug)

Disclosure

This PR was written by Claude Code; I (the author) reviewed the diff against the recently merged #11813 fix and ran the example locally to confirm the new doctest matches the actual output before submitting.


@stdlib-js/reviewers

@mvanhorn mvanhorn requested a review from a team April 30, 2026 12:10
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review. labels Apr 30, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
strided/base/binary-dtype-signatures $\color{red}309/310$
$\color{green}+99.68%$
$\color{red}44/45$
$\color{green}+97.78%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{red}309/310$
$\color{green}+99.68%$

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

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label May 1, 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. Potential Duplicate There might be another pull request resolving the same issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants