question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Detect orphaned imports specified in the central import file

See original GitHub issue

Hi @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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cartantcommented, Jul 18, 2017

This should be implemented in 2.0.0. See the notes on the allowUnused option (which defaults to false) in the README.

1reaction
cartantcommented, Jul 17, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

smeijer/unimported: Find and fix dangling files and ... - GitHub
Find and fix dangling files and unused dependencies in your JavaScript projects. ... that are declared in your package.json, were not imported by...
Read more >
Creating and Running Imports - Oracle
Purpose. This tutorial covers how to create and run imports in Data Relationship Management (DRM) Web Client. Time to Complete. Approximately 30 min....
Read more >
PyLint "Unable to import" error - how to set PYTHONPATH?
There are two options I'm aware of. One, change the PYTHONPATH environment variable to include the directory above your module.
Read more >
Importing existing resources into a stack - AWS CloudFormation
Import an existing resource into a stack using the AWS Management Console · Choose Amazon S3 URL, and then specify the URL for...
Read more >
Imports - checkstyle
Rationale: Importing all classes from a package or static members ... to only check the "src/main" directory using an import control file ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found