Skip to content

Enable no-unnecessary-template-expression - #307

Merged
ryanhugh merged 5 commits into
mainfrom
claude/round4-template-expression
Aug 13, 2026
Merged

Enable no-unnecessary-template-expression#307
ryanhugh merged 5 commits into
mainfrom
claude/round4-template-expression

Conversation

@ryanhugh

Copy link
Copy Markdown
Member

Turns on @typescript-eslint/no-unnecessary-template-expression in the type-aware rules block. It flags a template literal whose only content is a single interpolation of something already typed string — the backticks and ${} are doing no work.

1 violation, auto-fixable, fixed by eslint --fix.

Per-fix behavior analysis

scrapers/myChart/proxyTools.ts:174, in the message runSwitchProxyTarget returns:

-  `${result.target.isSelf ? '' : ' Switch back with patient: "me" when done.'}`,
+  (result.target.isSelf ? '' : ' Switch back with patient: "me" when done.'),

The ternary yields a string in both branches, so the template wrapper was an identity operation — `${s}` is s for any string s. The concatenation that consumes it produces the same characters either way. The two adjacent lines in the same expression keep their templates, correctly: they interpolate alongside literal text, so the rule leaves them alone.

Purely cosmetic; the emitted strings are identical.

Verification

  • npx eslint . clean
  • bun run typecheck clean
  • cd expo-app && bun run typecheck clean
  • bun run test — 1517 pass, 0 fail

🤖 Generated with Claude Code

ryanhugh and others added 2 commits August 13, 2026 13:55
One template literal wrapped a lone ternary that already produced a
string. Autofix replaced it with the parenthesized expression; the
concatenation result is byte-identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryanhugh
ryanhugh enabled auto-merge (squash) August 13, 2026 19:18
@ryanhugh
ryanhugh merged commit 444e28d into main Aug 13, 2026
2 checks passed
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.

1 participant