Skip to content

fix(no-useless-default-assignment): make default assignment removal a suggestion#907

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/no-useless-default-assignment-suggestion
Apr 24, 2026
Merged

fix(no-useless-default-assignment): make default assignment removal a suggestion#907
graphite-app[bot] merged 1 commit into
mainfrom
codex/no-useless-default-assignment-suggestion

Conversation

@camc314

@camc314 camc314 commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Fixes oxc-project/oxc#21716

Although this being a fix aligns with the type system, it could technically break users if their runtime values don't match their typescript types.

@camc314 camc314 marked this pull request as ready for review April 24, 2026 19:35
Copilot AI review requested due to automatic review settings April 24, 2026 19:35
@camc314 camc314 changed the title fix: suggest default assignment removal fix(no-useless-default-assignment): make default assignment removal a suggestion Apr 24, 2026
@camc314 camc314 self-assigned this Apr 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates no-useless-default-assignment to emit a fix as a suggestion (instead of an auto-applied fix), aligning with the goal of “suggest default assignment removal” for oxc-project/oxc#21716.

Changes:

  • Switch uselessDefaultAssignment reporting from FixesPtr to ReportDiagnosticWithSuggestions, attaching a removeDefaultAssignment suggestion.
  • Update rule tester cases to assert suggestions (instead of Output auto-fix expectations) for uselessDefaultAssignment.
  • Refresh rule-tester and e2e snapshots to reflect the new suggestions structure.

Reviewed changes

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

File Description
internal/rules/no_useless_default_assignment/no_useless_default_assignment.go Reports uselessDefaultAssignment with a removal suggestion rather than an auto-fix.
internal/rules/no_useless_default_assignment/no_useless_default_assignment_test.go Migrates affected invalid test cases from Output to Suggestions.
internal/rule_tester/snapshots/no-useless-default-assignment.snap Snapshot updates to include suggestion rendering.
e2e/snapshots/snapshot.test.ts.snap E2E snapshot updates: diagnostic fixes moved under suggestions[].fixes.

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

camc314 commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

… suggestion (#907)

Fixes oxc-project/oxc#21716

Although this being a fix aligns with the type system, it could technically break users if their runtime values don't match their typescript types.
@graphite-app graphite-app Bot force-pushed the codex/no-useless-default-assignment-suggestion branch from 3477f56 to 05314ff Compare April 24, 2026 19:42
@graphite-app graphite-app Bot merged commit 05314ff into main Apr 24, 2026
9 checks passed
@graphite-app graphite-app Bot removed the 0-merge label Apr 24, 2026
@graphite-app graphite-app Bot deleted the codex/no-useless-default-assignment-suggestion branch April 24, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: typescript-eslint(no-useless-default-assignment) unsafe fix

2 participants