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
// If you comment in following or adding `as const` to return value of foo, All is OK
// type Foo = [boolean, { loading: boolean }];
// function foo(): Foo {
// return [false, { loading: false }]
// }
function foo() {
return [false, {loading: false}]
}
const [bar, {loading: a}] = foo()
const b = false
const c = false
const loading = a || b || c;
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/prefer-nullish-coalescing": "error"
}
}
tsconfig
Expected Result
No lint and internal errors
Actual Result
Following internal error happened
TypeError: Cannot read properties of undefined (reading 'some')
Occurred while linting /input.tsx:15
Rule: "@typescript-eslint/prefer-nullish-coalescing"
at LogicalExpression[operator = "||"] (https://typescript-eslint.io/sandbox/index.js:143:58720)
Additional Info
No response
Metadata
Metadata
Assignees
Labels
Go ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueSomething isn't workingSomething isn't workingIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin