test(linter/plugins): fix tests for RuleTester ignoreNonFatalErrors option#18196
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. |
There was a problem hiding this comment.
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 allignoreNonFatalErrorstests - Consolidated
sourceTypesettings at theRuleTesterconstructor 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.
Merge activity
|
4d0e4d0 to
ff4edd2
Compare

#18124 altered the tests for
RuleTester'signoreNonFatalErrorsoption. 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.