-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [no-deprecated] fix double-report on computed literal identifiers #11006
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
fix(eslint-plugin): [no-deprecated] fix double-report on computed literal identifiers #11006
Conversation
|
Thanks for the PR, @undsoft! 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. |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t typecheck |
❌ Failed | 2m 12s | View ↗ |
nx test eslint-plugin --coverage=false |
✅ Succeeded | 5m 11s | View ↗ |
nx test typescript-estree --coverage=false |
✅ Succeeded | 2s | View ↗ |
nx run types:build |
✅ Succeeded | 5s | View ↗ |
nx run integration-tests:test |
✅ Succeeded | 9s | View ↗ |
nx test eslint-plugin-internal --coverage=false |
✅ Succeeded | 4s | View ↗ |
nx run generate-configs |
✅ Succeeded | 6s | View ↗ |
nx run-many --target=build --parallel --exclude... |
✅ Succeeded | 21s | View ↗ |
Additional runs (28) |
✅ Succeeded | ... | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-11-03 19:45:09 UTC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11006 +/- ##
==========================================
- Coverage 90.93% 90.66% -0.28%
==========================================
Files 506 518 +12
Lines 51394 52442 +1048
Branches 8482 8690 +208
==========================================
+ Hits 46735 47546 +811
- Misses 4646 4882 +236
- Partials 13 14 +1
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.
🙌 Great start, thanks for kicking it off! I think there's just one case around [key] that I think is still missing?
…oft/typescript-eslint into 10958-string-literals-in-deprecated
|
@JoshuaKGoldberg const myObject = {
/** @deprecated */
recommended: null,
};
const key = 'recommended';
const k2 = 'recom';
const k3 = 'mended';
myObject[key]; // Works
myObject[`${k2}${k3}`]; // WorksHowever, more complex identifiers like: const myObject = {
/** @deprecated */
recommended: null,
};
const key = {
nested: 'recommended'
} as const;
myObject[key.nested]; // Doesn't workare not supported, because I feel like fixing this may be outside of the scope for this PR? Or otherwise I could use some guidance as to how to do this. |
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.
Really lovely progress! 💪
Agreed, yeah - I think it'd be good as a followup issue. |
…958-string-literals-in-deprecated
|
Okay, I believe I've addressed the comments. |
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.
Sorry for the delay - the summer really got away from us, and I wanted to give this tricky PR the detailed review it deserves. But it looks great - thanks so much for working on it! 😍
|
I'll handle the merge conflicts so we can ideally merge this in time for the release today. |
|
😬 these are non-trivial merge conflicts. I ran out of time today to try to get this to work. @undsoft I don't suppose you have bandwidth to fix these up? |
|
@JoshuaKGoldberg Hi, at the moment unfortunately I don't have spare time to fix this. I may have time in a couple of months. |
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.
You're right, this rule did need redoing because of the merge conflicts. There were really two areas of logic:
checkIdentifier: already in existencecheckMemberExpression: recently added
...and this addition of using checkIdentifier on literals caused double-reporting in quite a few test cases. I ended up removing checkMemberExpression altogether and merging its new logic into checkIdentifier.
Someone else from @typescript-eslint/triage-team should review this PR since I'm essentially a co-author on it now.
| ], | ||
| }, | ||
| ], | ||
| }, |
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.
ronami
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.
🚀🚀🚀
Co-authored-by: Ronen Amiel <ronen.amiel@gmail.com>
|
Ok! You're right, this become much cleaner after a reset onto main. Nice. |
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.
Looks amazing, thanks! 🚀
c779f3c
into
typescript-eslint:main

PR Checklist
Overview
Adds support for literal member access like
a['b']