-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.js
86 lines (84 loc) · 1.79 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
import js from '@eslint/js';
import json from '@eslint/json';
import prettier from 'eslint-plugin-prettier/recommended';
import svelte from 'eslint-plugin-svelte';
import yml from 'eslint-plugin-yml';
import globals from 'globals';
import svelteParser from 'svelte-eslint-parser';
import tseslint from 'typescript-eslint';
import yamlParser from 'yaml-eslint-parser';
/** @type { import('eslint').Linter.Config[] } */
const config = [
{
ignores: ['.svelte-kit/**', 'build/**', 'package-lock.json'],
},
{
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
...globals.es2017,
...globals.node,
},
},
},
{
files: ['**/*.js', '**/*.ts'],
...js.configs.recommended,
},
{
files: ['**/*.json'],
plugins: {
json,
},
language: 'json/json',
...json.configs.recommended,
},
{
files: ['**/*.svelte'],
plugins: {
svelte,
},
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
...svelte.configs.recommended.rules,
},
},
...[...tseslint.configs.strict, ...tseslint.configs.stylistic].map(
(conf) => ({
...conf,
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
extraFileExtensions: ['.svelte'],
},
},
}),
),
...[...tseslint.configs.strict, ...tseslint.configs.stylistic].map(
(conf) => ({
...conf,
files: ['**/*.ts'],
}),
),
{
files: ['**/*.yaml', '**/*.yml'],
plugins: {
yml,
},
languageOptions: {
parser: yamlParser,
},
rules: {
...yml.configs.standard.rules,
'yml/quotes': ['error', { prefer: 'single' }],
},
},
prettier,
];
export default config;