-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
88 lines (83 loc) · 2.39 KB
/
eslint.config.js
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
// ESLint Flat Configuration
// https://eslint.org/docs/latest/use/configure/migration-guide#start-using-flat-config-files
// ESLint Rules
// https://eslint.org/docs/latest/rules/
// ESLint Parser for Svelte & Typescript
// https://github.com/sveltejs/eslint-plugin-svelte
// https://github.com/sveltejs/svelte-eslint-parser
import eslintJs from '@eslint/js'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import sveltePlugin from 'eslint-plugin-svelte'
import svelteParser from 'svelte-eslint-parser'
const config = [
{
// Global Ignores
// https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
ignores: [
'packages/*/dist/**',
'packages/frontend/.svelte-kit/**',
'packages/frontend/android/**',
],
},
{
// Global Rules
rules: {
...eslintJs.configs.recommended.rules,
eqeqeq: [
'error',
'always',
],
'no-throw-literal': ['error'],
'no-undef': 'off',
'no-useless-concat': ['error'],
'no-var': ['error'],
'prefer-template': ['error'],
'require-await': ['error'],
},
},
{
// TypeScript Rules
files: [
'**/*.ts',
'**/*.cts',
'**/*.mts',
],
languageOptions: {
parser: tsParser,
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: {
...tsPlugin.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
// Svelte Rules
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsParser,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
svelte: sveltePlugin,
},
rules: {
...tsPlugin.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': 'off',
...sveltePlugin.configs.recommended.rules,
'svelte/valid-compile': [
'error',
{
ignoreWarnings: true,
},
],
},
},
]
export default config