-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
99 lines (98 loc) · 2.87 KB
/
eslint.config.js
File metadata and controls
99 lines (98 loc) · 2.87 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
import globals from 'globals'
import pluginJs from '@eslint/js'
import eslintPluginSvelte from 'eslint-plugin-svelte'
import svelteParser from 'svelte-eslint-parser'
import importPlugin from 'eslint-plugin-import'
import typescriptPlugin from '@typescript-eslint/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
/** @type {import('eslint').Linter.Config[]} */
export default [
pluginJs.configs.recommended,
...eslintPluginSvelte.configs['flat/recommended'],
{
files: ['**/*.svelte'],
plugins: {
import: importPlugin,
},
languageOptions: {
globals: globals.browser,
parser: svelteParser,
parserOptions: {
parser: {
ts: typescriptParser,
typescript: typescriptParser
}
}
},
},
{
files: ['**/*.ts', '**/*.js'],
plugins: {
'@typescript-eslint': typescriptPlugin,
import: importPlugin,
},
languageOptions: {
globals: globals.browser,
parser: typescriptParser,
},
},
{
rules: {
'no-unused-vars': 'off', // turn on in future and check why enums are not recognized
'space-infix-ops': 'error',
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'comma-spacing': ['error', { before: false, after: true }],
indent: ['error', 2, { SwitchCase: 1 }],
semi: ['error', 'never'],
quotes: [2, 'single', { avoidEscape: true }],
'object-curly-spacing': ['error', 'always'],
'space-before-blocks': ['error', 'always'],
'arrow-parens': ['error', 'always'],
'keyword-spacing': ['error', { before: true, after: true }],
'max-len': ['error', { ignoreComments: true, ignoreStrings: true, ignoreRegExpLiterals: true, code: 160 }],
'class-methods-use-this': 'off',
'import/no-extraneous-dependencies': 'off', // temporary disabled
'object-curly-newline': 'off',
'import/prefer-default-export': 'off',
'implicit-arrow-linebreak': 'off',
'import/order': [
1,
{
groups: [
'external',
'builtin',
'internal',
'sibling',
'parent',
'index',
],
pathGroups: [
{
pattern: '$app/**',
group: 'internal',
position: 'after'
},
{
pattern: '$lib/**',
group: 'internal',
position: 'after'
},
{
pattern: '$components/**',
group: 'internal',
position: 'after'
},
{
pattern: '$assets/**',
group: 'internal',
position: 'after'
},
],
warnOnUnassignedImports: true,
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
}
]
}
}
]