sveltejs / eslint-plugin-svelte

ESLint plugin for Svelte using AST
https://sveltejs.github.io/eslint-plugin-svelte/
MIT License
308 stars 37 forks source link

New rule: `svelte/no-$inspect` #812

Closed baseballyama closed 1 month ago

baseballyama commented 5 months ago

Motivation

THe motivation is same as svelte/no-at-debug-tags.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