-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
122 lines (121 loc) · 3.34 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
{
"parser": "babel-eslint",
"extends": [
"airbnb",
"airbnb/hooks",
"prettier"
],
"plugins": [
"flowtype",
"react-hooks",
"prettier"
],
"env": {
"browser": true,
"es6": true,
"node": true
},
"rules": {
"prettier/prettier": [
"error"
],
"no-console": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// Required for our dynamic CSS theming => require(`./Button.${_BRAND_}.scss`);
"import/no-dynamic-require": 0,
// We use the 'import' plugin which allows for cases "flow" awareness.
"no-duplicate-imports": 0,
// A .jsx extension is not required for files containing jsx.
"react/jsx-filename-extension": 0,
// This rule struggles with flow and class properties.
"react/sort-comp": 0,
// We use global requires in various places, e.g. code splitting instances.
"global-require": 0,
// We use development dependencies (as react-test-renderer) in unit tests
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/*.spec.js"
]
}
],
// Checks for existence of documentation
"require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true
}
}
],
// We can't guess what our object contains
"react/forbid-prop-types": [
0,
{
"forbid": [
"object"
]
}
],
// Interfere with prettier on save
"no-debugger": 0,
// Need adjustements
"function-paren-newline": 0,
// Need adjustements
"react/default-props-match-prop-types": 0,
// Need adjustements
"object-curly-newline": [
"error",
{
"multiline": true,
"consistent": true
}
],
// Need adjustements
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"react/jsx-one-expression-per-line": 0,
"import/no-cycle": 0,
"react/no-unused-prop-types": 0,
"react/destructuring-assignment": 0,
"react/require-default-props": 0,
"react/no-access-state-in-setstate": 0,
"react/button-has-type": 0,
// Need adjustements too
"react/jsx-props-no-spreading": 0,
"react/jsx-fragments": 0,
"react/static-property-placement": 0,
"react/state-in-constructor": 0,
"jsx-a11y/control-has-associated-label": 0,
"react/jsx-curly-newline": 0
},
"globals": {
// Following are symbols from testing libraries
"afterEach": false,
"beforeEach": false,
"afterAll": false,
"beforeAll": false,
"describe": false,
"it": false,
"expect": false,
"assert": false,
"jest": false,
"jsdom": false,
"browser": false,
"localStorage": false,
"sessionStorage": false,
// Following are symbols for css modules
"_BRAND_": false,
"__THEME__": false,
// Google API object
"google": false,
"ga": false
}
}