|
1 | 1 | import { includeIgnoreFile } from '@eslint/compat'; |
2 | 2 | import js from '@eslint/js'; |
3 | 3 | import prettier from 'eslint-config-prettier'; |
4 | | -import svelte from 'eslint-plugin-svelte'; |
5 | 4 | import globals from 'globals'; |
6 | 5 | import { fileURLToPath } from 'node:url'; |
7 | 6 | import ts from 'typescript-eslint'; |
8 | 7 |
|
9 | | -import svelteConfig from './svelte.config.js'; |
10 | | - |
11 | 8 | const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); |
12 | 9 |
|
13 | 10 | export default ts.config( |
14 | 11 | includeIgnoreFile(gitignorePath), |
15 | 12 | js.configs.recommended, |
16 | 13 | ...ts.configs.recommended, |
17 | | - ...svelte.configs.recommended, |
18 | 14 | prettier, |
19 | | - ...svelte.configs.prettier, |
20 | 15 | { |
21 | 16 | languageOptions: { |
22 | | - globals: { ...globals.browser, ...globals.node } |
| 17 | + globals: { ...globals.browser, ...globals.node }, |
| 18 | + parserOptions: { |
| 19 | + projectService: { |
| 20 | + allowDefaultProject: ['*.js', '*.ts'] |
| 21 | + }, |
| 22 | + ecmaVersion: 'latest', |
| 23 | + sourceType: 'module' |
| 24 | + } |
23 | 25 | }, |
| 26 | + files: ['**/*.{js,ts,mjs,cjs}'], |
24 | 27 | rules: { |
25 | | - 'svelte/no-navigation-without-resolve': [ |
| 28 | + // Add project-specific rules here |
| 29 | + '@typescript-eslint/no-unused-vars': [ |
26 | 30 | 'error', |
27 | 31 | { |
28 | | - ignorePushState: true |
| 32 | + argsIgnorePattern: '^_', |
| 33 | + varsIgnorePattern: '^_' |
29 | 34 | } |
30 | 35 | ] |
31 | 36 | } |
32 | | - }, |
33 | | - { |
34 | | - files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], |
35 | | - languageOptions: { |
36 | | - parserOptions: { |
37 | | - projectService: true, |
38 | | - extraFileExtensions: ['.svelte'], |
39 | | - parser: ts.parser, |
40 | | - svelteConfig |
41 | | - } |
42 | | - } |
43 | 37 | } |
44 | 38 | ); |
0 commit comments