Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
type UnitName = 'milliseconds' | 'seconds' | 'minutes'
class Time {
private readonly value: number
constructor(value?: number) {
this.value = value ?? Date.now()
}
public add(millis: number): Time
public add(value: number, unit: UnitName): Time
public add(value: number, unit?: UnitName): Time {
let multiplier: number
switch (unit) {
case undefined:
case 'milliseconds':
multiplier = 1
break
case 'seconds':
multiplier = 1000
break
case 'minutes':
multiplier = 60000
break
}
return new Time(this.value + value * multiplier)
}
}
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/unified-signatures": [
1,
{
"ignoreDifferentlyNamedParameters": true
}
]
}
}
tsconfig
Expected Result
No error should be reported, at least with the ignoreDifferentlyNamedParameters
option turned on, since the overloads I'm supposed to combine have a differently named first parameter.
Actual Result
I get the following ESLint warning:
These overloads can be combined into one signature with an optional parameter. 11:29 - 11:43
Additional Info
No response