-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint-svelte.config.js
54 lines (53 loc) · 1.47 KB
/
eslint-svelte.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
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginImport from 'eslint-plugin-import';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';
/**
* @type {import('eslint').Linter.Config[]}
*/
export default ts.config([
js.configs.recommended,
...ts.configs.strict,
...ts.configs.stylistic,
...eslintPluginSvelte.configs['flat/recommended'],
...eslintPluginSvelte.configs['flat/prettier'],
eslintConfigPrettier,
{
ignores: ['dist/', 'build/', '.*/'], // Customize according to your project.
},
{
plugins: {
import: eslintPluginImport,
},
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
},
rules: {
curly: ['error', 'all'],
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true, destructuredArrayIgnorePattern: '^_' },
],
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
'@typescript-eslint/no-import-type-side-effects': 'error',
'import/newline-after-import': [
'error',
{ count: 1, exactCount: true, considerComments: true },
],
'import/no-duplicates': ['error', { 'prefer-inline': true }],
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
},
]);