Skip to content

fix: add explicit string coercions for template expressions#505

Merged
gka merged 2 commits intomainfrom
fix/no-base-to-string
Mar 2, 2026
Merged

fix: add explicit string coercions for template expressions#505
gka merged 2 commits intomainfrom
fix/no-base-to-string

Conversation

@ljodea
Copy link
Copy Markdown
Collaborator

@ljodea ljodea commented Feb 27, 2026

Summary

  • Fixes all 8 no-base-to-string and 8 restrict-template-expressions oxlint warnings (16 total)
  • Adds explicit type casts (as string) or String() wrapping to template literal expressions where the type includes non-stringifiable members (e.g. MapIndexObject)
  • Casts context to Path in trail.ts for explicit .toString() calls

Files changed

  • src/lib/transforms/normalize.ts — cast basis to string in switch/error (4 warnings)
  • src/lib/transforms/map.ts — cast map to string in switch/error (4 warnings)
  • src/lib/transforms/stack.ts — narrow resolveChannel() return for String() (1 warning)
  • src/lib/helpers/autoScales.ts — narrow domain value for String() (1 warning)
  • src/lib/marks/helpers/trail.ts — cast context to Path for .toString() (2 warnings)
  • src/lib/marks/helpers/waffle.ts — wrap round with String() (1 warning)
  • scripts/generate-api.js — wrap unknowns with String() (2 warnings)
  • scripts/visual-regression.js — wrap unknown with String() (1 warning)

Test plan

  • pnpm exec oxlint --type-aware — 0 no-base-to-string / restrict-template-expressions warnings
  • pnpm test — all tests pass
  • pnpm check — 0 svelte-check errors

🤖 Generated with Claude Code

- Cast union types to string in switch/template expressions to satisfy
  no-base-to-string and restrict-template-expressions oxlint rules
- Cast d3-path Path context for explicit .toString() calls in trail.ts
- Wrap unknown types with String() in scripts

Fixes all 16 no-base-to-string and restrict-template-expressions warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 27, 2026

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 9143208
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/69a1f69ab1e82000087af2e8
😎 Deploy Preview https://deploy-preview-505--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gka gka merged commit eb395dd into main Mar 2, 2026
9 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.

2 participants