-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
79 lines (78 loc) · 2.24 KB
/
eslint.config.mjs
File metadata and controls
79 lines (78 loc) · 2.24 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
import tseslint from '@electron-toolkit/eslint-config-ts';
import eslintConfigPrettier from '@electron-toolkit/eslint-config-prettier';
import eslintPluginSvelte from 'eslint-plugin-svelte';
export default tseslint.config(
{
ignores: [
'**/node_modules',
'**/dist',
'**/out',
'**/build',
'web-app',
'website',
'playwright-report',
'test-results',
'screenshots/output',
'.wrangler'
]
},
tseslint.configs.recommended,
eslintPluginSvelte.configs['flat/recommended'],
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: tseslint.parser
}
}
},
{
files: ['**/*.svelte.ts'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
}
},
{
files: ['**/*.{tsx,svelte,svelte.ts}'],
rules: {
'svelte/no-unused-svelte-ignore': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }]
}
},
{
files: ['**/MarkdownRenderer.svelte'],
rules: {
'svelte/no-at-html-tags': 'off' // Safe to use {@html} here as we sanitize with DOMPurify
}
},
{
files: ['**/env.d.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off', // Type definition files can use any
'@typescript-eslint/no-unused-vars': 'off' // Imported types may not be used directly
}
},
{
files: [
'**/*.test.ts',
'**/*.test.js',
'**/*.spec.ts',
'**/*.spec.js',
'**/test-*.ts',
'**/test-*.js'
],
rules: {
'@typescript-eslint/no-explicit-any': 'off', // Allow any in tests for mocking and flexibility
'@typescript-eslint/explicit-function-return-type': 'off', // Don't require return types in tests
'@typescript-eslint/no-unused-vars': 'off', // Allow unused vars in tests for partial implementations
'@typescript-eslint/no-non-null-assertion': 'off', // Allow non-null assertions in test scenarios
'@typescript-eslint/no-empty-function': 'off', // Allow empty functions for mocking
'@typescript-eslint/no-object-literal-type-assertion': 'off' // Allow type assertions in tests
}
},
eslintConfigPrettier
);