Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
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 havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
declareconstvalue:unknown;value||{};
ESLint Config
module.exports={"rules":{"@typescript-eslint/prefer-nullish-coalescing":"error"}}
tsconfig
{"compilerOptions": {"strictNullChecks":true }}Expected Result
No crash. Perhaps a lint report.
Actual Result
TypeError: Cannot read properties of undefined (reading 'some')Occurred while linting /input.tsx:2Rule: "@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:12Additional Info
Discovered inJoshuaKGoldberg/eslint-plugin-package-json#117.