-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
156 lines (156 loc) · 4.73 KB
/
.eslintrc.js
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
settings: { "import/resolver": { node: { extensions: [".js", ".jsx", ".ts", ".tsx", ".jpeg", ".png"] } } },
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2018,
sourceType: "module",
},
plugins: [
"react",
"react-hooks",
"compat",
"import",
"eslint-comments",
"@typescript-eslint",
"jest",
],
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
indent: ["error", 2],
"prefer-const": 2,
"arrow-body-style": 2,
"arrow-parens": [2, "as-needed", { requireForBlockBody: true }],
"no-var": 2,
"no-undef": 2,
"compat/compat": "error",
"comma-dangle": ["error", {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "never",
}],
curly: ["error", "all"],
quotes: ["error", "double", {
avoidEscape: true,
allowTemplateLiterals: true,
}],
camelcase: "off",
"no-extend-native": ["error", { exceptions: ["Array", "String", "Date", "Number"] }],
"no-multi-spaces": [2, {
exceptions: {
Property: true,
VariableDeclarator: true,
BinaryExpression: true,
AssignmentExpression: true,
},
ignoreEOLComments: true,
}],
"padded-blocks": [2, {
blocks: "never",
switches: "never",
}],
semi: ["error", "never"],
"no-bitwise": 2,
"no-implicit-coercion": ["error", {
boolean: false,
number: false,
string: true,
}],
"import/no-unresolved": 2,
"import/named": 2,
"import/default": 2,
"import/namespace": 2,
"import/no-mutable-exports": 2,
"import/no-extraneous-dependencies": 2,
"import/export": 2,
"import/no-nodejs-modules": 1,
"import/first": 2,
"import/order": [2, { groups: ["builtin", "external", "internal", "parent", "sibling", "index"] }],
"import/no-duplicates": 2,
"import/extensions": 2,
"import/newline-after-import": 2,
"import/prefer-default-export": 2,
"react/prop-types": 0,
"react/jsx-wrap-multilines": 2,
"react/display-name": 1,
"react/jsx-tag-spacing": [2, {
beforeSelfClosing: "always",
closingSlash: "never",
afterOpening: "never",
}],
"react/jsx-closing-bracket-location": 2,
"react/jsx-boolean-value": 2,
"react/react-in-jsx-scope": 0,
"react/jsx-filename-extension": [2, { extensions: [".js", ".jsx", ".ts", ".tsx"] }],
"react/jsx-pascal-case": 2,
"react/jsx-max-props-per-line": [2, { when: "multiline" }],
"react/jsx-indent-props": [2, 2],
"react/jsx-indent": [2, 2],
"react/void-dom-elements-no-children": 2,
"react/sort-comp": [2, {
order: [
"type-annotations",
"static-methods",
"lifecycle",
"everything-else",
"render",
],
}],
"react/self-closing-comp": 2,
"react/no-array-index-key": 2,
"react/no-redundant-should-component-update": 2,
"react/no-multi-comp": [2, { ignoreStateless: true }],
"react/prefer-es6-class": 2,
"react/prefer-stateless-function": [2, { ignorePureComponents: true }],
"react/no-direct-mutation-state": 2,
"react/require-default-props": 2,
"react/no-unused-prop-types": 2,
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-curly-spacing": [2, { when: "never" }],
"react/jsx-sort-props": ["error", { ignoreCase: true }],
"no-console": 1,
"array-bracket-spacing": [2, "never"],
"object-curly-spacing": [2, "always"],
"object-curly-newline": [2, {
ObjectExpression: { multiline: true },
ObjectPattern: { multiline: true },
ImportDeclaration: { consistent: true },
ExportDeclaration: { consistent: true },
}],
"quote-props": [2, "as-needed", { numbers: true }],
"no-useless-computed-key": 2,
"no-unexpected-multiline": "error",
"react/no-typos": 2,
"react/jsx-no-target-blank": 2,
"no-unused-expressions": 0,
"eslint-comments/disable-enable-pair": 2,
"eslint-comments/no-duplicate-disable": 2,
"eslint-comments/no-unlimited-disable": 2,
"eslint-comments/no-unused-disable": 2,
"eslint-comments/no-unused-enable": 2,
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"jest/expect-expect": 0,
},
}