Skip to content

types: Fix svelte-check issues in Brush.svelte#486

Merged
gka merged 1 commit intomainfrom
types/svelte-check-brush-mark
Feb 22, 2026
Merged

types: Fix svelte-check issues in Brush.svelte#486
gka merged 1 commit intomainfrom
types/svelte-check-brush-mark

Conversation

@gka
Copy link
Copy Markdown
Contributor

@gka gka commented Feb 22, 2026

resolves #442

Summary

  • Fixes all svelte-check type errors in src/lib/marks/Brush.svelte (12 errors → 0) and src/tests/brush.test.svelte (1 error → 0)
  • Exports the Brush type via a <script module> block so it can be imported by tests and consumers
  • Narrows invert() return casts from RawValue to number | Date throughout
  • Adds explicit tuple return type to swapIfNeeded() to fix destructuring type inference
  • No runtime behavior changes

Test plan

  • pnpm check — no errors in Brush.svelte or brush.test.svelte
  • pnpm lint — passes (Prettier + ESLint)
  • pnpm test — all 666 tests pass

🤖 Generated with Claude Code

- Add <script module> block to export Brush type (fixes brush.test.svelte import)
- Remove duplicate local Brush type definition
- Change $derived type from BrushMarkProps to Omit<BrushMarkProps, 'brush'>
  since brush is already destructured from $props()
- Remove erroneous data destructuring (not a BrushMarkProps property)
- Cast xScaleFn.invert()/yScaleFn.invert() results as number | Date throughout
  (PlotScaleFunction.invert returns RawValue which is too broad)
- Add explicit return type [number | Date, number | Date, ActionType] to
  swapIfNeeded() to enable proper tuple destructuring
- Cast onpointerdown/onpointermove as any when passing to Frame (Brush's
  (e: MouseEvent) handlers don't match MarkEventHandler signature)

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

netlify bot commented Feb 22, 2026

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 71818dd
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/699b0ecff080e00008961585
😎 Deploy Preview https://deploy-preview-486--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.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions
Copy link
Copy Markdown

📦 Preview package for this PR is published!

Version: 0.10.3-pr-486.0

Install it with:

npm install svelteplot@pr-486
# or install the specific version
npm install svelteplot@0.10.3-pr-486.0

@gka gka merged commit cd7968f into main Feb 22, 2026
9 checks passed
@gka gka deleted the types/svelte-check-brush-mark branch February 22, 2026 17:18
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.

[svelte-check] Fix errors in src/lib/marks/Rect.svelte

1 participant