Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused url dependency #187

Closed
screendriver opened this issue Dec 1, 2016 · 4 comments
Closed

Unused url dependency #187

screendriver opened this issue Dec 1, 2016 · 4 comments

Comments

@screendriver
Copy link

index.js

import url from 'url';

export async function foo() {
  // ...
  const bar = url.resolve('...', '...');
  // ...
}

package.json

"dependencies": {
  "url": "0.11.0"
}

depcheck v0.6.6

Unused dependencies
* url

I am using Node.js v7.2.0

@lijunle
Copy link
Member

lijunle commented Dec 1, 2016

This is strange, what is the output of depcheck --json?

@dsernst
Copy link

dsernst commented Mar 25, 2017

I'm seeing this as well in a react-native project.

@dsernst
Copy link

dsernst commented Mar 25, 2017

Depcheck error if url is in package.json dependencies:

19:57 $ depcheck . --ignores=buildStyleInterpolator,eslint-* --ignore-dirs=ios
Unused dependencies
* url

React native fatal error after npm rm -S url:

@mnkhouri
Copy link
Member

Thank you for the report!

Quoting from my comment here:

I've done a bit of investigation, and discovered that this false positive happens because depcheck filters out any node.js built-in modules from the list of "used modules" (code to do so is here).

I'm going to close this issue as a duplicate of #251, since I've added some brainstorming about possible solutions there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants