Closed as not planned
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
declare const value: unknown;
value || {};
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/prefer-nullish-coalescing": "error"
}
}
tsconfig
Expected Result
No crash. Perhaps a lint report.
Actual Result
TypeError: Cannot read properties of undefined (reading 'some')
Occurred while linting /input.tsx:2
Rule: "@typescript-eslint/prefer-nullish-coalescing"
at LogicalExpression[operator = "||"] (https://typescript-eslint.io/sandbox/index.js:143:58720)
at https://typescript-eslint.io/sandbox/index.js:106:2597
at https://typescript-eslint.io/sandbox/index.js:100:32964
at Array.forEach (<anonymous>)
at Object.emit (https://typescript-eslint.io/sandbox/index.js:100:32953)
at _x.applySelector (https://typescript-eslint.io/sandbox/index.js:41:22861)
at _x.applySelectors (https://typescript-eslint.io/sandbox/index.js:41:23157)
at _x.enterNode (https://typescript-eslint.io/sandbox/index.js:41:23248)
at yx.enterNode (https://typescript-eslint.io/sandbox/index.js:35:23816)
at https://typescript-eslint.io/sandbox/index.js:106:3033 2:1 - 2:12
Additional Info
Discovered in JoshuaKGoldberg/eslint-plugin-package-json#117.