-
-
Notifications
You must be signed in to change notification settings - Fork 1k
chore: fix JavaScript lint errors (issue #9403) #9415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
👋 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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
| @@ -23,17 +23,19 @@ var randu = require( '@stdlib/random/base/randu' ); | |||
| var pow = require( '@stdlib/math/base/special/pow' ); | |||
| var unzip = require( './../lib' ); | |||
|
|
|||
| var arr = new Array( 100 ); | |||
| var arr = []; | |||
| arr.length = 100; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Note that arr.length = 100 creates a sparse array. The issue suggests preferring explicit initialization.
| } | ||
| } | ||
| var out = unzip( arr ); | ||
| var out = unzip(arr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need to be reverted to avoid lint errors.
|
Hey @agananya03 , thanks for this! I think the issue here is limited to index.js, so we shouldn’t need to make any changes in package.json. Also, just checking—did you install cppcheck and run make lint locally? That should catch the related lint issues. |
|
Thanks for reviewing. I encountered issues running "make lint" locally on Windows (the "make" command wasn't available and npm install failed due to postinstall script issues).
|
|
run this commands: |
|
Addressed the review comment by explicitly initializing the array instead of using arr.length = 100, preventing sparse array creation. |
Resolves #9403.
Description
This pull request addresses JavaScript linting violations identified in the automated lint workflow, ensuring code quality and consistency across the stdlib codebase.
Changes implemented:
lib/node_modules/@stdlib/utils/unzip/examples/index.jsby replacingnew Array()constructor calls with idiomatic array literal syntax[](lines 26, 32)require()statements (lines 21-24) to align with stdlib's established style guidelinesstdlib/no-new-arrayrule and spacing requirementsImpact:
Related Issues
This pull request has the following related issues:
Questions
No.
Other
Testing:
Checklist
AI Assistance
@stdlib-js/reviewers