Skip to content

test(linter/plugins): conformance tester set languageOptions.ecmaVersion#16754

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_
Dec 11, 2025
Merged

test(linter/plugins): conformance tester set languageOptions.ecmaVersion#16754
graphite-app[bot] merged 1 commit intomainfrom
12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 11, 2025

In conformance tester, populate context.languageOptions.ecmaVersion from config/test case. Some rules alter behavior depending on ecmaVersion, so we need to set it to pass some of those tests.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Dec 11, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@overlookmotel overlookmotel self-assigned this Dec 11, 2025
@graphite-app graphite-app bot changed the base branch from 12-11-refactor_linter_plugins_simplify_debug_assertions to graphite-base/16754 December 11, 2025 13:11
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch from 16279b9 to 46cf9a7 Compare December 11, 2025 13:16
@graphite-app graphite-app bot force-pushed the graphite-base/16754 branch from 19c0c0d to 4f9d17f Compare December 11, 2025 13:16
@graphite-app graphite-app bot changed the base branch from graphite-base/16754 to main December 11, 2025 13:16
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch from 46cf9a7 to c71329f Compare December 11, 2025 13:16
@graphite-app graphite-app bot changed the base branch from main to graphite-base/16754 December 11, 2025 14:30
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch from c71329f to 3e9dd9d Compare December 11, 2025 14:37
@graphite-app graphite-app bot changed the base branch from graphite-base/16754 to main December 11, 2025 14:37
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch from 3e9dd9d to 0beaa75 Compare December 11, 2025 14:38
@overlookmotel overlookmotel force-pushed the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch from 0beaa75 to 21cf429 Compare December 11, 2025 15:59
@overlookmotel overlookmotel marked this pull request as ready for review December 11, 2025 16:20
Copilot AI review requested due to automatic review settings December 11, 2025 16:20
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025

Merge activity

  • Dec 11, 4:21 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 11, 4:21 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Dec 11, 4:22 PM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Spell Check').
  • Dec 11, 5:06 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 11, 5:06 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Dec 11, 5:06 PM UTC: Merged by the Graphite merge queue.

…sion` (#16754)

In conformance tester, populate `context.languageOptions.ecmaVersion` from config/test case. Some rules alter behavior depending on `ecmaVersion`, so we need to set it to pass some of those tests.
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch from 21cf429 to 58f6b00 Compare December 11, 2025 16:21
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for languageOptions.ecmaVersion in the conformance tester to enable passing tests for ESLint rules that alter their behavior based on the ECMAScript version. The implementation uses a conditional compilation pattern with the CONFORMANCE flag to dynamically set the ecmaVersion through a getter, avoiding changes to production builds.

Key changes:

  • Implemented a dynamic getter for context.languageOptions.ecmaVersion in conformance builds
  • Added logic to extract and normalize ecmaVersion from test configurations
  • Fixed 16 previously failing conformance tests across 3 rules

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/oxlint/src-js/plugins/context.ts Exported ECMA_VERSION constant and implemented dynamic ecmaVersion getter for CONFORMANCE builds using Object.defineProperty
apps/oxlint/src-js/package/rule_tester.ts Added setEcmaVersionContext function to parse and normalize ecmaVersion from test cases, integrated it into the lint workflow
apps/oxlint/conformance/snapshot.md Updated test results showing 16 additional tests passing, with 2 more rules fully passing (func-name-matching, no-inner-declarations) and comma-dangle improving from 91.0% to 96.3%

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
@graphite-app graphite-app bot merged commit 58f6b00 into main Dec 11, 2025
32 of 33 checks passed
@graphite-app graphite-app bot deleted the 12-11-test_linter_plugins_conformance_tester_set_languageoptions.ecmaversion_ branch December 11, 2025 17:06
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants