@@ -254,9 +254,14 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
254
254
report ( context , messages . onlyStrings , 'onlyStrings' , {
255
255
node,
256
256
data : { attributeName } ,
257
- fix ( fixer ) {
258
- return fixer . remove ( parentNode ) ;
259
- } ,
257
+ suggest : [
258
+ {
259
+ desc : "To Be Replaced By Appropriate Message" ,
260
+ fix : function ( fixer ) {
261
+ return fixer . remove ( parentNode ) ;
262
+ }
263
+ }
264
+ ]
260
265
} ) ;
261
266
return ;
262
267
}
@@ -265,9 +270,14 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
265
270
report ( context , messages . noEmpty , 'noEmpty' , {
266
271
node,
267
272
data : { attributeName } ,
268
- fix ( fixer ) {
269
- return fixer . remove ( parentNode ) ;
270
- } ,
273
+ suggest : [
274
+ {
275
+ desc : "To Be Replaced By Appropriate Message" ,
276
+ fix : function ( fixer ) {
277
+ return fixer . remove ( parentNode ) ;
278
+ }
279
+ }
280
+ ]
271
281
} ) ;
272
282
return ;
273
283
}
@@ -283,9 +293,14 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
283
293
attributeName,
284
294
reportingValue,
285
295
} ,
286
- fix ( fixer ) {
287
- return fixer . removeRange ( singlePart . range ) ;
288
- } ,
296
+ suggest : [
297
+ {
298
+ desc : "To Be Replaced By Appropriate Message" ,
299
+ fix : function ( fixer ) {
300
+ return fixer . removeRange ( singlePart . range ) ;
301
+ }
302
+ }
303
+ ]
289
304
} ) ;
290
305
} else if ( ! allowedTags . has ( parentNodeName ) ) {
291
306
report ( context , messages . notValidFor , 'notValidFor' , {
@@ -295,9 +310,14 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
295
310
reportingValue,
296
311
elementName : parentNodeName ,
297
312
} ,
298
- fix ( fixer ) {
299
- return fixer . removeRange ( singlePart . range ) ;
300
- } ,
313
+ suggest : [
314
+ {
315
+ desc : "To Be Replaced By Appropriate Message" ,
316
+ fix : function ( fixer ) {
317
+ return fixer . removeRange ( singlePart . range ) ;
318
+ }
319
+ }
320
+ ]
301
321
} ) ;
302
322
}
303
323
}
@@ -337,17 +357,27 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
337
357
report ( context , messages . spaceDelimited , 'spaceDelimited' , {
338
358
node,
339
359
data : { attributeName } ,
340
- fix ( fixer ) {
341
- return fixer . removeRange ( whitespacePart . range ) ;
342
- } ,
360
+ suggest : [
361
+ {
362
+ desc : "To Be Replaced By Appropriate Message" ,
363
+ fix : function ( fixer ) {
364
+ return fixer . removeRange ( whitespacePart . range ) ;
365
+ }
366
+ }
367
+ ]
343
368
} ) ;
344
369
} else if ( whitespacePart . value !== '\u0020' ) {
345
370
report ( context , messages . spaceDelimited , 'spaceDelimited' , {
346
371
node,
347
372
data : { attributeName } ,
348
- fix ( fixer ) {
349
- return fixer . replaceTextRange ( whitespacePart . range , '\u0020' ) ;
350
- } ,
373
+ suggest : [
374
+ {
375
+ desc : "To Be Replaced By Appropriate Message" ,
376
+ fix : function ( fixer ) {
377
+ return fixer . removeRange ( whitespacePart . range , '\u0020' ) ;
378
+ }
379
+ }
380
+ ]
351
381
} ) ;
352
382
}
353
383
}
@@ -362,6 +392,17 @@ function checkAttribute(context, node) {
362
392
return fixer . remove ( node ) ;
363
393
}
364
394
395
+ function suggestion ( desc , fixer ) {
396
+ return [
397
+ {
398
+ desc : desc ,
399
+ fix : function ( fixer ) {
400
+ return fixer . remove ( node ) ;
401
+ }
402
+ }
403
+ ]
404
+ }
405
+
365
406
const parentNodeName = node . parent . name . name ;
366
407
if ( ! COMPONENT_ATTRIBUTE_MAP . has ( attribute ) || ! COMPONENT_ATTRIBUTE_MAP . get ( attribute ) . has ( parentNodeName ) ) {
367
408
const tagNames = Array . from (
@@ -374,7 +415,7 @@ function checkAttribute(context, node) {
374
415
attributeName : attribute ,
375
416
tagNames,
376
417
} ,
377
- fix ,
418
+ suggest : suggestion ( "hehe" ) ,
378
419
} ) ;
379
420
return ;
380
421
}
@@ -383,7 +424,7 @@ function checkAttribute(context, node) {
383
424
report ( context , messages . emptyIsMeaningless , 'emptyIsMeaningless' , {
384
425
node,
385
426
data : { attributeName : attribute } ,
386
- fix ,
427
+ suggest : suggestion ( "hehe" ) ,
387
428
} ) ;
388
429
return ;
389
430
}
@@ -404,7 +445,7 @@ function checkAttribute(context, node) {
404
445
report ( context , messages . onlyStrings , 'onlyStrings' , {
405
446
node,
406
447
data : { attributeName : attribute } ,
407
- fix ,
448
+ suggest : suggestion ( "hehe" ) ,
408
449
} ) ;
409
450
return ;
410
451
}
@@ -413,7 +454,7 @@ function checkAttribute(context, node) {
413
454
report ( context , messages . onlyStrings , 'onlyStrings' , {
414
455
node,
415
456
data : { attributeName : attribute } ,
416
- fix ,
457
+ suggest : suggestion ( "hehe" ) ,
417
458
} ) ;
418
459
}
419
460
}
0 commit comments