-
Notifications
You must be signed in to change notification settings - Fork 400
/
.eslintrc
116 lines (116 loc) · 3.54 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
{
"extends": [
"amo",
"plugin:amo/recommended"
],
"plugins": ["testing-library"],
"overrides": [
{
//Enable eslint-plugin-testing-library rules only for test files.
"files": ["**/tests/**/*.js"],
"extends": ["plugin:testing-library/react"],
"rules": {"testing-library/render-result-naming-convention": "off"}
},
],
"globals": {
"CLIENT_CONFIG": true,
"document": true,
"webpackIsomorphicTools": true,
"ga": true,
// https://flow.org/en/docs/types/utilities/#toc-objmap
"$ObjMap": true,
// https://flow.org/en/docs/types/utilities/#toc-propertytype
"$PropertyType": true,
// These are undocumented utilities that ship with Flow
// https://github.com/facebook/flow/issues/875
"$ReadOnlyArray": true,
"$Rest": true,
"$Shape": true,
"$Keys": true,
"$Values": true,
// See: https://github.com/facebook/flow/issues/1609
"SyntheticEvent": true,
"SyntheticInputEvent": true,
// See: https://github.com/facebook/flow/issues/5627
"TimeoutID": true,
// Standard DOM globals:
"Generator": true,
"HTMLAnchorElement": true,
"HTMLButtonElement": true,
"HTMLElement": true,
"HTMLInputElement": true,
"HTMLSelectElement": true,
"HTMLTextAreaElement": true,
"Node": true,
// This is used to send form data to the API.
"FormData": true,
// This is used to upload files in the browser.
"File": true,
"FileReader": true,
"ProgressEvent": true,
// Types that can be used with sendBeacon:
"BodyInit": true,
// This is used by api/index.js.
"Response": true
},
"parser": "@babel/eslint-parser",
"rules": {
// We omit `debug` because we don't turn that on by default.
"amo/only-log-strings": ["error", {
"methods": ["fatal", "info", "error", "warn"]
}],
"react/default-props-match-prop-types": "off",
"react/function-component-definition": "off",
"react/jsx-no-useless-fragment" : ["error", { allowExpressions: true }],
"react/no-unstable-nested-components": ["error", { allowAsProps: true }],
// This rule is disabled because it outputs a lot of false positives, see:
// https://github.com/benmosher/eslint-plugin-import/issues/1343
"import/no-cycle": "off",
// This rule is disabled because it outputs a lot of false positives, see:
// https://github.com/import-js/eslint-plugin-import/issues/2181
"import/no-import-module-exports": "off",
"jest/expect-expect": ["warn", {
"assertFunctionNames": [
"expect",
// Allow the use of `sinon` in test cases.
"sinon.assert.*",
"mock*.verify",
// Allow our custom matcher.
"matchingSagaAction",
],
}],
// This allows RTK's createSlice with the simple shorthand syntax.
"no-param-reassign": ["error", {
"props": true,
"ignorePropertyModificationsFor": [
"state"
]
}]
},
"settings": {
"import/core-modules": [
// This is a workaround for: https://github.com/benmosher/eslint-plugin-import/issues/793
"redux-saga/effects",
],
"import/ignore": [
// Because of CommonJS incompatibility, we can't
// check for bad imports in node_modules.
"node_modules",
// Ignore non-JS imports.
"\\.gif$",
"\\.jpeg$",
"\\.jpg$",
"\\.mp4$",
"\\.png$",
"\\.scss$",
"\\.svg$",
"\\.webm$"
],
"import/resolver": {
"node": {
// This adds ./src for relative imports.
"moduleDirectory": ["node_modules", "src"]
}
}
}
}