Skip to content

chore: fix JavaScript lint errors - #15293

Merged
kgryte merged 3 commits into
stdlib-js:developfrom
Abhist17:chore/fix-symbol-to-primitive-lint-15228
Sep 23, 2026
Merged

kgryte merged 3 commits into
stdlib-js:developfrom
Abhist17:chore/fix-symbol-to-primitive-lint-15228

Conversation

@Abhist17

Copy link
Copy Markdown
Contributor

Resolves #15228.

Description

What is the purpose of this pull request?

This pull request:

  • Fixes the JavaScript lint failure reported in Fix JavaScript lint errors #15228: n/no-unsupported-features/es-builtins flags the bare Symbol.toPrimitive reference in lib/node_modules/@stdlib/symbol/to-primitive/test/test.js because the package's configured engines range is >=0.12.18 (pre-ES6). The access is already environment-safe — the test only runs the assertion when opts.skip (from hasToPrimitiveSymbolSupport()) is false — so this is a lint false positive, not a runtime bug.
  • Suppresses it with an inline eslint-disable-line n/no-unsupported-features/es-builtins comment on that line, matching the existing precedent for the same rule and the same "already feature-gated" scenario in utils/property-descriptors/test/test.builtin.js and assert/is-number/test/test.object.js.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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

This PR was written by Claude Code. It located the failing line from the CI log in #15228, found the existing eslint-disable-line n/no-unsupported-features/es-builtins precedent elsewhere in the codebase for the identical rule/scenario, and applied the same one-line fix.


@stdlib-js/reviewers

Symbol.toPrimitive comparison in the "@stdlib/symbol/to-primitive" test
trips n/no-unsupported-features/es-builtins: the package's engines range
is >=0.12.18 (pre-ES6) and the rule flags any bare Symbol.toPrimitive
reference regardless of the runtime guard already in place. The access
is already environment-safe -- opts.skip (from
hasToPrimitiveSymbolSupport()) prevents the assertion from running
where the symbol doesn't exist. Suppress with an inline
eslint-disable-line, matching the same rule/scenario already handled
this way in utils/property-descriptors/test/test.builtin.js and
assert/is-number/test/test.object.js.
@Abhist17
Abhist17 requested a review from a team September 17, 2026 09:06
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. labels Sep 17, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# 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

@Abhist17

Copy link
Copy Markdown
Contributor Author

Gentle ping on #15293 — it's been 3 days. Is there anything you'd like changed before it can be reviewed? Happy to rebase or split it if that helps.

@kgryte kgryte added difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 5 and removed Needs Review A pull request which needs code review. labels Sep 23, 2026
kgryte
kgryte previously approved these changes Sep 23, 2026

@kgryte kgryte left a comment

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.

LGTM

@stdlib-bot

stdlib-bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
symbol/to-primitive $\\color{green}120/120$
$\\color{green}+100.00\\%$
$\\color{red}2/3$
$\\color{green}+66.67\\%$
$\\color{green}0/0$
$\\color{green}+100.00\\%$
$\\color{green}120/120$
$\\color{green}+100.00\\%$

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

Comment thread lib/node_modules/@stdlib/symbol/to-primitive/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/symbol/to-primitive/test/test.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte changed the title chore: fix JavaScript lint errors (issue #15228) chore: fix JavaScript lint errors Sep 23, 2026
@kgryte
kgryte merged commit ea32e3a into stdlib-js:develop Sep 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. review: 5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants