-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [no-misused-promises] expand union type to retrieve target property #11706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for the PR, @ntdiary! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 5f74775
☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11706 +/- ##
=======================================
Coverage 90.67% 90.67%
=======================================
Files 518 518
Lines 52466 52466
Branches 8694 8696 +2
=======================================
Hits 47571 47571
Misses 4881 4881
Partials 14 14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Nice and clean, this is a good change. 🧼
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.46.1 | 8.46.3 | | npm | @typescript-eslint/parser | 8.46.1 | 8.46.3 | ## [v8.46.3](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8463-2025-11-03) ##### 🩹 Fixes - **eslint-plugin:** \[no-duplicate-enum-values] support signed numbers ([#11722](typescript-eslint/typescript-eslint#11722), [#11723](typescript-eslint/typescript-eslint#11723)) - **eslint-plugin:** \[no-misused-promises] expand union type to retrieve target property ([#11706](typescript-eslint/typescript-eslint#11706)) ##### ❤️ Thank You - Evgeny Stepanovych [@undsoft](https://github.com/undsoft) - tao You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.46.2](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8462-2025-10-20) ##### 🩹 Fixes - **eslint-plugin:** \[prefer-optional-chain] skip optional chaining when it could change the result ([#11702](typescript-eslint/typescript-eslint#11702)) ##### ❤️ Thank You - mdm317 You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.

PR Checklist
strictenabled #11699Overview
For union type,
getPropertyOfType(type, name)can’t get property that exist only in one constituent. We need to manually expand the union and check each constituent, andunionConstituentshelper is a good choice for this and also works with non-union type.💖