feat: fix JavaScript lint errors issue #11193#11204
feat: fix JavaScript lint errors issue #11193#11204shaniprajapatiii wants to merge 2 commits intostdlib-js:developfrom
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
👋 Hi there! 👋 And thank you for opening your first pull request! We will review it shortly. 🏃 💨 Getting Started
Next Steps
Running Tests LocallyYou can use # 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 |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolves #11193
Description
This pull request:
stdlib/no-new-arrayviolations inlib/node_modules/@stdlib/stats/ztest2/benchmark/benchmark.jsby replacingnew Array(...)initialization with[]pluspush(...)lib/node_modules/@stdlib/ndarray/base/assert/is-data-type-string/lib/main.jsto use a precomputed dtype lookup table@stdlib/array/base/assert/contains, which eliminates the reported cycle while preserving dtype-membership semanticsRelated Issues
This pull request has the following related issues:
Questions
Scope separation: This PR addresses two independent CI failures:
new Array(...)inlib/node_modules/@stdlib/stats/ztest2/benchmark/benchmark.js, lines 42, 47, 77, 81, 115, 119 → replaced with[] + push(...))@stdlib/array/base/assert/containsimport fromlib/node_modules/@stdlib/ndarray/base/assert/is-data-type-string/lib/main.js)Lookup-table approach: The dtype validation now uses a precomputed table instead of a factory import:
Is this pattern acceptable, or do you recommend an alternative (e.g., lazy/deferred dependency loading)?
Other
Implementation notes, reasoning, and validation proof:
Root-cause discovery path:
new Array(...)violatedstdlib/no-new-array.@stdlib/ndarray/base/assert/is-data-type-stringand@stdlib/array/base/assert/contains.Why this approach is best for this PR:
Validation proof (local):
node lib/node_modules/@stdlib/stats/ztest2/test/test.js-> pass (121/121)node lib/node_modules/@stdlib/ndarray/base/assert/is-data-type-string/test/test.js-> pass (32/32)node -p "(()=>{const out=require('./lib/node_modules/@stdlib/_tools/pkgs/toposort/lib/index.js').sync(); if(out instanceof Error){throw out;} return 'Toposort(all) OK. Package count: '+out.length;})()"-> pass (Toposort(all) OK)Select-String -Path "lib/node_modules/@stdlib/stats/ztest2/benchmark/benchmark.js" -Pattern "new Array\("-> no matchesScope of changed files:
lib/node_modules/@stdlib/stats/ztest2/benchmark/benchmark.jslib/node_modules/@stdlib/ndarray/base/assert/is-data-type-string/lib/main.jsChecklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I use GitHub Copilot assisted for:
All proposed code changes were manually written after AI-assisted analysis.
I validated every change with targeted testing (121 + 32 unit tests + toposort validation).
@stdlib-js/reviewers