test(linter/plugins): conformance tester set languageOptions.ecmaVersion#16754
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
16279b9 to
46cf9a7
Compare
19c0c0d to
4f9d17f
Compare
46cf9a7 to
c71329f
Compare
c71329f to
3e9dd9d
Compare
3e9dd9d to
0beaa75
Compare
0beaa75 to
21cf429
Compare
Merge activity
|
…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.
21cf429 to
58f6b00
Compare
There was a problem hiding this comment.
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.ecmaVersionin 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.

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