Skip to content

test(linter/plugins): handle globalReturn and impliedStrict options in conformance tests#18307

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-20-test_linter_plugins_handle_globalreturn_and_impliedstrict_options_in_conformance_tests
Jan 20, 2026
Merged

test(linter/plugins): handle globalReturn and impliedStrict options in conformance tests#18307
graphite-app[bot] merged 1 commit intomainfrom
om/01-20-test_linter_plugins_handle_globalreturn_and_impliedstrict_options_in_conformance_tests

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 20, 2026

Closes #16862.

In conformance tests, support globalReturn and impliedStrict options. This fixes ~40 failing tests.

This PR does not add these options to actually linter, because Oxlint doesn't provide a way to set these options through config.

Ideally, we would support these options in RuleTester in eslintCompat mode, but that would add extra code to the main linter implementation. We can do that when we move RuleTester into its own package.

Copy link
Member Author

overlookmotel commented Jan 20, 2026


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.

@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 Jan 20, 2026
@overlookmotel overlookmotel marked this pull request as ready for review January 20, 2026 18:23
Copilot AI review requested due to automatic review settings January 20, 2026 18:23
@overlookmotel overlookmotel self-assigned this Jan 20, 2026
@overlookmotel overlookmotel removed the request for review from camc314 January 20, 2026 18:24
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jan 20, 2026
Copy link
Member Author

overlookmotel commented Jan 20, 2026

Merge activity

…ns in conformance tests (#18307)

Closes #16862.

In conformance tests, support `globalReturn` and `impliedStrict` options. This fixes ~40 failing tests.

This PR does not add these options to actually linter, because Oxlint doesn't provide a way to set these options through config.

Ideally, we *would* support these options in `RuleTester` in `eslintCompat` mode, but that would add extra code to the main linter implementation. We can do that when we move `RuleTester` into its own package.
Copy link
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 the globalReturn and impliedStrict parser options in conformance tests to fix approximately 40 failing tests. These options affect how the scope analyzer interprets the code (allowing top-level return statements and treating code as strict mode), but are only enabled in the conformance test build and not in the main linter.

Changes:

  • Added analyzeOptionsOverride object in scope.ts to allow runtime overriding of globalReturn and impliedStrict options during conformance tests
  • Modified setEcmaVersionContext to setEcmaVersionAndFeatures to extract and apply these parser options from test case configuration
  • Updated type definitions in tester.ts to allow these properties in test case configurations

Reviewed changes

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

File Description
apps/oxlint/src-js/plugins/scope.ts Adds override mechanism for globalReturn and impliedStrict options guarded by CONFORMANCE flag
apps/oxlint/src-js/package/rule_tester.ts Extracts parser options from test cases and applies them to scope analyzer, renames function to reflect expanded functionality
apps/oxlint/conformance/tester.ts Updates type definitions to allow globalReturn and impliedStrict in test case configurations
apps/oxlint/conformance/snapshot.md Shows test pass rate improvements: 2 more rules fully passing, 42 more tests passing overall

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

@graphite-app graphite-app bot force-pushed the om/01-20-fix_linter_plugins_set_scope_analyse_settings_based_on_source_type branch from 43627ec to 44be0eb Compare January 20, 2026 18:26
@graphite-app graphite-app bot force-pushed the om/01-20-test_linter_plugins_handle_globalreturn_and_impliedstrict_options_in_conformance_tests branch from 355e6c9 to 4e24692 Compare January 20, 2026 18:26
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 20, 2026
Base automatically changed from om/01-20-fix_linter_plugins_set_scope_analyse_settings_based_on_source_type to main January 20, 2026 18:32
@graphite-app graphite-app bot merged commit 4e24692 into main Jan 20, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/01-20-test_linter_plugins_handle_globalreturn_and_impliedstrict_options_in_conformance_tests branch January 20, 2026 18:33
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.

linter/plugins: Handle/disable rule tests using impliedStrict

2 participants