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
export abstract class Test {
abstract method(flag: true): number;
abstract method(): string;
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
},
};
tsconfig
Expected Result
Linter should pass.
Actual Result
Oops! Something went wrong! :(
ESLint: 8.38.0
TypeError: Cannot read properties of undefined (reading 'type')
Occurred while linting test.ts:13
Rule: "@typescript-eslint/unified-signatures"
at signaturesCanBeUnified (./node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js:146:58)
at compareSignatures (./node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js:133:18)
at ./node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js:124:35
at forEachPair (./node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js:311:21)
at checkOverloads (./node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js:120:17)
at checkScope (./node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js:328:30)
at ruleErrorHandler (./node_modules/eslint/lib/linter/linter.js:1077:28)
at ./node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (./node_modules/eslint/lib/linter/safe-emitter.js:45:38)
Additional Info
Happens only with option "ignoreDifferentlyNamedParameters".