-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
79 lines (66 loc) · 1.88 KB
/
eslint.config.mjs
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 config_love from 'eslint-config-love'
import plugin_svelte from 'eslint-plugin-svelte'
import plugin_prettier_recommended from 'eslint-plugin-prettier/recommended'
import plugin_typescript from 'typescript-eslint'
import plugin_stylistic from '@stylistic/eslint-plugin-ts'
import globals from 'globals'
import * as svelteParser from 'svelte-eslint-parser'
import * as typescriptParser from '@typescript-eslint/parser'
export default plugin_typescript.config(
{
ignores: ['.svelte-kit/*', 'build/*', 'config/*'],
},
config_love,
plugin_prettier_recommended,
{
extends: [
plugin_typescript.configs.recommended,
plugin_svelte.configs['flat/recommended'],
],
plugins: {
'@stylistic/ts': plugin_stylistic,
},
languageOptions: {
globals: {
...globals.browser,
},
parser: svelteParser,
parserOptions: {
parser: typescriptParser,
project: './path/to/your/tsconfig.json',
extraFileExtensions: ['.svelte'],
},
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
eqeqeq: 'warn',
'no-empty': 'warn',
'prefer-const': 'warn',
'comma-dangle': 'off',
'quote-props': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-unsafe-type-assertion': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@stylistic/ts/comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'never',
exports: 'never',
functions: 'never',
},
],
'@stylistic/ts/no-extra-parens': 'off',
'@stylistic/ts/space-before-function-paren': 'off',
},
},
{
files: ['**/+*server.ts'],
rules: {
'@typescript-eslint/only-throw-error': 'off',
},
},
plugin_prettier_recommended
)