File tree 2 files changed +68
-2
lines changed
react-scripts/fixtures/kitchensink/src
2 files changed +68
-2
lines changed Original file line number Diff line number Diff line change 18
18
// In the future, we might create a separate list of rules for production.
19
19
// It would probably be more strict.
20
20
21
+ // The ESLint browser environment defines all browser globals as valid,
22
+ // even though most people don't know some of them exist (e.g. `name` or `status`).
23
+ // This is dangerous as it hides accidentally undefined variables.
24
+ // We blacklist the globals that we deem potentially confusing.
25
+ // To use them, explicitly reference them, e.g. `window.name` or `window.status`.
26
+ var restrictedGlobals = [
27
+ 'addEventListener' ,
28
+ 'blur' ,
29
+ 'close' ,
30
+ 'closed' ,
31
+ 'confirm' ,
32
+ 'defaultStatus' ,
33
+ 'defaultstatus' ,
34
+ 'event' ,
35
+ 'external' ,
36
+ 'find' ,
37
+ 'focus' ,
38
+ 'frameElement' ,
39
+ 'frames' ,
40
+ 'history' ,
41
+ 'innerHeight' ,
42
+ 'innerWidth' ,
43
+ 'length' ,
44
+ 'location' ,
45
+ 'locationbar' ,
46
+ 'menubar' ,
47
+ 'moveBy' ,
48
+ 'moveTo' ,
49
+ 'name' ,
50
+ 'onblur' ,
51
+ 'onerror' ,
52
+ 'onfocus' ,
53
+ 'onload' ,
54
+ 'onresize' ,
55
+ 'onunload' ,
56
+ 'open' ,
57
+ 'opener' ,
58
+ 'opera' ,
59
+ 'outerHeight' ,
60
+ 'outerWidth' ,
61
+ 'pageXOffset' ,
62
+ 'pageYOffset' ,
63
+ 'parent' ,
64
+ 'print' ,
65
+ 'removeEventListener' ,
66
+ 'resizeBy' ,
67
+ 'resizeTo' ,
68
+ 'screen' ,
69
+ 'screenLeft' ,
70
+ 'screenTop' ,
71
+ 'screenX' ,
72
+ 'screenY' ,
73
+ 'scroll' ,
74
+ 'scrollbars' ,
75
+ 'scrollBy' ,
76
+ 'scrollTo' ,
77
+ 'scrollX' ,
78
+ 'scrollY' ,
79
+ 'self' ,
80
+ 'status' ,
81
+ 'statusbar' ,
82
+ 'stop' ,
83
+ 'toolbar' ,
84
+ 'top' ,
85
+ ] ;
86
+
21
87
module . exports = {
22
88
root : true ,
23
89
@@ -121,7 +187,7 @@ module.exports = {
121
187
'no-this-before-super' : 'warn' ,
122
188
'no-throw-literal' : 'warn' ,
123
189
'no-undef' : 'error' ,
124
- 'no-restricted-globals' : [ 'error' , 'event' ] ,
190
+ 'no-restricted-globals' : [ 'error' ] . concat ( restrictedGlobals ) ,
125
191
'no-unexpected-multiline' : 'warn' ,
126
192
'no-unreachable' : 'warn' ,
127
193
'no-unused-expressions' : [
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class App extends Component {
54
54
}
55
55
56
56
componentDidMount ( ) {
57
- const feature = location . hash . slice ( 1 ) ;
57
+ const feature = window . location . hash . slice ( 1 ) ;
58
58
switch ( feature ) {
59
59
case 'array-destructuring' :
60
60
import (
You can’t perform that action at this time.
0 commit comments