angular icon indicating copy to clipboard operation
angular copied to clipboard

Help users clean up unused directives: const [ ... ]

Open matanlurey opened this issue 7 years ago • 1 comments

(Internal bug is b/31268465.)

An internal customer writes:

Currently, there isn't anything reminding or preventing users from leaving unused directives in the list of directives needed by the component aside from being reminded by a reviewer. It could be great if this could be done by the analyzer just like it is done for unused imports or lint warnings?

@MichaelRFairhurst wrote:

This is on my list! However, is behind some other more important things (ie outstanding bugs)

One question is should we try doing this in the compiler? We also support the following:

directives: const [
  materialDirectives,
],

... it would be really hard to lint something like this.

matanlurey avatar Jun 01 '18 21:06 matanlurey

I think this is a perfect item for the analyzer plugin, but I'm not sure it makes sense for the compiler.

Just like we shouldn't block development flow for unused imports, we shouldn't block compiles for unused directives. But having the link is perfect.

alorenzen avatar Jun 01 '18 21:06 alorenzen