-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
88 lines (82 loc) · 2.16 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
{
"env": {
"browser": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript",
// formatter
"plugin:prettier/recommended",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
},
"settings": {
"import/extensions": [".js", ".ts"],
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
}
}
},
"rules": {
// use CamelCase
"camelcase": [
"error",
{
"properties": "always"
}
],
// should use preserverd code
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_" }
],
"import/prefer-default-export": "off",
"prefer-const": "off",
// `switch` is not expression
"no-nested-ternary": "off",
// because framework
"@typescript-eslint/explicit-module-boundary-types": "off",
// strict types
// "@typescript-eslint/prefer-readonly-parameter-types":'error', // Bug
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "never"
}
],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowString": true,
"allowNumber": true,
"allowNullableObject": false, // to function object
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowAny": false
}
],
// erase only javascripts rules
"import/extensions": ["error", "never"],
"default-case": "off",
"consistent-return": "off",
"no-param-reassign": ["error", { "props": false }],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off"
}
}