@@ -63,7 +63,10 @@ ruleTester.run('jsx-boolean-value', rule, {
63
63
output : '<App foo />;' ,
64
64
options : [ 'never' ] ,
65
65
errors : [
66
- { messageId : 'omitBoolean_noMessage' } ,
66
+ {
67
+ messageId : 'omitBoolean' ,
68
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
69
+ } ,
67
70
] ,
68
71
} ,
69
72
{
@@ -73,34 +76,43 @@ ruleTester.run('jsx-boolean-value', rule, {
73
76
errors : [
74
77
{
75
78
messageId : 'omitBoolean' ,
76
- data : { exceptionsMessage : ' for the following props: `foo`, `bar` ' } ,
79
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
77
80
} ,
78
81
{
79
82
messageId : 'omitBoolean' ,
80
- data : { exceptionsMessage : ' for the following props: `foo`, ` bar`' } ,
83
+ data : { exceptionsMessage : ' for the following props: `bar`' } ,
81
84
} ,
82
85
] ,
83
86
} ,
84
87
{
85
88
code : '<App foo={true} />;' ,
86
89
output : '<App foo />;' ,
87
90
errors : [
88
- { messageId : 'omitBoolean_noMessage' } ,
91
+ {
92
+ messageId : 'omitBoolean' ,
93
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
94
+ } ,
89
95
] ,
90
96
} ,
91
97
{
92
98
code : '<App foo = {true} />;' ,
93
99
output : '<App foo />;' ,
94
100
errors : [
95
- { messageId : 'omitBoolean_noMessage' } ,
101
+ {
102
+ messageId : 'omitBoolean' ,
103
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
104
+ } ,
96
105
] ,
97
106
} ,
98
107
{
99
108
code : '<App foo />;' ,
100
109
output : '<App foo={true} />;' ,
101
110
options : [ 'always' ] ,
102
111
errors : [
103
- { messageId : 'setBoolean_noMessage' } ,
112
+ {
113
+ messageId : 'setBoolean' ,
114
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
115
+ } ,
104
116
] ,
105
117
} ,
106
118
{
@@ -110,11 +122,11 @@ ruleTester.run('jsx-boolean-value', rule, {
110
122
errors : [
111
123
{
112
124
messageId : 'setBoolean' ,
113
- data : { exceptionsMessage : ' for the following props: `foo`, `bar` ' } ,
125
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
114
126
} ,
115
127
{
116
128
messageId : 'setBoolean' ,
117
- data : { exceptionsMessage : ' for the following props: `foo`, ` bar`' } ,
129
+ data : { exceptionsMessage : ' for the following props: `bar`' } ,
118
130
} ,
119
131
] ,
120
132
} ,
@@ -123,8 +135,14 @@ ruleTester.run('jsx-boolean-value', rule, {
123
135
output : '<App />;' ,
124
136
options : [ 'never' , { assumeUndefinedIsFalse : true } ] ,
125
137
errors : [
126
- { messageId : 'omitPropAndBoolean_noMessage' } ,
127
- { messageId : 'omitPropAndBoolean_noMessage' } ,
138
+ {
139
+ messageId : 'omitPropAndBoolean' ,
140
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
141
+ } ,
142
+ {
143
+ messageId : 'omitPropAndBoolean' ,
144
+ data : { exceptionsMessage : ' for the following props: `bak`' } ,
145
+ } ,
128
146
] ,
129
147
} ,
130
148
{
@@ -137,11 +155,30 @@ ruleTester.run('jsx-boolean-value', rule, {
137
155
errors : [
138
156
{
139
157
messageId : 'omitPropAndBoolean' ,
140
- data : { exceptionsMessage : ' for the following props: `baz`, `bak` ' } ,
158
+ data : { exceptionsMessage : ' for the following props: `baz`' } ,
141
159
} ,
142
160
{
143
161
messageId : 'omitPropAndBoolean' ,
144
- data : { exceptionsMessage : ' for the following props: `baz`, `bak`' } ,
162
+ data : { exceptionsMessage : ' for the following props: `bak`' } ,
163
+ } ,
164
+ ] ,
165
+ } ,
166
+ {
167
+ code : '<App foo={true} bar={true} baz />;' ,
168
+ output : '<App foo bar baz={true} />;' ,
169
+ options : [ 'always' , { never : [ 'foo' , 'bar' ] } ] ,
170
+ errors : [
171
+ {
172
+ messageId : 'omitBoolean' ,
173
+ data : { exceptionsMessage : ' for the following props: `foo`' } ,
174
+ } ,
175
+ {
176
+ messageId : 'omitBoolean' ,
177
+ data : { exceptionsMessage : ' for the following props: `bar`' } ,
178
+ } ,
179
+ {
180
+ messageId : 'setBoolean' ,
181
+ data : { exceptionsMessage : ' for the following props: `baz`' } ,
145
182
} ,
146
183
] ,
147
184
} ,
0 commit comments