Skip to content

chore: fix JavaScript lint errors - #16022

Open
CoDe-ReDz wants to merge 1 commit into
stdlib-js:developfrom
CoDe-ReDz:fix-no-new-array-to-flat
Open

CoDe-ReDz wants to merge 1 commit into
stdlib-js:developfrom
CoDe-ReDz:fix-no-new-array-to-flat

Conversation

@CoDe-ReDz

Copy link
Copy Markdown

Resolves #16021.

Description

What is the purpose of this pull request?

This pull request:

  • fixes the stdlib/no-new-array lint error in @stdlib/_tools/bundle/pkg-list/lib/to_flat.js by building the output array with an array literal and push instead of preallocating it with new Array( keys.length ). The array was already filled sequentially from index 0, so the returned value is unchanged.

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.

Verified locally with make lint-javascript-files FILES="lib/node_modules/@stdlib/_tools/bundle/pkg-list/lib/to_flat.js" (no errors), by running the package tests (test/test.js and test/test.validate.js), and by comparing the output of toFlat before and after the change for a sample list of packages and for an empty list (identical). The existing tests do not exercise toFlat directly, which is why I added the before/after comparison.

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

@stdlib-js/reviewers

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@CoDe-ReDz
CoDe-ReDz requested a review from a team October 10, 2026 01:41
@stdlib-bot stdlib-bot added Tools Issue or pull request related to project tooling. Needs Review A pull request which needs code review. 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 Oct 10, 2026
@Ashutosh-1304

Copy link
Copy Markdown
Contributor

@CoDe-ReDz change the pr title to
chore: fix JavaScript lint errors

@CoDe-ReDz CoDe-ReDz changed the title chore: fix JavaScript lint errors (issue #16021) chore: fix JavaScript lint errors Oct 10, 2026

This branch has not been deployed

No deployments
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. 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

3 participants