-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
66 lines (61 loc) · 1.43 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
const rules = {
"arrow-body-style": ["error", "as-needed"],
"object-curly-spacing": [
2,
"always",
{ objectsInObjects: false, objectsInObjects: true }
],
"jsx-quotes": ["error", "prefer-double"],
"no-multiple-empty-lines": "error",
"no-trailing-spaces": "error",
curly: "error",
};
const extendsConfigs = [
"eslint:recommended",
"plugin:react/recommended"
];
module.exports = {
parser: "babel-eslint",
env: {
browser: true,
amd: true,
node: true,
es6: true,
"jest/globals": true
},
extends: extendsConfigs,
overrides: [
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
extends: [...extendsConfigs, "plugin:@typescript-eslint/recommended"],
rules: {
...rules,
"@typescript-eslint/no-use-before-define": "off",
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"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"
}
}
],
plugins: ["react-hooks", "jest"],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
jsx: true
}
},
rules,
settings: {
react: {
version: "detect"
}
}
};