Skip to content
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

feat(linter/import) implement no_unused_modules rule #2720

Merged

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Mar 14, 2024

No description provided.

Copy link
Member Author

Dunqing commented Mar 14, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Dunqing and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the A-linter Area - Linter label Mar 14, 2024
@Dunqing Dunqing force-pushed the 03-14-feat_linter/import_implement_no_unused_modules_rule branch from 2745210 to 50125a7 Compare March 14, 2024 12:39
Copy link

codspeed-hq bot commented Mar 14, 2024

CodSpeed Performance Report

Merging #2720 will improve performances by 3.68%

Comparing 03-14-feat_linter/import_implement_no_unused_modules_rule (e89af90) with main (53a8e7f)

Summary

⚡ 1 improvements
✅ 28 untouched benchmarks

Benchmarks breakdown

Benchmark main 03-14-feat_linter/import_implement_no_unused_modules_rule Change
codegen_sourcemap[react.development.js] 16 ms 15.4 ms +3.68%

@Dunqing Dunqing force-pushed the 03-14-feat_linter/import_implement_no_unused_modules_rule branch from 50125a7 to a123ac6 Compare March 14, 2024 14:30
@Dunqing
Copy link
Member Author

Dunqing commented Mar 14, 2024

Supporting unused_exports looks cumbersome, we need to check all files in the src option and check them individually for imports.

@Boshen
Copy link
Member

Boshen commented Mar 14, 2024

Supporting unused_exports looks cumbersome, we need to check all files in the src option and check them individually for imports.

I'm fine with that.

@Dunqing
Copy link
Member Author

Dunqing commented Mar 14, 2024

I'm fine with that.

Can we retrieve and save all the src files in the linter service in advance so that we don't have to repeat the query every time we run run_once?

@Boshen
Copy link
Member

Boshen commented Mar 14, 2024

I'm fine with that.

Can we retrieve and save all the src files in the linter service in advance so that we don't have to repeat the query every time we run run_once?

Can you give an example? I haven't looked at what this rule does yet.

@Dunqing Dunqing force-pushed the 03-14-feat_linter/import_implement_no_unused_modules_rule branch from a123ac6 to e89af90 Compare March 14, 2024 14:48
@Dunqing
Copy link
Member Author

Dunqing commented Mar 14, 2024

I'm fine with that.

Can we retrieve and save all the src files in the linter service in advance so that we don't have to repeat the query every time we run run_once?

Can you give an example? I haven't looked at what this rule does yet.

You can see https://github.com/import-js/eslint-plugin-import/blob/c77c1a6ace311f99ed25878768c2dbee49c0512a/docs/rules/no-unused-modules.md#example-for-unused-exports

@Dunqing Dunqing requested a review from Boshen March 14, 2024 15:03
@Dunqing
Copy link
Member Author

Dunqing commented Mar 14, 2024

Support for the unused_exports option is not considered for the time being

@Boshen Boshen merged commit 64db564 into main Mar 18, 2024
23 checks passed
@Boshen Boshen deleted the 03-14-feat_linter/import_implement_no_unused_modules_rule branch March 18, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants