Skip to content

fix(eslint-plugin): [no-deprecated] report on imported deprecated variables #9987

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

Merged
merged 6 commits into from
Sep 23, 2024

Conversation

auvred
Copy link
Member

@auvred auvred commented Sep 14, 2024

PR Checklist

Overview

JSDoc tags are attached to the original symbols, not to symbol aliases. But symbols of imported variables are aliases, so we need to resolve those aliases, that's it!

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @auvred!

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.

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 3a63482
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66e5dd186027f10008f892bc
😎 Deploy Preview https://deploy-preview-9987--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Sep 14, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3a63482. 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 targets

Sent with 💌 from NxCloud.

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.68%. Comparing base (77e65df) to head (3a63482).
Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9987   +/-   ##
=======================================
  Coverage   88.67%   88.68%           
=======================================
  Files         425      425           
  Lines       14797    14810   +13     
  Branches     4302     4307    +5     
=======================================
+ Hits        13121    13134   +13     
  Misses       1533     1533           
  Partials      143      143           
Flag Coverage Δ
unittest 88.68% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/eslint-plugin/src/rules/no-deprecated.ts 97.59% <100.00%> (+0.44%) ⬆️

kirkwaiblinger
kirkwaiblinger previously approved these changes Sep 14, 2024
@kirkwaiblinger kirkwaiblinger added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 14, 2024
@auvred
Copy link
Member Author

auvred commented Sep 14, 2024

@kirkwaiblinger Sorry, I should turn this PR into draft, but I forgot to do it. One false negative failure in utils:lint showed me a case that required me to redo all the logic with aliases almost from scratch :(

@github-actions github-actions bot removed the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 14, 2024
// When we import foo, its symbol is an alias of the exported foo (the one
// with the deprecated tag), which is itself an alias of the original foo.
// Therefore, we carefully go through the chain of aliases and check each
// immediate alias for deprecated tags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Praise] This was very useful, thanks 😄

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a 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! Super thorough tests, nicely done. 👏

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 16, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit b75d42b into typescript-eslint:main Sep 23, 2024
64 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [no-deprecated] Classes created via dependency injection are not reported
3 participants