Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
8.28.0
What version of eslint-plugin-svelte
are you using?
2.14.1
What did you do?
Configuration
module.exports = {
root: true,
plugins: ['svelte', '@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
extraFileExtensions: ['.svelte']
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended'
],
ignorePatterns: [
'tests',
'playwright.config.ts',
'svelte.config.js',
'*.cjs'
],
settings: {
svelte: {
kit: {
files: {
routes: 'src/routes'
}
}
}
},
env: {
browser: true,
node: true
}
};
<script lang="ts">
import Header from './Header.svelte';
let myvar = 100;
myvar = '100';
console.log(myvar);
</script>
What did you expect to happen?
The linter should throw error in the Svelte component since there is a type check error.
What actually happened?
No error was thrown.
Link to GitHub Repo with Minimal Reproducible Example
SvelteKit project with ESLint, TypeScript, and eslint-plugin-svelte: https://github.com/romelperez/sveltekit-app-eslint-plugin-svelte
You can run:
npm install
npm run build
npm run lint
Additional comments
Thank you!
Metadata
Metadata
Assignees
Labels
No labels