New rule: svelte/prefer-derived-over-derived-by
From a consistency perspective, this rule reports unnecessary usage of $derived.by
. There is no performance difference. It purely enforces a consistent coding style. Even if included in recommended config, a warning level should be sufficient.
This rule reports unnecessary usage of $derived.by
. It also provides a fixer to automatically convert $derived.by
to $derived
.
<script>
// ✓ GOOD
const foo = $derived(a.b);
// ✗ BAD
const bar = $derived.by(() => a.b);
</script>
No response