-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
140 lines (140 loc) · 3.56 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
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
140
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react"],
"extends": [
"plugin:jsx-control-statements/recommended"
],
"settings": {
"react": {
"version": "detect"
}
},
"globals": {
"document": true,
"window": true
},
"ignorePatterns": [
"**/dist/*.js",
"**/node_modules"
],
"rules": {
"semi": ["error", "never"],
"curly": ["error", "all"],
"object-curly-spacing": ["error", "always"],
"no-trailing-spaces": "error",
"max-len": ["error", 120],
"indent": ["error", 2],
"eol-last": "error",
"prefer-const": "error",
"no-console": "error",
"no-else-return": "warn",
"comma-dangle": ["error", "always-multiline"],
"padding-line-between-statements": ["error",
{
"blankLine": "always",
"prev": ["let", "const"],
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": ["let", "const"]
},
{
"blankLine": "any",
"prev": ["singleline-let", "singleline-const"],
"next": ["singleline-let", "singleline-const"]
},
{
"blankLine": "always",
"prev": "*",
"next": [
"if",
"block",
"return",
"multiline-block-like",
"multiline-expression"
]
},
{
"blankLine": "always",
"prev": [
"block-like",
"multiline-block-like",
"multiline-expression"
],
"next": "*"
}
],
"quotes": ["error", "single"],
"jsx-quotes": ["error", "prefer-double"],
"react/jsx-no-undef": [2, { "allowGlobals": true }],
"react/function-component-definition": [2, {
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}],
"react/no-redundant-should-component-update": "warn",
"react/no-unused-state": "error",
"react/self-closing-comp": ["error", {
"html": true,
"component": true
}],
"react/sort-comp": ["error", {
"order": [
"static-methods",
"lifecycle",
"everything-else",
"/^handle.+$/",
"rendering"
],
"groups": {
"rendering": [
"'/^render.+$/'",
"render"
]
}
}],
"react/jsx-closing-bracket-location": ["error", "tag-aligned"],
"react/jsx-closing-tag-location": "error",
"react/jsx-equals-spacing": ["error", "never"],
"react/jsx-first-prop-new-line": 0,
"react/jsx-fragments": ["error", "element"],
"react/jsx-handler-names": ["error", {
"eventHandlerPrefix": "handle",
"eventHandlerPropPrefix": "on"
}],
"react/jsx-max-props-per-line": ["error", {
"maximum": 2
}],
"react/jsx-tag-spacing": ["error", {
"beforeSelfClosing": "always"
}],
"react/jsx-sort-props": ["warn", {
"shorthandFirst": true,
"callbacksLast": true,
"noSortAlphabetically": true
}],
"jsx-control-statements/jsx-jcs-no-undef": "off"
},
"overrides": [
{
"files": [
"**/*.ts?(x)"
],
"rules": {
"indent": "off",
"space-infix-ops": "off",
"@typescript-eslint/space-infix-ops": ["error"],
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/type-annotation-spacing": ["error"],
"@typescript-eslint/space-before-function-paren": ["error", {
"named": "never",
"anonymous": "always",
"asyncArrow": "always"
}]
}
}
]
}