Bug: [prefer-nullish-coalescing] internal error when linting on binary expression (||) with nullable type #7222
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play#ts=5.1.6&fileType=.tsx&code=DYUwLgBAhgXBDOYBOBLAdgcwgHwmgrsMBALx6HADcAUKJAEZyKqY7lGntXXVQ671qQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0WlqYSNkAC1pkA9gEMkyMswDm6KL2jjokcGAC%2BILUA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eFYDAruuGAL4g9A&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
No internal errors
Actual Result
eslint throws when linting on the line
a || b
The error is probably thrown from
typescript-eslint/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
Line 313 in 058c449
Additional Info
(I didn't figure out how to run the lint again with
--debug
flag on the playground)The reproduction is extracted from the Babel source: https://github.com/babel/babel/blob/main/packages/babel-helper-create-class-features-plugin/src/features.ts, first reported here.
The text was updated successfully, but these errors were encountered: