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.

False Alert on unused dependency

See original GitHub issue

Bug Description

I have a dependency which is alerted as unused. The reason for it is the folder Structure like this:

root
  |- someDir
      |- lib
          - fileUsingTheDependency

The dependencies used in the files in the ‘lib’ folder are ignored. After moving the file to a folder called ‘lub’ the dependency was not alerted any more.

Versions

node: v16.14.2 depcheck 1.4.3

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

1reaction
copecommented, Aug 5, 2022

I think this may work:

parsers:
  '**/*.js': ['es6']
  '**/*.jsx': ['jsx']
  '**/*.ts': ['typescript']
  '**/*.vue': ['vue']

you gotta be able to add them to a file?

See: https://github.com/depcheck/depcheck/blob/main/doc/pluggable-design.md#use-parser-from-a-configuration-file

0reactions
darlenyacommented, Aug 5, 2022

@darlenya no, I’m just guessing since I had a similar problem but on my side there is no lib folder…

ok, thanks. Was a little bit confused 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

False alerts on unused dependencies · Issue #673 - GitHub
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity...
Read more >
Suppress Maven Dependency Plugin's "Unused declared ...
In some cases this message is a false positive and the dependency is required transitively.
Read more >
depcheck - npm
False Alert. Depcheck just walks through all files and tries to find the dependencies according to some predefined rules. However, the ...
Read more >
depcheck | Yarn - Package Manager
Depcheck is a tool for analyzing the dependencies in a project to see: how each dependency is used, which dependencies are useless, and...
Read more >
Apache Maven Dependency Plugin – dependency:analyze
Ignore Runtime scope for unused dependency analysis. Default value is: false . User property is: ignoreUnusedRuntime . <ignoredDependencies> ...
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