-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
76 lines (76 loc) · 1.88 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
project: ["./tsconfig.eslint.json"],
warnOnUnsupportedTypeScriptVersion: false,
},
env: {
browser: true,
es2017: true,
node: true,
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
{
files: ["scripts/**/*.mjs", "scripts/**/*.ts"],
rules: {
"no-console": "off",
},
},
{
files: ["*.svelte"],
rules: {
"import/order": [
"error",
{
alphabetize: { order: "asc" },
},
],
},
},
],
rules: {
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"arrow-body-style": ["warn", "as-needed"],
curly: "error",
"import/no-duplicates": ["error", { "prefer-inline": true }],
"no-console": ["error", { allow: ["error", "warn"] }],
"no-continue": "warn",
"no-delete-var": "error",
"no-else-return": ["warn", { allowElseIf: false }],
"no-unused-vars": "off",
"prefer-template": "error",
},
globals: {
NodeJS: true,
},
};