Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(eslint-plugin): [no-unsafe-member-access] add allowOptionalChaining option#11659
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Thanks for the PR,@JoshuaKGoldberg! 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 onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedSep 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify project configuration. |
nx-cloudbot commentedSep 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View yourCI Pipeline Execution ↗ for commita9df1da
☁️Nx Cloud last updated this comment at |
codecovbot commentedSep 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #11659 +/- ##======================================= Coverage 90.74% 90.74% ======================================= Files 516 516 Lines 51987 52013 +26 Branches 8588 8594 +6 =======================================+ Hits 47174 47200 +26 Misses 4799 4799 Partials 14 14
Flags with carried forward coverage won't be shown.Click here to find out more.
🚀 New features to boost your workflow:
|
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.
🚀
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Ronen Amiel <ronen.amiel@gmail.com>
f083798
intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
This was a little tricker than I'd hoped. The AST positions
ChainExpression
s as the parent of allMemberExpression
s in the chain, rather than inline in the stack. This PR modifies the node checker to have a thirdState
,State.Chained
, to save for nodes.This results in an edge case where if you have an optional property in the middle of a stack of
any
MemberExpression
s (value.outer?.middle.inner
), the rule reports twice. I don't think this is a very common use case that we need to optimize for.💖