-
Notifications
You must be signed in to change notification settings - Fork 24
/
eslint.config.js
90 lines (86 loc) · 2.17 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
87
88
89
90
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import sveltePlugin from "eslint-plugin-svelte";
import svelteParser from "svelte-eslint-parser";
const rules = {
'array-callback-return': 'error',
'no-constant-binary-expression': 'error',
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable-loop': 'error',
'arrow-body-style': ['error', 'as-needed'],
'block-scoped-var': 'error',
'curly': ['error', 'all'],
'dot-notation': 'error',
'no-eval': 'error',
'no-implied-eval': 'error',
'no-var': 'error',
'one-var': ['error', 'never'],
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
"yoda": 'error',
'array-bracket-newline': ['error', { multiline: true }],
'brace-style': 'error',
'no-shadow': 'error',
'no-use-before-define': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
varsIgnorePattern: '^_',
argsIgnorePattern: '^_'
}]
};
export default [
{
ignores: [
".svelte-kit/**/*",
"node_modules/**/*",
"dist/**/*",
"build/**/*",
"src/i18n/**/*"
],
},
{
files: ["**/*.ts"],
ignores: [
"custom-theme.ts",
"src/service-worker.ts",
"tailwind.config.ts"
],
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: "./tsconfig.json",
extraFileExtensions: [".svelte"],
},
},
plugins: {
"@typescript-eslint": typescriptPlugin,
},
rules: {
...typescriptPlugin.configs.recommended.rules,
...rules
},
},
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: typescriptParser,
project: "./tsconfig.json",
extraFileExtensions: [".svelte"],
},
},
plugins: {
svelte: sveltePlugin,
"@typescript-eslint": typescriptPlugin,
},
rules: {
...typescriptPlugin.configs.recommended.rules,
...sveltePlugin.configs.recommended.rules,
...rules,
'svelte/no-at-html-tags': 'off'
},
},
];