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.

Unable to find unimported files

See original GitHub issue

First off, I apologize if this is not the preferred channel of communication for these “issues”.

I’ve got Unimported running through my codebases at this point, properly finding unused dependencies. However I am unable to get it to find my unused files. I’ve even created new files to see if they will be detected but no luck. All of our files are just .js extensions. Before adding the aliases to my config, I did have unresolved imports, since those issues are fixed I believed it would be able to find my files.

Here is what my current config looks like:

.unimportedrc.json

{
	"entry": ["apps/manager/src/index.js"],
	"extensions": [".js"],
	"ignorePatterns": ["**/node_modules/**"],
	"ignoreUnresolved": ["some-npm-dependency"],
	"ignoreUnimported": ["src/i18n/locales/en.ts", "src/i18n/locales/nl.ts"],
	"ignoreUnused": ["create-emotion", "unimported"],
	"aliases": {
		"~/*": ["apps/manager/src/*"],
		"Lib/*": ["lib/node/src/*"],
		"ROOT":  ["./../../*"]
	}
}

My Output

Screen Shot 2021-07-14 at 2 52 38 PM

If there’s a more appropriate area or contact for these general questions, please let me know.

Thanks in advance, Danny

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dabylandcommented, Jul 28, 2021

Works like a charm, thanks for all the help and amazing tool!

1reaction
smeijercommented, Jul 28, 2021

Figured it out. Thanks for the repo, that helped a lot!

So, the first thing in your repo that got me, was having a capital I in the filename of Index.js, while it’s named index.js in an entry file in the config.

Next, and that’s a bug in unimported, you only have a single extension specified in your config under the extensions property. I’m going to push a fix soon. In the mean while, you can check by just adding another extension there as well ([".js", ".ts"] for example).

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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