nursery/noSvelteUselessDerivedBy
nursery · since 2.6.0
Safe autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"noSvelteUselessDerivedBy": "error"
}
}
}
}<script>
let count = $state(0);
const doubled = $derived.by(() => count * 2);
</script><script>
let count = $state(0);
const doubled = $derived.by(() => {
return count * 2;
});
</script><script>
let count = $state(0);
const doubled = $derived(count * 2);
const doubledPlusOne = $derived.by(() => {
const doubled = count * 2;
return doubled + 1;
});
</script>Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/noSvelteUselessDerivedBy
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"noSvelteUselessDerivedBy": "error"
}
}
}
}Disallow unnecessary $state wrapping of reactive classes.
Enforces the usage of the title element for the svg element.
Disallow objects, arrays, functions, and classes in Svelte text mustaches.
Disallow Tailwind CSS classes that set the same CSS properties on an element.
Disallow Tailwind CSS utility classes that Tailwind CSS only keeps for backward compatibility.