Skip to content

fix: replace new Array() with array literals in test files#10257

Open
infinityanant wants to merge 1 commit intostdlib-js:developfrom
infinityanant:fix/array-constructor-linting
Open

fix: replace new Array() with array literals in test files#10257
infinityanant wants to merge 1 commit intostdlib-js:developfrom
infinityanant:fix/array-constructor-linting

Conversation

@infinityanant
Copy link
Contributor

@infinityanant infinityanant commented Feb 13, 2026

Description

What is the purpose of this pull request?

This pull request:

  • Replaces new Array() constructor with array literal pattern in ahavercos-by tests
  • Replaces new Array() with explicit array in is-empty-collection test
  • Resolves linting errors (stdlib/no-new-array rule violations)

Related Issues

Does this pull request have any related issues?

This pull request:

  • Fixes JavaScript linting failures detected in the automated lint workflow run

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.

Changes Made:

File 1: lib/node_modules/@stdlib/math/strided/special/ahavercos-by/test/test.main.js

  • Lines 77-78 and 85-86: Changed x = new Array( 5 ); to x = []; x.length = 5; // sparse array

File 2: lib/node_modules/@stdlib/math/strided/special/ahavercos-by/test/test.ndarray.js

  • Lines 76-77 and 84-85: Changed x = new Array( 5 ); to x = []; x.length = 5; // sparse array

File 3: lib/node_modules/@stdlib/assert/is-empty-collection/test/test.js

  • Line 84: Changed new Array( 10 ), to [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ],

All linting tests now pass locally.

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

[ ] Test/benchmark generation

[ ] Documentation (including examples)

[ ] Research and understanding


@stdlib-js/reviewers
Fixes: #10184

- Replace new Array() constructor with array literal pattern in ahavercos-by tests
- Replace new Array() with explicit array in is-empty-collection test
- Resolves linting errors (stdlib/no-new-array rule violations)

---
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
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - 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
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 13, 2026
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
assert/is-empty-collection $\color{green}102/102$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}102/102$
$\color{green}+100.00%$
math/strided/special/ahavercos-by $\color{green}197/197$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}197/197$
$\color{green}+100.00%$

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

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Feb 13, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants