forked from nasa-gibs/worldview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
170 lines (164 loc) · 4.58 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
"env": {
"browser": true,
"node": true,
"jest/globals": true
},
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react",
"jest",
"no-storage"
],
"extends": "airbnb",
"parser": "babel-eslint",
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {}, // Needed for node core modules (https://github.com/benmosher/eslint-plugin-import/issues/1396)
"webpack": {}
}
},
"rules": {
// The following rules are cases where our base rules
// differed from AirBnB Style guide. Keeping for now.
"no-unused-vars": [
"error",
{
"vars": "all",
"args": "none"
}
],
"camelcase": [
"error",
{
"allow": [
"^UNSAFE_"
],
"properties": "never"
}
],
"no-useless-call": "error",
"no-extra-parens": "error",
"space-before-function-paren": "off",
"import/extensions": "off",
"no-multiple-empty-lines": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"tasks/*.js",
"tasks/**/*.js",
"rpm/*.js",
"**/*test.js",
"**/*config.js",
"**/*conf.js"
]
}
],
"no-storage/no-browser-storage": "error"
},
"overrides": [
{
"files": [
"**/*.js"
],
"rules": {
/* BEGIN Airbnb overrides
Rules below are overriding the Airbnb style guide rules in order to get code
to pass without having to fix hundreds of existing errors by hand.
For rules set to "off": consider setting to "warn" to identify non-compliance in new code
For rules set to "warn": consider removing to throw errors on existing and future code
*/
// Base rule overrides
"no-nested-ternary": "off", // 58 errors
"no-shadow": "warn", // 136 errors
"max-len": "off",
"consistent-return": "off", // 73 errors
"no-underscore-dangle": "off",
"func-names": "off",
"no-param-reassign": [ // 329 errors
"warn",
{
"props": false
}
],
"no-use-before-define": [
"error",
{
"functions": false,
"classes": true,
"variables": false
}
],
// Import rules overrides
"import/no-cycle": "warn",
// Accesibility rules overrides
"jsx-a11y/no-noninteractive-tabindex": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/control-has-associated-label": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/tabindex-no-positive": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
// React rules overrides
"react/jsx-props-no-spreading": "warn", // 17 errors
"react/jsx-filename-extension": "off",
"react/sort-comp": [
"error",
{
"order": [
"static-methods",
"lifecycle",
"everything-else",
"render"
],
"groups": {
"lifecycle": [
"displayName",
"propTypes",
"contextTypes",
"childContextTypes",
"mixins",
"statics",
"defaultProps",
"constructor",
"getDefaultProps",
"state",
"getInitialState",
"getChildContext",
"getDerivedStateFromProps",
"componentWillMount",
"UNSAFE_componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"UNSAFE_componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"UNSAFE_componentWillUpdate",
"getSnapshotBeforeUpdate",
"componentDidUpdate",
"componentDidCatch",
"componentWillUnmount"
]
}
}
],
"react/forbid-prop-types": "off", // 216 errors
"react/require-default-props": "off" // 965 errors
}
}
]
}