-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
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 Merge = boolean | ((incoming: string[]) => void);
const policy: { merge: Merge } = {
merge: (incoming: string[] = []) => {
incoming;
},
};ESLint Config
{
"rules": {
"@typescript-eslint/no-useless-default-assignment": "error",
}
}tsconfig
Expected Result
Don't crash
Actual Result
TypeError: Cannot read properties of undefined (reading 'getParameters')
at AssignmentPattern (https://typescript-eslint.io/sandbox/index.js:1:1970743)
at https://typescript-eslint.io/sandbox/index.js:1:1519135
at https://typescript-eslint.io/sandbox/index.js:1:1457396
at Array.forEach (<anonymous>)
at SourceCodeVisitor.callSync (https://typescript-eslint.io/sandbox/index.js:1:1457384)
at https://typescript-eslint.io/sandbox/index.js:1:1507727
at Array.forEach (<anonymous>)
at l.traverseSync (https://typescript-eslint.io/sandbox/index.js:1:1507712)
at se (https://typescript-eslint.io/sandbox/index.js:1:1519263)
at Linter.ue (https://typescript-eslint.io/sandbox/index.js:1:1524589) 4:11 - 4:34
Additional Info
Originally reported by @simPod in #11720 (comment).
GeKorm, splincode, brokentone, ethan-ccm, jerone and 1 more
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
{ "compilerOptions": { "strictNullChecks": true } }