@@ -103,14 +103,14 @@ ruleTester.run('no-deprecated-report-api', rule, {
103
103
code : `
104
104
module.exports = {
105
105
create(context) {
106
- context.report(theNode, theLocation , theMessage, theData, theFix);
106
+ context.report(theNode, { line: foo, column: bar } , theMessage, theData, theFix);
107
107
}
108
108
};
109
109
` ,
110
110
output : `
111
111
module.exports = {
112
112
create(context) {
113
- context.report({node: theNode, loc: theLocation , message: theMessage, data: theData, fix: theFix});
113
+ context.report({node: theNode, loc: { line: foo, column: bar } , message: theMessage, data: theData, fix: theFix});
114
114
}
115
115
};
116
116
` ,
@@ -120,14 +120,14 @@ ruleTester.run('no-deprecated-report-api', rule, {
120
120
code : `
121
121
module.exports = {
122
122
create(context) {
123
- context.report(theNode, theMessage, theData, theFix);
123
+ context.report(theNode, " theMessage" , theData, theFix);
124
124
}
125
125
};
126
126
` ,
127
127
output : `
128
128
module.exports = {
129
129
create(context) {
130
- context.report({node: theNode, message: theMessage, data: theData, fix: theFix});
130
+ context.report({node: theNode, message: " theMessage" , data: theData, fix: theFix});
131
131
}
132
132
};
133
133
` ,
@@ -144,7 +144,7 @@ ruleTester.run('no-deprecated-report-api', rule, {
144
144
output : `
145
145
module.exports = {
146
146
create(context) {
147
- context.report({node: theNode, message: theMessage, data: theData, fix: theFix} );
147
+ context.report(theNode, theMessage, theData, theFix);
148
148
}
149
149
};
150
150
` ,
@@ -154,14 +154,14 @@ ruleTester.run('no-deprecated-report-api', rule, {
154
154
code : `
155
155
module.exports = {
156
156
create(context) {
157
- context.report(theNode, theMessage , theData);
157
+ context.report(theNode, 'foo' , theData);
158
158
}
159
159
};
160
160
` ,
161
161
output : `
162
162
module.exports = {
163
163
create(context) {
164
- context.report({node: theNode, message: theMessage , data: theData});
164
+ context.report({node: theNode, message: 'foo' , data: theData});
165
165
}
166
166
};
167
167
` ,
@@ -171,14 +171,14 @@ ruleTester.run('no-deprecated-report-api', rule, {
171
171
code : `
172
172
module.exports = {
173
173
create(context) {
174
- context.report(theNode, theMessage );
174
+ context.report(theNode, 'foo' );
175
175
}
176
176
};
177
177
` ,
178
178
output : `
179
179
module.exports = {
180
180
create(context) {
181
- context.report({node: theNode, message: theMessage });
181
+ context.report({node: theNode, message: 'foo' });
182
182
}
183
183
};
184
184
` ,
@@ -195,7 +195,7 @@ ruleTester.run('no-deprecated-report-api', rule, {
195
195
output : `
196
196
module.exports = {
197
197
create(notContext) {
198
- notContext.report({node: theNode, message: theMessage, data: theData, fix: theFix} );
198
+ notContext.report(theNode, theMessage, theData, theFix);
199
199
}
200
200
};
201
201
` ,
@@ -204,12 +204,25 @@ ruleTester.run('no-deprecated-report-api', rule, {
204
204
{
205
205
code : `
206
206
module.exports.create = context => {
207
- context.report(theNode, theMessage , theData, theFix);
207
+ context.report(theNode, \`blah\` , theData, theFix);
208
208
};
209
209
` ,
210
210
output : `
211
211
module.exports.create = context => {
212
- context.report({node: theNode, message: theMessage, data: theData, fix: theFix});
212
+ context.report({node: theNode, message: \`blah\`, data: theData, fix: theFix});
213
+ };
214
+ ` ,
215
+ errors : [ ERROR ] ,
216
+ } ,
217
+ {
218
+ code : `
219
+ module.exports.create = context => {
220
+ context.report(theNode, 5, foo, bar);
221
+ };
222
+ ` ,
223
+ output : `
224
+ module.exports.create = context => {
225
+ context.report({node: theNode, loc: 5, message: foo, data: bar});
213
226
};
214
227
` ,
215
228
errors : [ ERROR ] ,
@@ -225,7 +238,7 @@ ruleTester.run('no-deprecated-report-api', rule, {
225
238
output : `
226
239
module.exports = {
227
240
create(context) {
228
- context.report({node: theNode, loc: theLocation, message: theMessage, data: theData, fix: theFix} );
241
+ context.report(theNode, theLocation, theMessage, theData, theFix, somethingElse, somethingElse, somethingElse );
229
242
}
230
243
};
231
244
` ,
0 commit comments