From 6ae82d758e14e7d3957932031959bd7b783eb498 Mon Sep 17 00:00:00 2001 From: Rasmus Q Date: Sun, 15 Mar 2026 21:15:59 +0000 Subject: [PATCH] config: properly configure ESLint for .svelte.ts files - Install svelte-eslint-parser package - Add dedicated ESLint configuration for .svelte.ts files - Configure Svelte parser with TypeScript support for runes - Remove file ignores - all source files are now properly linted --- bun.lock | 1 + eslint.config.js | 14 +++++++++++++- package.json | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bun.lock b/bun.lock index cd93c41..bc92e44 100644 --- a/bun.lock +++ b/bun.lock @@ -37,6 +37,7 @@ "prettier-plugin-svelte": "^3.3.3", "svelte": "^5.43.8", "svelte-check": "^4.3.4", + "svelte-eslint-parser": "^1.6.0", "tailwindcss": "^4.1.17", "tw-animate-css": "^1.4.0", "typescript": "^5.9.3", diff --git a/eslint.config.js b/eslint.config.js index db9c541..79b1151 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,6 +2,7 @@ import js from '@eslint/js'; import ts from 'typescript-eslint'; import svelte from 'eslint-plugin-svelte'; import globals from 'globals'; +import svelteParser from 'svelte-eslint-parser'; /** @type {import('eslint').Linter.Config[]} */ export default [ @@ -21,6 +22,7 @@ export default [ 'svelte/no-navigation-without-base': 'off' } }, + // Configuration for .svelte files { files: ['**/*.svelte'], languageOptions: { @@ -29,7 +31,17 @@ export default [ } } }, + // Configuration for .svelte.ts files (Svelte runes in TypeScript) { - ignores: ['build/', '.svelte-kit/', 'dist/', '**/*.svelte.ts'] + files: ['**/*.svelte.ts'], + languageOptions: { + parser: svelteParser, + parserOptions: { + parser: ts.parser + } + } + }, + { + ignores: ['build/', '.svelte-kit/', 'dist/'] } ]; diff --git a/package.json b/package.json index 6b5de4f..26a16be 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "prettier-plugin-svelte": "^3.3.3", "svelte": "^5.43.8", "svelte-check": "^4.3.4", + "svelte-eslint-parser": "^1.6.0", "tailwindcss": "^4.1.17", "tw-animate-css": "^1.4.0", "typescript": "^5.9.3",