Svelte

New rule: svelte/no-$inspect

#812

Development PR

Issue

Solved
B
baseballyama
Jun 30, 2024, 7:53 AM

Motivation

THe motivation is same as .the

Description

The $inspect should be removed when you no longer need it after you use it for debugging.

Examples

<script>
	let count = $state(0);
	let message = $state('hello');
        <!--BAD -->
	$inspect(count, message); // will console.log when `count` or `message` change
</script>

<button onclick={() => count++}>Increment</button>
<input bind:value={message} />

Additional comments

No response

Info

Closed at Oct 16, 2024, 1:52 PM
Assignees None
Labels enhancement, new rule
Milestone None

Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)