noSvelteInspect (JavaScript)
Language JavaScript (and super languages)
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noSvelteInspect - This rule doesn’t have a fix.
- The default severity of this rule is warning.
- This rule belongs to the following domains:
- Sources:
- Same as
svelte/no-inspect
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noSvelteInspect": "error" } } }}Description
Section titled “Description”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().
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<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>References
Section titled “References”Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.