Skip to content

test(linter/plugins): fix tests for RuleTester ignoreNonFatalErrors option#18196

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

test(linter/plugins): fix tests for RuleTester ignoreNonFatalErrors option#18196
graphite-app[bot] merged 1 commit intomainfrom
om/01-18-test_linter_plugins_fix_tests_for_ruletester_ignorenonfatalerrors_option

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 18, 2026

#18124 altered the tests for RuleTester's ignoreNonFatalErrors option. It made the tests pass with the change to unambiguous-style parsing, but buggered them up in the process! Many of the tests weren't testing anything useful any more. Fix them.

@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 18, 2026
Copy link
Member Author

overlookmotel commented Jan 18, 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.

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 fixes broken tests for the RuleTester's ignoreNonFatalErrors option that were incorrectly modified in #18124. After the introduction of unambiguous module parsing, these tests were no longer actually testing the intended behavior because duplicate function parameters (used as the test case) are only errors in strict/module mode, not in script mode.

Changes:

  • Added explicit sourceType: "module" settings to ensure duplicate parameter errors are triggered in all ignoreNonFatalErrors tests
  • Consolidated sourceType settings at the RuleTester constructor level instead of scattered across global configs and individual test cases
  • Added an additional test case ("import x from 'foo';") to the unambiguous parsing test to ensure both script-compatible and module-only syntax are tested

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

@overlookmotel overlookmotel self-assigned this Jan 18, 2026
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
Copy link
Member Author

overlookmotel commented Jan 18, 2026

Merge activity

@graphite-app graphite-app bot changed the base branch from om/01-18-fix_linter_plugins_rule_tester_default_to_module_source_type_in_eslint_compat_mode to graphite-base/18196 January 18, 2026 23:02
@graphite-app graphite-app bot changed the base branch from graphite-base/18196 to main January 18, 2026 23:08
…s` option (#18196)

#18124 altered the tests for `RuleTester`'s `ignoreNonFatalErrors` option. It made the tests pass with the change to unambiguous-style parsing, but buggered them up in the process! Many of the tests weren't testing anything useful any more. Fix them.
@graphite-app graphite-app bot force-pushed the om/01-18-test_linter_plugins_fix_tests_for_ruletester_ignorenonfatalerrors_option branch from 4d0e4d0 to ff4edd2 Compare January 18, 2026 23:09
@graphite-app graphite-app bot merged commit ff4edd2 into main Jan 18, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/01-18-test_linter_plugins_fix_tests_for_ruletester_ignorenonfatalerrors_option branch January 18, 2026 23:15
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
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.

1 participant

Comments