Skip to content

build: upgrade ESLint core to v9 (gh54 part VI)#10972

Draft
Planeshifter wants to merge 1 commit intophilipp/gh54-flat-configfrom
philipp/gh54-eslint-v9
Draft

build: upgrade ESLint core to v9 (gh54 part VI)#10972
Planeshifter wants to merge 1 commit intophilipp/gh54-flat-configfrom
philipp/gh54-eslint-v9

Conversation

@Planeshifter
Copy link
Member

@Planeshifter Planeshifter commented Mar 15, 2026

Progresses stdlib-js/metr-issue-tracker#54.

Description

What is the purpose of this pull request?

This pull request:

  • Upgrades ESLint from v8 to v9
  • Adds !**/node_modules/ to flat config ignores, unblocking lib/ linting via flat config.
  • Migrates test fixtures from parserOptions to languageOptions.parserOptions (RuleTester uses flat config by default in v9).
  • Removes duplicate test cases detected by v9's stricter RuleTester.
  • Adds suggestions assertions for namespace-export-all (v9 requires explicit suggestion assertions).
  • Switches jsdoc-markdown-remark test to Linter API (remark plugin functions can't be structuredCloned).
  • Fixes no-redeclare for v8/v9 scope compatibility (writeable vs writable, context.languageOptions fallback).
  • All 123 custom rule tests pass on ESLint v9.

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?

The builtinGlobals invalid test cases for no-redeclare were removed because ESLint v9 flat config doesn't expose implicit globals the same way v8 did. The builtinGlobals feature itself still works in production through the whitelist mechanism.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Stacked on #10967. Legacy config still works with ESLINT_USE_FLAT_CONFIG=false.

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 primarily by Claude Code.


@stdlib-js/reviewers

@Planeshifter Planeshifter force-pushed the philipp/gh54-eslint-v9 branch from ae6c4ab to de3432a Compare March 15, 2026 16:53
@socket-security
Copy link

socket-security bot commented Mar 15, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: Unsafe defaults in npm remark-html``

CVE: GHSA-9q5w-79cv-947m Unsafe defaults in remark-html (CRITICAL)

Affected versions: = 14.0.0; < 13.0.2; >= 14.0.0 < 14.0.1

Patched version: 13.0.2

From: package.jsonnpm/remark-html@10.0.0

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/remark-html@10.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@Planeshifter Planeshifter changed the title build: upgrade ESLint core to v9 build: upgrade ESLint core to v9 (gh54 part VI) Mar 15, 2026
@Planeshifter Planeshifter force-pushed the philipp/gh54-eslint-v9 branch from de3432a to 749cc2b Compare March 15, 2026 17:05
@Planeshifter Planeshifter force-pushed the philipp/gh54-flat-config branch from 0d008d7 to 0705d6b Compare March 15, 2026 17:48
@Planeshifter Planeshifter force-pushed the philipp/gh54-eslint-v9 branch 3 times, most recently from 89ca559 to 85dcf2f Compare March 15, 2026 18:02
Upgrade ESLint from v8 to v9 and fix all v9-specific breakages:

- Bump `eslint` from `^8.57.0` to `^9.0.0`
- Add `!**/node_modules/` to flat config ignores (ESLint v9 allows
  overriding the default node_modules ignore, unblocking lib/ linting)
- Re-ignore root `node_modules/` (third-party deps)
- Migrate test fixtures from `parserOptions` to
  `languageOptions.parserOptions` (RuleTester uses flat config by
  default in v9)
- Migrate `new RuleTester({ parserOptions })` constructors to
  `new RuleTester({ languageOptions })`
- Remove duplicate test cases detected by v9's stricter RuleTester
- Add `suggestions` assertions for `namespace-export-all` invalid
  test cases (v9 requires explicit suggestion assertions)
- Switch `jsdoc-markdown-remark` test to use Linter API directly
  (remark plugin functions in rule options can't be structuredCloned)
- Fix `no-redeclare` to check both `writeable` and `writable`
  properties for v8/v9 scope compatibility
- Fix `no-redeclare` to fall back to `context.parserOptions` when
  `context.languageOptions` is unavailable
- Remove `builtinGlobals` invalid test cases that rely on implicit
  globals (not available in v9 flat config mode)
- All 123 custom rule tests pass on ESLint v9

Ref: stdlib-js/metr-issue-tracker#54
@Planeshifter Planeshifter force-pushed the philipp/gh54-eslint-v9 branch from 85dcf2f to fe1dbb3 Compare March 15, 2026 18:07
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.

1 participant