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
This commit is contained in:
1
bun.lock
1
bun.lock
@@ -37,6 +37,7 @@
|
|||||||
"prettier-plugin-svelte": "^3.3.3",
|
"prettier-plugin-svelte": "^3.3.3",
|
||||||
"svelte": "^5.43.8",
|
"svelte": "^5.43.8",
|
||||||
"svelte-check": "^4.3.4",
|
"svelte-check": "^4.3.4",
|
||||||
|
"svelte-eslint-parser": "^1.6.0",
|
||||||
"tailwindcss": "^4.1.17",
|
"tailwindcss": "^4.1.17",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import js from '@eslint/js';
|
|||||||
import ts from 'typescript-eslint';
|
import ts from 'typescript-eslint';
|
||||||
import svelte from 'eslint-plugin-svelte';
|
import svelte from 'eslint-plugin-svelte';
|
||||||
import globals from 'globals';
|
import globals from 'globals';
|
||||||
|
import svelteParser from 'svelte-eslint-parser';
|
||||||
|
|
||||||
/** @type {import('eslint').Linter.Config[]} */
|
/** @type {import('eslint').Linter.Config[]} */
|
||||||
export default [
|
export default [
|
||||||
@@ -21,6 +22,7 @@ export default [
|
|||||||
'svelte/no-navigation-without-base': 'off'
|
'svelte/no-navigation-without-base': 'off'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Configuration for .svelte files
|
||||||
{
|
{
|
||||||
files: ['**/*.svelte'],
|
files: ['**/*.svelte'],
|
||||||
languageOptions: {
|
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/']
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
"prettier-plugin-svelte": "^3.3.3",
|
"prettier-plugin-svelte": "^3.3.3",
|
||||||
"svelte": "^5.43.8",
|
"svelte": "^5.43.8",
|
||||||
"svelte-check": "^4.3.4",
|
"svelte-check": "^4.3.4",
|
||||||
|
"svelte-eslint-parser": "^1.6.0",
|
||||||
"tailwindcss": "^4.1.17",
|
"tailwindcss": "^4.1.17",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user