Skip to content
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

Update main.js #6427

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Update main.js #6427

wants to merge 2 commits into from

Conversation

VeerRaj-007
Copy link

@VeerRaj-007 VeerRaj-007 commented Mar 28, 2025

Issue: Using new Array() violates the stdlib/no-new-array rule.

Resolves #{{TODO: add issue number}}.

Description

What is the purpose of this pull request?

This pull request:

  • {{TODO: add description describing what this pull request does}}

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves #{{TODO: add issue number}}

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.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

Issue: Using new Array() violates the stdlib/no-new-array rule.

Signed-off-by: VEER RAJ <136178369+VeerRaj-007@users.noreply.github.com>
@stdlib-bot stdlib-bot added the First-time Contributor A pull request from a contributor who has never previously committed to the project repository. label Mar 28, 2025
Signed-off-by: VEER RAJ <136178369+VeerRaj-007@users.noreply.github.com>
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
utils/async/if-then 199 / 199
+ 100.00 %
21 / 21
+ 100.00 %
3 / 3
+ 100.00 %
199 / 199
+ 100.00 %

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

@VeerRaj-007 VeerRaj-007 marked this pull request as ready for review March 28, 2025 16:40
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 28, 2025
var i;
if ( error ) {
return done( error );
}
nargs = arguments.length;
args = new Array( nargs );
args[ 0 ] = null;
const args = [null];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use const.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kgryte ,

Thank you for the feedback. I understand that "const" isn't typically used in this context. I'll adjust my code accordingly to align with the project's coding conventions.

Could you please clarify if there are specific patterns or alternatives you recommend for variable declarations in this situation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can start by actually looking at the file that you are editing.

@kgryte
Copy link
Member

kgryte commented Mar 30, 2025

@VeerRaj-007 What issue are you trying to resolve?

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 30, 2025
@VeerRaj-007
Copy link
Author

I'm currently working on resolving stdlib/no-new-array linting rule violation in lib/node_modules/@stdlib/utils/async/if-then/lib/main.js (Line 122) which involves The original code uses new Array(nargs), which is flagged by ESLint.

Please let me know if there are specific details you'd like me to provide or if there's anything else I should consider.

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. Needs Changes Pull request which needs changes before being merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants