|
| 1 | +import js from '@eslint/js'; |
1 | 2 | import prettier from 'eslint-config-prettier';
|
2 |
| -import vue from 'eslint-plugin-vue'; |
| 3 | +import svelte from 'eslint-plugin-svelte'; |
| 4 | +import globals from 'globals'; |
| 5 | +import ts from 'typescript-eslint'; |
3 | 6 |
|
4 |
| -import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'; |
5 |
| - |
6 |
| -export default defineConfigWithVueTs( |
7 |
| - vue.configs['flat/essential'], |
8 |
| - vueTsConfigs.recommended, |
| 7 | +export default ts.config( |
| 8 | + js.configs.recommended, |
| 9 | + ...ts.configs.recommended, |
| 10 | + ...svelte.configs.recommended, |
9 | 11 | {
|
10 |
| - ignores: ['vendor', 'node_modules', 'public', 'bootstrap/ssr', 'tailwind.config.js', 'resources/js/components/ui/*'], |
| 12 | + languageOptions: { |
| 13 | + globals: { |
| 14 | + ...globals.browser, |
| 15 | + ...globals.node, |
| 16 | + route: 'readonly', |
| 17 | + Laravel: 'readonly', |
| 18 | + }, |
| 19 | + }, |
| 20 | + }, |
| 21 | + { |
| 22 | + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], |
| 23 | + // See more details at: https://typescript-eslint.io/packages/parser/ |
| 24 | + languageOptions: { |
| 25 | + parserOptions: { |
| 26 | + projectService: true, |
| 27 | + extraFileExtensions: ['.svelte', '.svelte.ts', '.svelte.js'], // Add support for additional file extensions, such as .svelte |
| 28 | + parser: ts.parser, |
| 29 | + // Specify a parser for each language, if needed: |
| 30 | + // parser: { |
| 31 | + // ts: ts.parser, |
| 32 | + // js: espree, // Use espree for .js files (add: import espree from 'espree') |
| 33 | + // typescript: ts.parser |
| 34 | + // }, |
| 35 | + |
| 36 | + // We recommend importing and specifying svelte.config.js. |
| 37 | + // By doing so, some rules in eslint-plugin-svelte will automatically read the configuration and adjust their behavior accordingly. |
| 38 | + // While certain Svelte settings may be statically loaded from svelte.config.js even if you don’t specify it, |
| 39 | + // explicitly specifying it ensures better compatibility and functionality. |
| 40 | + // svelteConfig, |
| 41 | + }, |
| 42 | + }, |
11 | 43 | },
|
12 | 44 | {
|
13 | 45 | rules: {
|
14 |
| - 'vue/multi-word-component-names': 'off', |
15 | 46 | '@typescript-eslint/no-explicit-any': 'off',
|
| 47 | + 'svelte/infinite-reactive-loop': 'error', |
| 48 | + 'svelte/no-at-html-tags': 'error', |
| 49 | + 'svelte/no-target-blank': 'error', |
16 | 50 | },
|
17 | 51 | },
|
| 52 | + { |
| 53 | + ignores: ['vendor', 'node_modules', 'public', 'bootstrap/ssr', 'tailwind.config.js', 'resources/js/components/ui/*'], |
| 54 | + }, |
18 | 55 | prettier,
|
19 | 56 | );
|
0 commit comments