@@ -56,8 +56,8 @@ mount(AppWithDefine, {
56
56
} )
57
57
58
58
expectError (
59
- // @ts -expect-error wrong prop type should not compile
60
59
mount ( AppWithDefine , {
60
+ // @ts -expect-error wrong prop type should not compile
61
61
props : { a : 2 }
62
62
} )
63
63
)
@@ -186,14 +186,12 @@ declare const FunctionalComponentEmit: FunctionalComponent<
186
186
level : number
187
187
} ,
188
188
{ hello : ( foo : string , bar : string ) => void }
189
- >
189
+ >
190
190
191
191
mount ( FunctionalComponent )
192
192
mount ( defineComponent ( FunctionalComponent ) )
193
193
194
194
mount ( FunctionalComponentEmit )
195
-
196
- // @ts -ignore vue 3.0.2 doesn't work. FIX: https://github.com/vuejs/vue-next/pull/2494
197
195
mount ( defineComponent ( FunctionalComponentEmit ) )
198
196
199
197
// class component
@@ -204,7 +202,7 @@ mount(defineComponent(FunctionalComponentEmit))
204
202
}
205
203
} )
206
204
class ClassComponent extends Vue {
207
- dataText : string = ''
205
+ dataText = ''
208
206
get computedMsg ( ) : string {
209
207
return `Message: ${ ( this . $props as any ) . msg } `
210
208
}
@@ -224,6 +222,7 @@ class CustomClassComponent<Props extends {} = {}> {
224
222
private static __vccValue ?: ComponentOptions
225
223
static get __vccOpts ( ) : ComponentOptions {
226
224
if ( this . __vccValue ) return this . __vccValue
225
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
227
226
const CompConstructor = this
228
227
return ( this . __vccValue = {
229
228
name : CompConstructor . name ,
@@ -279,14 +278,20 @@ class WithPropCustomClassComponent extends CustomClassComponent<CustomClassCompo
279
278
}
280
279
281
280
expectError (
282
- // @ts -expect-error should has props error
283
- mount < WithPropCustomClassComponent , CustomClassComponentProps > ( WithPropCustomClassComponent , {
284
- props : { }
285
- } )
281
+ mount < WithPropCustomClassComponent , CustomClassComponentProps > (
282
+ // @ts -expect-error should has props error
283
+ WithPropCustomClassComponent ,
284
+ {
285
+ props : { }
286
+ }
287
+ )
288
+ )
289
+ mount < WithPropCustomClassComponent , CustomClassComponentProps > (
290
+ WithPropCustomClassComponent ,
291
+ {
292
+ props : { size : 'small' }
293
+ }
286
294
)
287
- mount < WithPropCustomClassComponent , CustomClassComponentProps > ( WithPropCustomClassComponent , {
288
- props : { size : 'small' }
289
- } )
290
295
291
296
// endregion
292
297
@@ -313,7 +318,6 @@ mount(Foo, {
313
318
314
319
expectError (
315
320
mount (
316
- // @ts -expect-error
317
321
defineComponent ( {
318
322
props : {
319
323
baz : String ,
@@ -324,6 +328,7 @@ expectError(
324
328
}
325
329
} ) ,
326
330
{
331
+ // @ts -expect-error
327
332
props : {
328
333
baz : 'hello'
329
334
}
0 commit comments