Skip to content

noSvelteInspect (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noSvelteInspect": "error"
}
}
}
}

Disallow the use of the $inspect rune.

$inspect is a debugging aid: it logs values to the console every time they change. It only works during development and becomes a no-op in production builds, so calls to it are usually leftovers from a debugging session that clutter the console and the code.

The rule reports every use of $inspect, including $inspect(...).with(...) and $inspect.trace().

<script>
let count = $state(0);
$inspect(count);
</script>
code-block.svelte:3:1 lint/nursery/noSvelteInspect ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ Unexpected use of the $inspect rune.

1 │ <script>
2 │ let count = $state(0);
> 3 │ $inspect(count);
│ ^^^^^^^^
4 │ </script>
5 │

ℹ $inspect is a debugging aid that logs values to the console during development, and is usually left over from a debugging session.

ℹ Remove the $inspect call once you're done debugging.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<script>
$effect(() => {
$inspect.trace();
});
</script>
code-block.svelte:3:5 lint/nursery/noSvelteInspect ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ Unexpected use of the $inspect rune.

1 │ <script>
2 │ $effect(() => {
> 3 │ $inspect.trace();
│ ^^^^^^^^
4 │ });
5 │ </script>

ℹ $inspect is a debugging aid that logs values to the console during development, and is usually left over from a debugging session.

ℹ Remove the $inspect call once you're done debugging.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<script>
let count = $state(0);
</script>