-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
77 lines (75 loc) · 2.24 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
import js from '@eslint/js';
import masterCssPlugin from '@master/eslint-plugin-css';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import perfectionistNatural from 'eslint-plugin-perfectionist/configs/recommended-natural';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierPluginReccomended from 'eslint-plugin-prettier/recommended';
import sveltePlugin from 'eslint-plugin-svelte';
import svelteParser from 'svelte-eslint-parser';
/** @type {import("eslint").Linter.RulesRecord} */
const defaultRules = {
...typescriptPlugin.configs.recommended?.rules,
'arrow-body-style': 'off',
'no-undef': 'off',
'prefer-arrow-callback': 'off'
};
/**
* @type {import("eslint").Linter.FlatConfig[]}
*/
export default [
{
ignores: ['.svelte-kit/**/*', 'node_modules/**/*']
},
js.configs.recommended,
{
files: ['**/*.ts', '**/*.svelte'],
plugins: masterCssPlugin.configs.flat.plugins,
rules: masterCssPlugin.configs.flat.rules
},
{
files: ['**/*.js', '**/*.cjs']
},
{
files: ['**/*.ts'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
project: './tsconfig.json',
sourceType: 'module'
}
},
plugins: {
'@typescript-eslint': typescriptPlugin,
prettier: prettierPlugin
},
rules: {
...defaultRules,
'prettier/prettier': ['error']
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: typescriptParser
}
},
plugins: {
'@typescript-eslint': typescriptPlugin,
prettier: prettierPlugin,
svelte: sveltePlugin
},
processor: 'svelte/svelte',
rules: {
...defaultRules,
...sveltePlugin.configs.recommended.rules
// ...sveltePlugin.configs.prettier.rules,
}
},
perfectionistNatural,
prettierPluginReccomended
];