Conversation
…lint The job "Lint JavaScript files" in workflow `lint_random_files` failed on develop with an `n/no-unsupported-features/es-builtins` error on `test/test.js:50`, flagging the bare reference to the global `Symbol.toPrimitive` as unsupported under the repo's configured Node version floor (`>=0.12.18`; `Symbol.toPrimitive` requires Node 6+). Root cause: the test file never shadowed the global `Symbol`, unlike this package's own `lib/main.js`, which already imports `@stdlib/symbol/ctor` locally as `Symbol` for the same reason. This commit adds the identical shadow to the test file. `@stdlib/symbol/ctor` re-exports the global `Symbol` constructor unchanged, so the shadowed reference is referentially identical at runtime and the lint rule's scope analysis no longer treats it as a global-builtin reference, resolving the failure without altering test behavior. Ref: https://github.com/stdlib-js/stdlib/actions/runs/34911553402 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NcrBJtjFWieVFKStqCyyYH
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
September 16, 2026 04:06
kgryte
approved these changes
Sep 16, 2026
Symbol to resolve lintSymbol constructor
kgryte
deleted the
philipp/ci-fix-lint-random-files-symbol-toprimitive-2026-09-15
branch
September 16, 2026 04:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
lint_random_filesCI failure ondevelop: https://github.com/stdlib-js/stdlib/actions/runs/34911553402 (lint_random_files/ "Lint JavaScript files").n/no-unsupported-features/es-builtins) flagslib/node_modules/@stdlib/symbol/to-primitive/test/test.js:50:22for referencing the globalSymbol.toPrimitive, unsupported under this repo's configured Node floor (>=0.12.18inetc/eslint/rules/nodejs.js;Symbol.toPrimitiverequires Node 6+).lib/main.jsalready shadows the global viavar Symbol = require( '@stdlib/symbol/ctor' );, so the rule's scope analysis doesn't flag it there. The test file never did the same, so the reference resolved to the global builtin and tripped the rule.test/test.js.@stdlib/symbol/ctorre-exports the globalSymbolconstructor unchanged, so this is referentially identical at runtime — no behavior change, only satisfies lint. The same pattern is already used in 74 other test files across the repo, and insymbol/async-iterator/lib/main.js(fix: shadow global Symbol in async-iterator to resolve lint #11905, chore: resolve n/no-unsupported-features lint error insymbol/async-iterator#11927).Related Issues
None.
Questions
No.
Other
Confirmed the shadow resolves the flagged line by static analysis of the ESLint rule's scope-analysis behavior and by checking runtime referential identity (
require('@stdlib/symbol/ctor') === global Symbol).tapeis not installed in this environment, so the suite itself was not executed locally.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by an automated CI-failure investigation and fix routine (Claude Code) running as a scheduled task. Three independent reviewer passes (correctness, regression scope, style/conventions) approved the change with no blocking findings before this PR was opened.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01NcrBJtjFWieVFKStqCyyYH
Generated by Claude Code