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 dependency "querystring" : false positive #170

Closed
mpacary opened this issue Oct 5, 2016 · 6 comments
Closed

unused dependency "querystring" : false positive #170

mpacary opened this issue Oct 5, 2016 · 6 comments
Labels

Comments

@mpacary
Copy link

mpacary commented Oct 5, 2016

In a new directory, using :

package.json

{
  "name": "tests-deps",
  "main": "index.js",
  "description": "qsdf",
  "version": "1.0.0",
  "licence": {
    "license": "qsdf"
  },
  "private": true,
  "dependencies": {
    "handlebars": "^4.0.5",
    "querystring": "^0.2.0",
    "request": "^2.75.0",
    "xml2js": "^0.4.17"
  }
}

index.js

var hb = require('handlebars');
var qs = require('querystring');
var r = require('request');

Running depcheck, I get

Unused dependencies
* querystring  <--- false positive ?
* xml2js       <--- Ok, expected

node -v => v4.6.0
npm -v => 3.10.8
depcheck --version => 0.6.4

Ran this using babun/cygwin on a Windows 10 machine.

@lijunle
Copy link
Member

lijunle commented Dec 6, 2016

@Frosty-Z Did you resolve the problem? What is the output of depcheck --json?

@mpacary
Copy link
Author

mpacary commented Dec 8, 2016

Still same issue with depcheck 0.6.7.

depcheck --json output is :

{
   "dependencies":[
      "querystring",
      "xml2js"
   ],
   "devDependencies":[

   ],
   "missing":{

   },
   "using":{
      "handlebars":[
         "C:\\Users\\Maxime\\...\\tests-deps\\index.js"
      ],
      "request":[
         "C:\\Users\\Maxime\\...\\tests-deps\\index.js"
      ]
   },
   "invalidFiles":{

   },
   "invalidDirs":{

   }
}

@rumpl rumpl added the bug label Jan 26, 2019
@rumpl
Copy link
Member

rumpl commented Jan 26, 2019

Hey,

This is actually not a bug, depcheck excludes NodeJs core modules and querystring is one of them.

@rumpl rumpl closed this as completed Jan 26, 2019
@mpacary
Copy link
Author

mpacary commented Jan 27, 2019

So shouldn't the output be like this?

Unused dependencies
  * xml2js

Ignored dependencies (Node.js core modules)
  * querystring

@rumpl
Copy link
Member

rumpl commented Jan 27, 2019

I created a feature request for this one #308

@mpacary Would you like to work on this one?

@mpacary
Copy link
Author

mpacary commented Jan 27, 2019

Would be a good experience for me, but I have not enough time currently :-/
Maybe in a few weeks, I could create a PR.

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

No branches or pull requests

3 participants