44import typescriptEslint from '@typescript-eslint/eslint-plugin' ;
55import globals from 'globals' ;
66import tsParser from '@typescript-eslint/parser' ;
7- import parser from 'svelte-eslint-parser' ;
8- import path from 'node:path' ;
9- import { fileURLToPath } from 'node:url' ;
7+ import svelteParser from 'svelte-eslint-parser' ;
8+ import sveltePlugin from 'eslint-plugin-svelte' ;
109import js from '@eslint/js' ;
11- import { FlatCompat } from '@eslint/eslintrc' ;
12-
13- const __filename = fileURLToPath ( import . meta. url ) ;
14- const __dirname = path . dirname ( __filename ) ;
15- const compat = new FlatCompat ( {
16- baseDirectory : __dirname ,
17- recommendedConfig : js . configs . recommended ,
18- allConfig : js . configs . all ,
19- } ) ;
2010
2111export default [
2212 {
@@ -40,12 +30,8 @@ export default [
4030 'prisma/.fabbrica/index.ts' ,
4131 ] ,
4232 } ,
43- ...compat . extends (
44- 'eslint:recommended' ,
45- 'plugin:@typescript-eslint/recommended' ,
46- 'plugin:svelte/recommended' ,
47- 'prettier' ,
48- ) ,
33+ js . configs . recommended ,
34+ ...sveltePlugin . configs [ 'flat/recommended' ] ,
4935 {
5036 plugins : {
5137 '@typescript-eslint' : typescriptEslint ,
@@ -55,6 +41,13 @@ export default [
5541 globals : {
5642 ...globals . browser ,
5743 ...globals . node ,
44+ // Add Svelte 5 runes as global variables
45+ $state : 'readonly' ,
46+ $derived : 'readonly' ,
47+ $effect : 'readonly' ,
48+ $props : 'readonly' ,
49+ $bindable : 'readonly' ,
50+ $inspect : 'readonly' ,
5851 } ,
5952
6053 parser : tsParser ,
@@ -74,13 +67,21 @@ export default [
7467 'ts-ignore' : false ,
7568 } ,
7669 ] ,
70+ // Add TypeScript ESLint rules manually
71+ '@typescript-eslint/no-unused-vars' : [ 'error' , { argsIgnorePattern : '^_' } ] ,
72+ '@typescript-eslint/no-explicit-any' : 'warn' ,
73+ // Disable some strict Svelte rules that are too aggressive
74+ 'svelte/require-each-key' : 'warn' ,
75+ 'svelte/no-useless-mustaches' : 'warn' ,
76+ 'no-unused-vars' : 'off' , // Use TypeScript version instead
77+ 'no-undef' : 'off' , // TypeScript handles this
7778 } ,
7879 } ,
7980 {
8081 files : [ '**/*.svelte' ] ,
8182
8283 languageOptions : {
83- parser : parser ,
84+ parser : svelteParser ,
8485 ecmaVersion : 5 ,
8586 sourceType : 'script' ,
8687
0 commit comments