-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
107 lines (98 loc) · 2.4 KB
/
Copy patheslint.config.ts
File metadata and controls
107 lines (98 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import svelte from 'eslint-plugin-svelte';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import ts from 'typescript-eslint';
import svelteConfig from './svelte.config.ts';
export default defineConfig(
// global ignores — must be the sole key for flat-config global ignore semantics
{
ignores: [
'.svelte-kit/**',
'build/**',
'dist/**',
'node_modules/**',
'api/target/**',
'src/lib/paraglide/**',
'src/lib/bindings/**',
'coverage/**',
'playwright-report/**',
'test-results/**'
]
},
js.configs.recommended,
ts.configs.strictTypeChecked,
ts.configs.stylisticTypeChecked,
svelte.configs.recommended,
prettier,
svelte.configs.prettier,
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
parserOptions: {
extraFileExtensions: ['.svelte'],
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
'@typescript-eslint/consistent-type-imports': [
'error',
{ fixStyle: 'inline-type-imports', prefer: 'type-imports' }
],
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: { attributes: false } }
],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowBoolean: true, allowNumber: true }
],
'no-undef': 'off'
}
},
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
languageOptions: {
parserOptions: {
extraFileExtensions: ['.svelte'],
parser: ts.parser,
projectService: true,
svelteConfig,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
// runes + $props/$state often trigger these falsely
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
}
},
{
files: ['*.config.{js,ts}', 'scripts/**/*.{js,ts}'],
languageOptions: {
globals: { ...globals.node }
}
},
{
extends: [ts.configs.disableTypeChecked],
files: ['*.js', '*.config.{js,ts}']
},
{
files: ['**/*.{test,spec}.{js,ts,svelte}', 'e2e/**/*.{js,ts}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off'
}
}
);