Skip to content

chore: resolve n/no-unsupported-features lint error in symbol/async-iterator#11927

Merged
kgryte merged 1 commit intodevelopfrom
philipp/ci-fix-lint-symbol-asynciter-2026-05-04
May 4, 2026
Merged

chore: resolve n/no-unsupported-features lint error in symbol/async-iterator#11927
kgryte merged 1 commit intodevelopfrom
philipp/ci-fix-lint-symbol-asynciter-2026-05-04

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter commented May 4, 2026

Summary

Fixes a persistent CI lint failure in @stdlib/symbol/async-iterator.

Root cause: The file referenced the global Symbol.asyncIterator directly. The n/no-unsupported-features/es-builtins ESLint rule flags Symbol.asyncIterator (available from Node 10.0.0) when the configured Node version range is >=0.12.18, treating the access as unsupported.

Fix: Shadow the global Symbol with the stdlib polyfill @stdlib/symbol/ctor, which resolves to the native Symbol when available or null otherwise. The rule no longer flags the member access because the local variable Symbol is not a known built-in being tracked. This pattern is already used in @stdlib/symbol/to-primitive.

Files changed

  • lib/node_modules/@stdlib/symbol/async-iterator/lib/main.js — add var Symbol = require( '@stdlib/symbol/ctor' ); in the MODULES section

Test plan

  • Run node lib/node_modules/@stdlib/symbol/async-iterator/examples/index.js — verify no runtime error
  • Run ESLint on the changed file — verify n/no-unsupported-features/es-builtins no longer fires
  • Verify CI lint workflow passes on this branch

The JavaScript linting CI job failed on develop:

  lib/node_modules/@stdlib/symbol/async-iterator/lib/main.js
    42:65  error  The 'Symbol.asyncIterator' is still an experimental
    feature and is not supported until Node.js 10.0.0. The configured
    version range is '>=0.12.18'  n/no-unsupported-features/es-builtins

Root cause: main.js referenced the global Symbol directly. The
n/no-unsupported-features/es-builtins ESLint rule flags
Symbol.asyncIterator as requiring Node >= 10.0.0, which exceeds
the project configured minimum of >=0.12.18. Shadowing the global
with var Symbol = require( '@stdlib/symbol/ctor' ) removes the
global reference and resolves the violation. The local binding
resolves to the native Symbol in environments where it exists,
preserving runtime behavior identically.

The sibling package symbol/to-primitive uses the same pattern for
Symbol.toPrimitive, which is also flagged by the same rule.

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/25195861572

https://claude.ai/code/session_01KcDPB7otMv5FFbBc5N12mu
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
symbol/async-iterator $\color{green}91/91$
$\color{green}+100.00%$
$\color{red}2/3$
$\color{green}+66.67%$
$\color{green}0/0$
$\color{green}+100.00%$
$\color{green}91/91$
$\color{green}+100.00%$

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

@Planeshifter Planeshifter changed the title fix: resolve n/no-unsupported-features lint error in symbol/async-iterator chore: resolve n/no-unsupported-features lint error in symbol/async-iterator May 4, 2026
@stdlib-js stdlib-js deleted a comment from stdlib-bot May 4, 2026
@Planeshifter Planeshifter marked this pull request as ready for review May 4, 2026 20:50
@Planeshifter Planeshifter requested review from a team and kgryte May 4, 2026 20:50
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 4, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label May 4, 2026
@kgryte kgryte merged commit c7e4f4e into develop May 4, 2026
44 of 45 checks passed
@kgryte kgryte deleted the philipp/ci-fix-lint-symbol-asynciter-2026-05-04 branch May 4, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants