Detect orphaned imports specified in the central import file
See original GitHub issueHi @cartant,
thanks for your great plug-in. I really like the ability to specify a central import file using the rxjs-add
rule options. I tried using this rule in combination with the rxjs-no-unused-add
rule. Unfortunately, it now reports all imports of the central import file as unused, which I can totally understand, as the imports aren’t actually used in the central import file itself. However, it would be great if there is a rule (or an extension to rxjs-no-unused-add
) that could detect imports which are specified in the central import file, but unused throughout the rest of the project. This would make it possible to detect imports in the central file that became orphaned in the meantime.
Would this be possible? Thanks in advance and keep up the good work.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
This should be implemented in 2.0.0. See the notes on the
allowUnused
option (which defaults tofalse
) in the README.Unfortunately, I don’t think this will be possible, as my understanding is that TSLint applies the rules on a per-file basis. I’m not sure that leaves anywhere to reliably accumulate the used imports across files. I’ll have another look at it, but prepare yourself to be disappointed.