Skip to content

chore: fix JavaScript lint errors (issue #10501)#10503

Open
aryan7071 wants to merge 3 commits intostdlib-js:developfrom
aryan7071:fix/lint-js-10501
Open

chore: fix JavaScript lint errors (issue #10501)#10503
aryan7071 wants to merge 3 commits intostdlib-js:developfrom
aryan7071:fix/lint-js-10501

Conversation

@aryan7071
Copy link
Copy Markdown
Contributor


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: na
  • task: lint_package_json status: na
  • task: lint_repl_help status: na
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: na
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: na
  • task: lint_license_headers status: passed ---

Resolves #10501

Description

What is the purpose of this pull request?

This pull request:

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • #{{TODO: add related 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.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review. labels Feb 26, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Hello! 👋

We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm!

Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks.

Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀

For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers!

@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Feb 26, 2026

Coverage Report

Package Statements Branches Functions Lines
bigint/ctor $\color{green}70/70$
$\color{green}+100.00%$
$\color{red}2/3$
$\color{green}+66.67%$
$\color{green}0/0$
$\color{green}+100.00%$
$\color{green}70/70$
$\color{green}+100.00%$
utils/memoize $\color{green}162/162$
$\color{green}+100.00%$
$\color{green}13/13$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}162/162$
$\color{green}+100.00%$

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

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Feb 26, 2026
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

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

Thanks for opening a PR!


var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' );
var BigInt = require( './../lib' );
var bigint = require( './../lib' );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The lint rule stdlib/no-builtin-big-int has an allowance for BigInt when imported via require( '@stdlib/bigint/ctor' ) (see the isImportedBigInt check). The rule only fires here because the example uses a relative path ./../lib instead of the full package path. We should disable it:

Suggested change
var bigint = require( './../lib' );
var BigInt = require( '@stdlib/bigint/ctor' ); // eslint-disable-line stdlib/no-builtin-big-int


if ( hasBigIntSupport() ) {
v = BigInt( '1' );
v = bigint( '1' );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should stay as BigInt( '1' ):

Suggested change
v = bigint( '1' );
v = BigInt( '1' );

@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 4, 2026
@aryan7071 aryan7071 requested a review from Planeshifter March 4, 2026 17:00
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 4, 2026
@aryan7071
Copy link
Copy Markdown
Contributor Author

Hi @Planeshifter,

After applying your suggested changes, the CI is throwing two errors:

22:14  error  Last `require` statement in example files must be a relative path  stdlib/require-last-path-relative
22:48  error  Unused eslint-disable directive (no problems were reported from 'stdlib/no-builtin-big-int')

It seems like using require( '@stdlib/bigint/ctor' ) with // eslint-disable-line stdlib/no-builtin-big-int satisfies the no-builtin-big-int rule (making the disable directive unused/unnecessary), but then fails require-last-path-relative since it's not a relative path.

could you please guide me on this ? thank you !

@stdlib-bot stdlib-bot removed the Potential Duplicate There might be another pull request resolving the same issue. label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants