Skip to content

chore: fix JavaScript lint errors (issue #15228) - #15293

Open
Abhist17 wants to merge 1 commit into
stdlib-js:developfrom
Abhist17:chore/fix-symbol-to-primitive-lint-15228
Open

Abhist17 wants to merge 1 commit into
stdlib-js:developfrom
Abhist17:chore/fix-symbol-to-primitive-lint-15228

Conversation

@Abhist17

Copy link
Copy Markdown

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

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. Good First PR A pull request resolving a Good First Issue. 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

2 participants