Skip to content

chore: migrate eslint-plugin-import to eslint-plugin-import-x #11217

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

Closed
wants to merge 3 commits into from

Conversation

JounQin
Copy link
Contributor

@JounQin JounQin commented May 14, 2025

PR Checklist

Overview

Old measurements (see later for updated ones) Before:
 typescript-eslint on  main ❯ TIMING=1 y eslint .
Rule                                               | Time (ms) | Relative
:--------------------------------------------------|----------:|--------:
@typescript-eslint/no-unsafe-assignment            |  5458.780 |    22.9%
@typescript-eslint/internal/plugin-test-formatting |  3047.222 |    12.8%
@typescript-eslint/no-floating-promises            |  2288.399 |     9.6%
@typescript-eslint/no-misused-promises             |  2215.349 |     9.3%
@typescript-eslint/no-unsafe-return                |  1609.052 |     6.8%
@typescript-eslint/no-deprecated                   |  1049.075 |     4.4%
@typescript-eslint/no-unsafe-argument              |   954.879 |     4.0%
@typescript-eslint/no-unsafe-member-access         |   528.152 |     2.2%
import/no-duplicates                               |   501.363 |     2.1%
perfectionist/sort-objects                         |   373.923 |     1.6%
via .NET via  v24.0.1 took 1m13s
 typescript-eslint on  chore/import-x [+] ❯ TIMING=1 y eslint .
Rule                                               | Time (ms) | Relative
:--------------------------------------------------|----------:|--------:
@typescript-eslint/no-unsafe-assignment            |  3212.736 |    15.9%
@typescript-eslint/internal/plugin-test-formatting |  3052.515 |    15.1%
@typescript-eslint/no-floating-promises            |  2319.146 |    11.5%
@typescript-eslint/no-misused-promises             |  2253.580 |    11.2%
@typescript-eslint/no-unsafe-return                |  1785.357 |     8.9%
@typescript-eslint/no-unsafe-argument              |   932.104 |     4.6%
@typescript-eslint/no-deprecated                   |   906.925 |     4.5%
@typescript-eslint/no-unsafe-member-access         |   528.508 |     2.6%
@typescript-eslint/no-unnecessary-condition        |   321.524 |     1.6%
perfectionist/sort-objects                         |   298.678 |     1.5%
via .NET via  v24.0.1 took 1m8s

For a single ESLint plugin migration, I believe from 1m13s to 1m8s is already good enough, and it founds a false positive that @docusaurus/plugin-content-blog should be listed in dependencies for website, because eslint-plugin-import-x is a TypeScript rewrite started at un-ts/eslint-plugin-import-x#42 and we fixed several hidden bugs thanks to TypeScript!

(I don't know why nx complains about react-helmet-async version incompatible with @docusaurus/core's, see also https://app.unpkg.com/@docusaurus/core@3.7.0/files/package.json#L63, so I'm locking it same way to make nx happy.)

cc @JoshuaKGoldberg

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JounQin!

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 May 14, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 9370841
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/685be5a50e77520008048843
😎 Deploy Preview https://deploy-preview-11217--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: 92 (🔴 down 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (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 project configuration.

Copy link

nx-cloud bot commented May 14, 2025

View your CI Pipeline Execution ↗ for commit 9370841.

Command Status Duration Result
nx test eslint-plugin --coverage=false ✅ Succeeded 5m 5s View ↗
nx run-many -t typecheck ✅ Succeeded 1m 58s View ↗
nx run types:build ✅ Succeeded <1s View ↗
nx run-many -t lint ✅ Succeeded 10s View ↗
nx run integration-tests:test ✅ Succeeded <1s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded <1s View ↗
nx test typescript-estree --coverage=false ✅ Succeeded <1s View ↗
nx run generate-configs ✅ Succeeded 5s View ↗
Additional runs (27) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-06-25 12:21:11 UTC

@JoshuaKGoldberg
Copy link
Member

@JounQin those statistics look surprising to me. All lint rules are slower in the second one. Why would that be the case?

I'm out traveling and can't do much testing at the moment, otherwise I'd post some hyperfine statistics.

@JounQin
Copy link
Contributor Author

JounQin commented May 30, 2025

I don't know, eslint-plugin-import-x is powered by @typescript-eslint/utils under the hood, eslint-plugin-import is wrote without top level tools.


Update: eslint-plugin-import-x now doesn't have @typescript-eslint/utils as dependency anymore.

Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.84%. Comparing base (3e54520) to head (9370841).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11217   +/-   ##
=======================================
  Coverage   90.84%   90.84%           
=======================================
  Files         501      501           
  Lines       50919    50919           
  Branches     8387     8387           
=======================================
  Hits        46256    46256           
  Misses       4648     4648           
  Partials       15       15           
Flag Coverage Δ
unittest 90.84% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JounQin JounQin force-pushed the chore/import-x branch 4 times, most recently from fc1ebc7 to 36cf5b1 Compare June 2, 2025 14:05
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.

The perf boost is nice, but there are a lot of lockfile & package dep changes that are not needed for this. Could you please revert any that aren't actually necessary / newly caught issues (e.g. the Docusaurus 3.7 bump)?

I think we need a relatively clean PR showing that the lockfile doesn't get significantly larger from this change. #11212 (comment) raises a good point that we already have a lot of deps from multiple plugins in this package. The size of node_modules is a performance factor for us too (#11204). I think we'd want to know how "bad" the duplication is before making the switch-or-not call.

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Jun 9, 2025
@JounQin JounQin requested a review from JoshuaKGoldberg June 13, 2025 13:17
@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Jun 13, 2025
@JoshuaKGoldberg
Copy link
Member

Thanks for getting this to a reviewable state. Seeing the lockfile and having a clean slate to run performance measurements locally on was helpful. Conclusions commented here: #11212 (comment)

tl;dr: this won't be a net positive unless & until the other *-x plugins are ready to be swapped over too.

I'll go ahead and close this out to keep the queue small. Looking forward to being able to reevaluate later this year though! 💙

@JounQin JounQin deleted the chore/import-x branch June 27, 2025 01:15
@@ -53,6 +53,9 @@
"@typescript-eslint/types": "^8.35.0",
"debug": "^4.3.4"
},
"devDependencies": {
"vitest": "^3.1.3"
Copy link
Contributor Author

@JounQin JounQin Jun 27, 2025

Choose a reason for hiding this comment

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

@JoshuaKGoldberg By the way, this is found by import-x.

And also #11265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repo: migrate eslint-plugin-import to eslint-plugin-import-x
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy