File tree 3 files changed +36
-2
lines changed
3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -3756,6 +3756,20 @@ declare global {
3756
3756
*/
3757
3757
function foo(this: void, arg1: number): void;
3758
3758
}
3759
+
3760
+ declare global {
3761
+ /**
3762
+ * @param r Range is 0-1.
3763
+ * @param g Range is 0-1.
3764
+ * @param b Range is 0-1.
3765
+ */
3766
+ function Color(
3767
+ this: void,
3768
+ r: float,
3769
+ g: float,
3770
+ b: float,
3771
+ ): Color;
3772
+ }
3759
3773
````
3760
3774
3761
3775
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ const validateParameterNames = (
36
36
} ) ;
37
37
38
38
let dotted = 0 ;
39
+ let thisOffset = 0 ;
39
40
40
41
// eslint-disable-next-line complexity
41
42
return paramTags . some ( ( [
@@ -64,9 +65,10 @@ const validateParameterNames = (
64
65
return false ;
65
66
}
66
67
67
- let functionParameterName = functionParameterNames [ index - dotted ] ;
68
+ let functionParameterName = functionParameterNames [ index - dotted + thisOffset ] ;
68
69
if ( functionParameterName === 'this' ) {
69
- functionParameterName = functionParameterNames [ index - dotted + 1 ] ;
70
+ ++ thisOffset ;
71
+ functionParameterName = functionParameterNames [ index - dotted + thisOffset ] ;
70
72
}
71
73
72
74
if ( ! functionParameterName ) {
Original file line number Diff line number Diff line change @@ -1777,5 +1777,23 @@ export default {
1777
1777
ignoreReadme : true ,
1778
1778
parser : require . resolve ( '@typescript-eslint/parser' ) ,
1779
1779
} ,
1780
+ {
1781
+ code : `
1782
+ declare global {
1783
+ /**
1784
+ * @param r Range is 0-1.
1785
+ * @param g Range is 0-1.
1786
+ * @param b Range is 0-1.
1787
+ */
1788
+ function Color(
1789
+ this: void,
1790
+ r: float,
1791
+ g: float,
1792
+ b: float,
1793
+ ): Color;
1794
+ }
1795
+ ` ,
1796
+ parser : require . resolve ( '@typescript-eslint/parser' ) ,
1797
+ } ,
1780
1798
] ,
1781
1799
} ;
You can’t perform that action at this time.
0 commit comments