fix(no-meaningless-void-operator): align with typescript-eslint union handling#887
Conversation
How to use the Graphite Merge QueueAdd the label 0-merge to this PR to add it to 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
Adjusts no-meaningless-void-operator type analysis to match typescript-eslint behavior when the void operand has a union type, fixing a reported mismatch (oxc-project/oxc#21373).
Changes:
- Replaces flag-intersection masking with explicit “all union constituents are void-like” / “all constituents are void-like or never” checks.
- Adds a regression test covering optional chaining returning a
void | undefinedunion. - Updates the corresponding rule-tester snapshot output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/rules/no_meaningless_void_operator/no_meaningless_void_operator.go | Updates union handling logic to use Every + IsTypeFlagSet checks instead of flag intersection. |
| internal/rules/no_meaningless_void_operator/no_meaningless_void_operator_test.go | Adds an invalid case for void foo?.() where the call returns `void |
| internal/rule_tester/snapshots/no-meaningless-void-operator.snap | Records the new expected diagnostic for the added test case. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
7951b2f to
6dcc81a
Compare

fixes oxc-project/oxc#21373