sveltejs / svelte

web development for the rest of us
https://svelte.dev
MIT License
80.16k stars 4.26k forks source link

Eslint not running in script tags #14266

Closed tylermcrobert closed 1 week ago

tylermcrobert commented 1 week ago

Describe the bug

When looking at the following:

<script lang="ts">
    import { onMount } from 'svelte';

    function sayHi() {
        console.log('hi');
    }
</script>

<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>

I should be seeing Eslint errors that complain about no-unused-vars. I've also configured my eslint with the no-console rule that should also be triggered. Removing lang="ts" does not fix the issue

Reproduction

REPL here

Note, I'm not sure if REPL will show any eslint errors at all, you may have to download it.

Logs

No response

System Info

System:
    OS: macOS 15.0
    CPU: (12) arm64 Apple M2 Pro
    Memory: 250.58 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.1.0 - /usr/local/bin/npm
    pnpm: 8.7.6 - /usr/local/bin/pnpm
  Browsers:
    Brave Browser: 123.1.64.122
    Chrome: 130.0.6723.117
    Safari: 18.0
  npmPackages:
    svelte: ^5.1.4 => 5.1.4

Severity

annoyance

Ocean-OS commented 1 week ago

Not entirely sure, but I think this should be in the language-tools repo.

benmccann commented 1 week ago

Are you using eslint-plugin-svelte? If not, you should. If you are, please file any issues there