Skip to content

Eslint not running in script tags #14266

@tylermcrobert

Description

@tylermcrobert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions