This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.cjs
94 lines (94 loc) · 2.36 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: [
"eslint:recommended",
"plugin:svelte/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
plugins: ["@typescript-eslint"],
ignorePatterns: ["*.cjs"],
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
},
env: {
browser: true,
es2022: true,
node: true,
},
rules: {
"array-callback-return": "error",
"block-scoped-var": "error",
camelcase: "error",
"consistent-return": "error",
"consistent-this": "error",
curly: "error",
"default-case": "error",
"default-case-last": "error",
"default-param-last": ["error"],
"dot-notation": "error",
eqeqeq: ["error", "smart"],
"id-length": [
"error",
{ min: 3, exceptions: ["i", "a", "b", "x", "y", "id", "ok", "to"] },
],
"func-style": [
"error",
"declaration",
{
allowArrowFunctions: true,
},
],
"guard-for-in": "error",
"no-alert": "warn",
"no-await-in-loop": "error",
"no-console": "warn",
"no-constant-binary-expression": "error",
"no-empty-function": "warn",
"no-eval": "error",
"no-extra-boolean-cast": ["error", { enforceForLogicalOperands: true }],
"no-implicit-coercion": [2, { allow: ["!!"] }],
"no-implied-eval": "error",
"no-irregular-whitespace": "off",
"no-mixed-operators": "error",
"no-nested-ternary": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-shadow": "error",
"no-unneeded-ternary": "error",
"no-use-before-define": "error",
"no-var": "error",
"no-warning-comments": [
"warn",
{
location: "start",
terms: ["todo", "hack", "xxx", "fixme"],
},
],
"prefer-const": "error",
"require-await": "error",
"svelte/no-at-html-tags": "warn",
"svelte/valid-compile": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "off",
},
};