@@ -44,50 +44,54 @@ ruleTester.run('force-types-on-object-props', rule, {
44
44
}
45
45
</script>
46
46
` ,
47
- template ( 'type: Object as Prop<{}>' ) ,
48
47
template ( 'type: String' ) ,
48
+ template ( 'foo: String,' ) ,
49
49
template ( 'type: Number' ) ,
50
50
template ( 'type: Boolean' ) ,
51
- template ( 'type: [String, Number, Boolean]' )
51
+ template ( 'type: [String, Number, Boolean]' ) ,
52
+ template ( 'foo: someFunction(),' ) ,
53
+ template ( 'foo: { type: Object as () => User }' ) ,
54
+ template ( 'type: Object as Prop<{}>' ) ,
55
+ template ( 'foo: { type: Object as PropType<User> },' ) ,
52
56
] ,
53
57
invalid : [
54
58
{
55
59
code : template ( 'type: Object' ) ,
56
60
errors : [
57
61
{
58
- message : 'Object props has to contains type .'
62
+ message : 'Expected type annotation on object prop .'
59
63
}
60
64
]
61
65
} ,
62
66
{
63
67
code : template ( 'type: Object as any' ) ,
64
68
errors : [
65
69
{
66
- message : 'Object props has to contains type .'
70
+ message : 'Expected type annotation on object prop .'
67
71
}
68
72
]
69
73
} ,
70
74
{
71
75
code : template ( 'type: Object as {}' ) ,
72
76
errors : [
73
77
{
74
- message : 'Object props has to contains type .'
78
+ message : 'Expected type annotation on object prop .'
75
79
}
76
80
]
77
81
} ,
78
82
{
79
83
code : template ( 'type: Object as unknown' ) ,
80
84
errors : [
81
85
{
82
- message : 'Object props has to contains type .'
86
+ message : 'Expected type annotation on object prop .'
83
87
}
84
88
]
85
89
} ,
86
90
{
87
91
code : template ( 'type: Object as string' ) ,
88
92
errors : [
89
93
{
90
- message : 'Object props has to contains type .'
94
+ message : 'Expected type annotation on object prop .'
91
95
}
92
96
]
93
97
}
0 commit comments