-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
55 lines (53 loc) · 1.44 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
// eslint.config.cjs
// import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import eslintPluginSvelte from 'eslint-plugin-svelte'
import js from '@eslint/js'
import svelteParser from 'svelte-eslint-parser'
import tsEslint from 'typescript-eslint'
import tsParser from '@typescript-eslint/parser'
import globals from 'globals'
export default [
js.configs.recommended,
...tsEslint.configs.strict,
...eslintPluginSvelte.configs['flat/recommended'],
{
languageOptions: {
globals: {
...globals.browser,
},
},
rules: {
quotes: [
'warn',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
semi: ['error', 'never'],
indent: ['warn', 2],
'no-extra-parens': 'warn',
'no-nested-ternary': 'error',
'linebreak-style': ['error', 'unix'],
'no-cond-assign': ['error', 'always'],
'no-console': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsParser,
},
},
rules: {
'svelte/no-target-blank': 'error',
'svelte/no-at-debug-tags': 'error',
'svelte/no-reactive-functions': 'error',
'svelte/no-reactive-literals': 'error',
'@/semi': ['error', 'never'],
'@/quotes': ['warn', 'single'],
'@/indent': ['warn', 2],
}
}
]