-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
82 lines (78 loc) · 2.07 KB
/
.eslintrc
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
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"@spotify/eslint-config-base"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["prettier", "@typescript-eslint"],
"rules": {
// Typebox use cap for its functions
"new-cap": "off",
"arrow-body-style": "warn",
// lot of api response not using camel case
"camelcase": "off",
"no-nested-ternary": "off",
"consistent-return": "off",
// use prettier for code style
"comma-dangle": "off",
"semi": "off",
"no-extra-semi": "off",
"indent": "off",
"@typescript-eslint/no-extra-semi": "off",
"no-spaced-func": "off",
"prettier/prettier": "error",
"comma-spacing": "off",
// use typescript-eslint rule instead
"no-use-before-define": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
// custom rules
"max-depth": ["error", 3],
"max-lines": [
"error",
{ "max": 500, "skipBlankLines": true, "skipComments": true }
],
// should use `String(var)` instead of `'' + var` for type convert
"no-implicit-coercion": "error",
"no-shadow-restricted-names": "error",
"prefer-arrow-callback": "error",
// do not use `let` unless need to reassign
"prefer-const": "error",
// must add new line between statement
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": [
"block",
"block-like",
"cjs-export",
"class",
"export",
"import",
"multiline-const",
"multiline-expression"
],
"next": "*"
},
{
"blankLine": "any",
"prev": ["export", "import"],
"next": ["export", "import"]
}
]
}
}