-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
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 |
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
| @@ -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. |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: Athan <kgryte@gmail.com>
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.
@agananya03 Mind updating the corresponding example in the README with the current changes?
kgryte
left a comment
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.
I went ahead and "modernized" the example to use functional utilities we now have which we didn't have at the time the original example was written.
In order to keep examples in sync, the changes should be replicated in the README where we had the same example. Once completed, this PR should be ready for another review and then merge.
|
@agananya03 Another comment. Please follow our development guide. There you will find instructions for how to pull down the changes I made to your PR. One comment is that you are opening this PR from a |
Signed-off-by: Athan <kgryte@gmail.com>
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