Skip to content

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 <[email protected]>
@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 <[email protected]>
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
utils/async/if-then $\color{green}199/199$
$\color{green}+100.00\%$
$\color{green}21/21$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}199/199$
$\color{green}+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
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.

@kgryte kgryte added the autoclose: Project Conventions Pull request which should be auto-closed due to not following project conventions. label Jul 11, 2025
@stdlib-bot
Copy link
Contributor

Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not follow project conventions.

We place a high value on consistency throughout the stdlib codebase, and this pull request was found to significantly deviate from stdlib conventions. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.

  • If you are attempting to contribute a new package, sometimes the best approach is to simply copy the contents of an existing package and then modify the minimum amount necessary to implement the feature (e.g., changing descriptions, parameter names, and implementation).
  • If you are contributing tests, find a package implementing a similar feature and emulate the tests of that package.
  • If you are updating documentation, examine several similar packages and emulate the content, style, and prose of those packages.

In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase before continuing to work on this pull request.

Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.

@stdlib-bot stdlib-bot closed this Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose: Project Conventions Pull request which should be auto-closed due to not following project conventions. 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