1
1
import {
2
- RuleTester
2
+ RuleTester
3
3
} from 'eslint' ;
4
4
import noUndefRule from 'eslint/lib/rules/no-undef' ;
5
5
@@ -45,7 +45,7 @@ const VALID_WITH_DEFINE_FLOW_TYPE = [
45
45
{
46
46
code : 'opaque type A = AType' ,
47
47
errors : [
48
- // Complaining about 'A' not being defined might be an upstream bug
48
+ // Complaining about 'A' is fixed in https://github.com/babel/babel-eslint/pull/696
49
49
'\'A\' is not defined.' ,
50
50
'\'AType\' is not defined.'
51
51
]
@@ -105,12 +105,6 @@ const VALID_WITH_DEFINE_FLOW_TYPE = [
105
105
'\'AType\' is not defined.'
106
106
]
107
107
} ,
108
- {
109
- code : 'interface AType {}' ,
110
- errors : [
111
- '\'AType\' is not defined.'
112
- ]
113
- } ,
114
108
{
115
109
code : 'declare interface A {}' ,
116
110
errors : [
@@ -120,8 +114,8 @@ const VALID_WITH_DEFINE_FLOW_TYPE = [
120
114
{
121
115
code : '({ a: ({b() {}}: AType) })' ,
122
116
123
- // `AType` appears twice in `globalScope.through` as distinct
124
- // references, this may be a babel-eslint bug.
117
+ // `AType` appears twice in `globalScope.through` as distinct
118
+ // references, this may be a babel-eslint bug.
125
119
errors : [
126
120
'\'AType\' is not defined.' ,
127
121
'\'AType\' is not defined.'
@@ -133,13 +127,6 @@ const VALID_WITH_DEFINE_FLOW_TYPE = [
133
127
'\'AType\' is not defined.' ,
134
128
'\'BType\' is not defined.'
135
129
]
136
- } ,
137
- {
138
- code : 'interface AType<BType> {}' ,
139
- errors : [
140
- '\'AType\' is not defined.' ,
141
- '\'BType\' is not defined.'
142
- ]
143
130
}
144
131
] ;
145
132
@@ -196,7 +183,7 @@ const ALWAYS_VALID = [
196
183
parser : 'babel-eslint'
197
184
} ) ;
198
185
199
- ruleTester . run ( 'no-under must not trigger an error in these cases' , noUndefRule , {
186
+ ruleTester . run ( 'no-undef must not trigger an error in these cases' , noUndefRule , {
200
187
invalid : [ ] ,
201
188
valid : ALWAYS_VALID
202
189
} ) ;
0 commit comments