This repository has been archived by the owner on Aug 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.json
139 lines (139 loc) · 3.98 KB
/
.eslintrc.json
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
"env": {
"es6": true,
"node": true,
"jest": true,
"jest/globals": true
},
"overrides": [
{
"files": ".js,.ts"
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["node", "@typescript-eslint", "import", "jest", "security"],
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:security/recommended"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
// code
"max-params": ["warn", 3],
"max-depth": ["error", 3],
"max-statements-per-line": [
"error",
{
"max": 1
}
],
"max-lines": [
"error",
{
"max": 250,
"skipBlankLines": true,
"skipComments": true
}
],
"max-lines-per-function": [
"warn",
{
"max": 50,
"skipBlankLines": true,
"skipComments": true
}
],
"@typescript-eslint/ban-ts-comment": ["warn"],
"@typescript-eslint/interface-name-prefix": [0, "never"],
"arrow-parens": ["error"],
"quote-props": [
"error",
"consistent-as-needed",
{
"numbers": true
}
],
"no-unused-vars": "error",
"no-useless-escape": "error",
"no-empty-pattern": "error",
"no-eval": "error",
"no-implied-eval": "error",
"no-prototype-builtins": "error",
"node/no-sync": 0,
"node/exports-style": ["error", "module.exports"],
"node/no-unpublished-require": 0,
"node/no-extraneous-import": 0,
"node/no-deprecated-api": ["warn"],
"node/no-missing-require": [
"error",
{
"tryExtensions": [".ts", ".js", ".d.ts", ".json", ".node"]
}
],
"node/no-missing-import": 0,
"node/no-unpublished-import": 0,
"node/no-unsupported-features/es-syntax": 0,
"import/extensions": [
"error",
{
"ts": "never",
"js": "never",
"json": "always"
}
],
"import/named": "warn",
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }],
// Style
"max-len": [
"error",
{
"code": 200
}
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"linebreak-style": ["error", "windows"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"brace-style": ["error", "stroustrup"],
"object-curly-spacing": ["error", "always"],
"no-mixed-spaces-and-tabs": "error",
"arrow-spacing": ["error"],
"comma-dangle": ["error", "never"],
"comma-style": ["error"],
"no-extra-semi": "error",
"comma-spacing": "error",
"space-in-parens": ["error", "never"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
"keyword-spacing": "error",
"one-var": ["error", "never"]
}
}