fix: resolve remaining oxlint warnings#506
Conversation
- unbound-method: keep Intl.DateTimeFormat instance instead of detaching
.format method (autoTimeFormat.ts)
- require-array-sort-compare: add explicit comparators (scales.ts,
visual-regression.js)
- no-unused-vars: prefix unused formatIntervals with _ (time.ts)
- no-unsafe-optional-chaining: add nullish fallbacks for spread (Plot.svelte)
- no-useless-fallback-in-spread: add oxlint-disable comments where TS
requires ?? {} for Map.get() (shift-map.svelte, spike-map.svelte)
- no-self-assign: use spread assignment instead of push + self-assign
for Svelte reactivity (TabPanel.svelte)
Fixes the final 11 oxlint warnings.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
| ...feat, | ||
| properties: { | ||
| ...feat.properties, | ||
| // oxlint-disable-next-line unicorn/no-useless-fallback-in-spread -- TS requires ?? {} for Map.get() |
There was a problem hiding this comment.
these are a bit unfortunate as they complicate the examples code which is meant to help new users understand how SveltePlot works.
There was a problem hiding this comment.
I had to add a poor-mans TS removal step for the same reason, perhaps we can extend it to remove these linter comments?
There was a problem hiding this comment.
Makes sense. Will add this!
There was a problem hiding this comment.
this is where it would fit, for instance
svelteplot/src/routes/examples/[group]/[page]/replUtils.ts
Lines 80 to 85 in cf244c3
There was a problem hiding this comment.
I'll add the filter in a subsequent PR
Summary
Fixes the final 11 oxlint warnings across 6 rules:
Intl.DateTimeFormatinstance instead of detaching.formatmethod.toSorted()/.sort()?? []fallback before spreading optional chain resultsoxlint-disablecomments where TypeScript requires?? {}forMap.get()formatIntervalswith_push()+ self-assign for Svelte reactivityFiles changed
src/lib/helpers/autoTimeFormat.tssrc/lib/helpers/scales.tssrc/lib/helpers/time.tssrc/lib/core/Plot.sveltesrc/theme/components/TabPanel.sveltesrc/routes/examples/vector/shift-map.sveltesrc/routes/examples/vector/spike-map.sveltescripts/visual-regression.jsTest plan
pnpm exec oxlint --type-aware— 0 warnings for these 6 rulespnpm test— all tests passpnpm check— 0 svelte-check errors🤖 Generated with Claude Code