Skip to content

chore: fix JavaScript lint errors (issue #11014)#11015

Open
Bingtagui404 wants to merge 1 commit intostdlib-js:developfrom
Bingtagui404:fix/js-lint-11014
Open

chore: fix JavaScript lint errors (issue #11014)#11015
Bingtagui404 wants to merge 1 commit intostdlib-js:developfrom
Bingtagui404:fix/js-lint-11014

Conversation

@Bingtagui404
Copy link

@Bingtagui404 Bingtagui404 commented Mar 18, 2026

Resolves #11014.

Description

This pull request fixes 3 JavaScript lint errors reported by the stdlib/no-new-array ESLint rule.

Changes Made

  • lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js (1 error)

    • Replace new Array( 10 ) with array literal [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
    • This example only tests that a regular Array returns false; sparse-array semantics are not required here
  • lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js (2 errors)

    • Replace new Array( 5 ) with x = []; x.length = 5; to preserve sparse-array semantics in tests
    • The accessor callback relies on holes (v === void 0) to short-circuit; []; .length = 5 produces the same sparse behavior as new Array( 5 )

Related Issues

Checklist

AI Assistance

  • Yes

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 assistance. AI identified the lint violations, researched existing stdlib PRs for the canonical fix pattern, and generated the replacement code. The sparse-array equivalence ([] + .length vs new Array()) was manually verified.


@stdlib-js/reviewers

Replace `new Array()` constructor with array literal to comply with
stdlib/no-new-array ESLint rule.

- is-biguint64array/examples/index.js: replace new Array(10) with array literal
- acoversin-by/test/test.main.js: replace new Array(5) with [] + length assignment for sparse arrays
@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. labels Mar 18, 2026
@stdlib-bot
Copy link
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. Potential Duplicate There might be another pull request resolving the same issue. labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. 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