Repository navigation
Description
Which @angular/* package(s) are relevant/releated to the feature request?
No response
Description
Angular should give feedback on unused/unnecessary modules imported into the application modules.
It is very easy to forget to remove (or mistakenly add) unused modules into an Angular application. This might be a material component module that's never been used or an application module imported into your app.module without using anything from it. Angular should provide some sort of feedback to the developer, giving information about any unused modules in the application. The feedback might be in the form of a squiggly line or a warning in the devtools, visible during development.
I am aware that build optimizer optimizes the bundle and tree-shakes anything that is not being used, but there is still benefit in providing feedback.
- Developers would get a better understanding of using modules correctly, what needs to be in the module and what is not.
- It is better to not include stuff you don't need in the first place, than trusting the optimizer will optimize everything for you. (What if there is a scenario where the optimizer fails to tree-shake)
Proposed solution
Any feedback that informs developers is welcome. It could be a squiggly line under the unused modules or a warning in the devtools. It should not prevent the compilation.
Activity
Airblader commentedon Sep 11, 2021
Duplicate of #41028
angular-robot commentedon Sep 12, 2021
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
JoostK commentedon Sep 13, 2021
Duplicate of #41028 (I have changed the voting labels accordingly).
angular-automatic-lock-bot commentedon Oct 14, 2021
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.