Skip to content

feat(no-unnecessary-template-expression): implement fix#911

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/no-unnecessary-template-expression-fix
Apr 26, 2026
Merged

feat(no-unnecessary-template-expression): implement fix#911
graphite-app[bot] merged 1 commit into
mainfrom
codex/no-unnecessary-template-expression-fix

Conversation

@camc314

@camc314 camc314 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

part of #668

Implements the fixer and regression tests.

Copilot AI review requested due to automatic review settings April 25, 2026 11:24

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

Implements an auto-fixer for the no-unnecessary-template-expression rule (part of #668) and updates/extends regression tests to validate the produced fixes.

Changes:

  • Added fix generation for unnecessary template interpolations, including escaping/normalization handling for tricky literals (numbers, bigint, regex, nested templates, ${/` cases).
  • Updated rule tester cases to assert concrete Output values for invalid cases (including multi-pass fix outputs where applicable).
  • Updated snapshot expectations for newly added invalid test cases.

Reviewed changes

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

File Description
internal/rules/no_unnecessary_template_expression/no_unnecessary_template_expression.go Adds fixer implementation and supporting helpers (escaping and canonicalization) for no-unnecessary-template-expression.
internal/rules/no_unnecessary_template_expression/no_unnecessary_template_expression_test.go Converts previously commented-out expected outputs into asserted Output fields and adds new regression cases for numeric canonicalization and precedence.
internal/rule_tester/snapshots/no-unnecessary-template-expression.snap Extends snapshot coverage for new invalid test cases added in the rule tests.

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

@camc314 camc314 force-pushed the codex/no-unnecessary-template-expression-fix branch 2 times, most recently from 8b5a41d to d06576d Compare April 26, 2026 11:51
@camc314 camc314 self-assigned this Apr 26, 2026

camc314 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

part of #668

Implements the fixer and regression tests.
@graphite-app graphite-app Bot force-pushed the codex/no-unnecessary-template-expression-fix branch from d06576d to 73c15a2 Compare April 26, 2026 12:00
@graphite-app graphite-app Bot merged commit 73c15a2 into main Apr 26, 2026
9 checks passed
@graphite-app graphite-app Bot deleted the codex/no-unnecessary-template-expression-fix branch April 26, 2026 12:08
@graphite-app graphite-app Bot removed the 0-merge label Apr 26, 2026
graphite-app Bot pushed a commit to oxc-project/oxc that referenced this pull request Apr 26, 2026
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.

2 participants