test(no-useless-default-assignment): add issue #727 regression#729
test(no-useless-default-assignment): add issue #727 regression#729
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
This PR adds a regression test for issue #727 to the no-useless-default-assignment rule. The test verifies that the rule correctly detects and fixes useless default assignments when destructuring properties that are never nullish.
Changes:
- Added a new invalid test case that creates a config object with a
rulesproperty of type{}, then destructures it with a redundant default value - Updated the snapshot file to include the expected diagnostic output for the new test case
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/rules/no_useless_default_assignment/no_useless_default_assignment_test.go | Adds test case demonstrating that the rule correctly identifies useless default assignment when destructuring a property with type {} |
| internal/rule_tester/snapshots/no-useless-default-assignment.snap | Updates snapshot with expected diagnostic output showing the rule detects the useless default at line 4, column 25-26 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

No description provided.