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-deprecated] add rule#9783
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
feat(eslint-plugin): [no-deprecated] add rule#9783
Uh oh!
There was an error while loading.Please reload this page.
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 commentedAug 12, 2024 • 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 site configuration. |
Uh oh!
There was an error while loading.Please reload this page.
nx-cloudbot commentedAug 12, 2024 • 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.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit5cd8b82. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 fromNxCloud. |
Uh oh!
There was an error while loading.Please reload this page.
2116020
tofcc6579
Compareeslint-visitor-keys: ^3.4.1 | ||
checksum: 67c7e6003d5af042d8703d11538fca9d76899f0119130b373402819ae43f0bc90d18656aa7add25a24427ccf1a0efd0804157ba83b0d4e145f06107d7d1b7433 | ||
languageName: node | ||
linkType: hard |
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.
Aside: it is very pleasing to no longer have a dependency on v6 versions of our packages. 🙃
codecovbot commentedAug 15, 2024 • 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #9783 +/- ##==========================================+ Coverage 88.01% 88.04% +0.02%========================================== Files 406 407 +1 Lines 13879 13948 +69 Branches 4055 4078 +23 ==========================================+ Hits 12216 12280 +64- Misses 1354 1355 +1- Partials 309 313 +4
Flags with carried forward coverage won't be shown.Click here to find out more.
|
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 great to me, just a few questions!
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.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>
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.
Maybe mentiondeprecation/deprecation
and why we have this rule?
0f4e484
packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-deprecated.shot OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
symbol: ts.Signature | ts.Symbol | undefined, | ||
): string | undefined { | ||
const tag = symbol | ||
?.getJsDocTags(checker) |
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.
this forces us to do "jsdoc parsing" by default :(
I kind of wish we could do it without using this -- eg with a regex so we can speed up parsing.
JoshuaKGoldbergAug 21, 2024 • 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.
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.
OH, this just reminded me we haveJSDocParsingMode
. AddingjsDocParsingMode: 'none'
to the test file'slanguageOptions.parserOptions
causes all theinvalid
tests to fail for not having any parsed JSDocs. Great.
I think we're going to want to do our own regex-based parsing. I'll put the PR back in draft in the meantime.
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.
I think this is one of the few usecases of jsdoc via TS AST in the ecosystem. So yeah if we can remove this then we can consider flipping the default in the next version to speed up parsing in the general case!
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.
Well, I tried using onsymbol.valueDeclaration
andsymbol.valueDeclaration.parent
in the firstinvalid
test case:
ts.getJSDocCommentsAndTags
: Nothing retrievedtsutils.forEachComment
: Retrieved the comment, but took ~750ms
deprecation/deprecation
also usessymbol.getJsDocTags
and suffers from the same issue. We don't (yet?) defaultjsdocParsingMode
to'none'
or'type-info'
for lint users. I added a thrown error for those modes in5cd8b82.
Back-linking to past conversation (cc@jakebailey as FYI):#7997 (comment)
JoshuaKGoldbergAug 21, 2024 • 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.
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.
Proposal: let's treat"do our own regex-based parsing" as a followup?
Edit:#9857
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.
Yeah for sure - file an issue.
Wasnt sposed to be a blocking comment. More of a "hey if we can that'd be good" thing
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.
Perhaps it's worth adding@deprecated
to the list of tags that we parse out unconditionally in the API? Would that be simpler?
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.
That could work yeah! Do you know what the performance impact would be?
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.
I'd have to test and see. Unfortunate though as my enum names were too clever,@deprecated
is not used for checking :(
57e4120
intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
FloEdelmann commentedAug 27, 2024 • 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.
The rule was renamed to |
Alas, changing the commit history & linked changelogs would be hard 😞 sorry about that. I edited the PR title just to help folks find it. |
Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
Reimplements logic from scratch - both for licensing reasons and because I wanted to see how the structure would differ from previous implementations. After doing it myself, then looking back at the others, I think it ended up closest to eslint-plugin-deprecation by coincidence.
💖