-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
125 lines (125 loc) · 3.79 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
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react",
"unused-imports"
],
"rules": {
// allow jsx syntax in js files (for next.js project)
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }], //should add ".ts" if typescript project
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"@typescript-eslint/quotes": [
"error",
"double",
{
"allowTemplateLiterals": true
}
],
"jsx-quotes": [2, "prefer-double"],
"@typescript-eslint/no-explicit-any": "off",
"no-throw-literal": "off", // use ts version
"@typescript-eslint/no-confusing-void-expression": [
"off",
{ "ignoreVoidOperator": true }
],
"@typescript-eslint/no-unused-vars": "warn",
"no-unused-expressions": "off", // uss ts version
"@typescript-eslint/no-unused-expressions": "error",
"prefer-promise-reject-errors": "off", // use ts version
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-nocheck": true,
"ts-check": false,
"minimumDescriptionLength": 10
}
],
"curly": "warn",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-static-element-interactions": "off",
"react/prop-types": "off",
"no-case-declarations": "off",
"react/no-unknown-property": "off",
"no-console": "off",
"no-async-promise-executor": "off",
"prefer-const": [
"warn",
{
"destructuring": "all",
"ignoreReadBeforeAssign": false
}
],
"max-len": [
"warn",
{
"code": 180,
"tabWidth": 4
}
],
"no-var": "warn",
"comma-spacing": "warn",
"semi": ["warn", "always"],
"object-curly-spacing": ["warn", "always"],
"object-shorthand": "warn",
"quote-props": ["warn", "as-needed"],
"react/react-in-jsx-scope": 0,
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": ["warn"],
"array-callback-return": "error",
"no-await-in-loop": "warn",
"no-template-curly-in-string": "warn",
"no-constant-binary-expression": "error",
"no-constructor-return": "error",
"no-promise-executor-return": "error",
"no-unmodified-loop-condition": "warn",
"no-unreachable-loop": "error",
"no-unused-private-class-members": "error",
"no-use-before-define": "error",
"require-atomic-updates": "error"
},
"overrides": [
{
"files": ["**/components/models/**/*.ts", "**/components/models/**/*.tsx"],
"rules": {
"react/no-unknown-property": "off"
}
},
{
"files": ["**/data/**/*.ts", "**/data/**/*.tsx"],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-vars": "off"
}
}
]
}