@@ -328,14 +328,124 @@ ruleTesterTypeScript.run("max-params", rule, {
328328 declare function makeDate(m: number, d: number, y: number): Date;
329329 ` ,
330330 options : [ { max : 1 } ] ,
331- errors : [ { messageId : "exceed" } ] ,
331+ errors : [
332+ {
333+ messageId : "exceed" ,
334+ data : { name : "Function 'makeDate'" , count : 3 , max : 1 } ,
335+ line : 2 ,
336+ column : 3 ,
337+ endLine : 2 ,
338+ endColumn : 28 ,
339+ } ,
340+ ] ,
332341 } ,
333342 {
334343 code : `
335344 type sum = (a: number, b: number) => number;
336345 ` ,
337346 options : [ { max : 1 } ] ,
338- errors : [ { messageId : "exceed" } ] ,
347+ errors : [
348+ {
349+ messageId : "exceed" ,
350+ data : { name : "Function" , count : 2 , max : 1 } ,
351+ line : 2 ,
352+ column : 37 ,
353+ endLine : 2 ,
354+ endColumn : 39 ,
355+ } ,
356+ ] ,
357+ } ,
358+ {
359+ code : "let f: (a: number, b: number) => number;" ,
360+ options : [ { max : 1 } ] ,
361+ errors : [
362+ {
363+ messageId : "exceed" ,
364+ data : { name : "Function" , count : 2 , max : 1 } ,
365+ line : 1 ,
366+ column : 31 ,
367+ endLine : 1 ,
368+ endColumn : 33 ,
369+ } ,
370+ ] ,
371+ } ,
372+ {
373+ code : "interface I { m: (a: number, b: number) => number; }" ,
374+ options : [ { max : 1 } ] ,
375+ errors : [
376+ {
377+ messageId : "exceed" ,
378+ data : { name : "Function" , count : 2 , max : 1 } ,
379+ line : 1 ,
380+ column : 41 ,
381+ endLine : 1 ,
382+ endColumn : 43 ,
383+ } ,
384+ ] ,
385+ } ,
386+ {
387+ code : "function g(cb: (a: number, b: number) => number) {}" ,
388+ options : [ { max : 1 } ] ,
389+ errors : [
390+ {
391+ messageId : "exceed" ,
392+ data : { name : "Function" , count : 2 , max : 1 } ,
393+ line : 1 ,
394+ column : 39 ,
395+ endLine : 1 ,
396+ endColumn : 41 ,
397+ } ,
398+ ] ,
399+ } ,
400+ {
401+ code : "declare function g(): (a: number, b: number) => number;" ,
402+ options : [ { max : 1 } ] ,
403+ errors : [
404+ {
405+ messageId : "exceed" ,
406+ data : { name : "Function" , count : 2 , max : 1 } ,
407+ line : 1 ,
408+ column : 46 ,
409+ endLine : 1 ,
410+ endColumn : 48 ,
411+ } ,
412+ ] ,
413+ } ,
414+ {
415+ code : "type F = <T>(a: T, b: T) => T;" ,
416+ options : [ { max : 1 } ] ,
417+ errors : [
418+ {
419+ messageId : "exceed" ,
420+ data : { name : "Function" , count : 2 , max : 1 } ,
421+ line : 1 ,
422+ column : 26 ,
423+ endLine : 1 ,
424+ endColumn : 28 ,
425+ } ,
426+ ] ,
427+ } ,
428+ {
429+ code : "type F = (a: number, b: number) => (c: number, d: number) => number;" ,
430+ options : [ { max : 1 } ] ,
431+ errors : [
432+ {
433+ messageId : "exceed" ,
434+ data : { name : "Function" , count : 2 , max : 1 } ,
435+ line : 1 ,
436+ column : 33 ,
437+ endLine : 1 ,
438+ endColumn : 35 ,
439+ } ,
440+ {
441+ messageId : "exceed" ,
442+ data : { name : "Function" , count : 2 , max : 1 } ,
443+ line : 1 ,
444+ column : 59 ,
445+ endLine : 1 ,
446+ endColumn : 61 ,
447+ } ,
448+ ] ,
339449 } ,
340450 {
341451 code : `function foo(this: unknown[], a, b, c) {}` ,
0 commit comments