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

Bug with subdirectories? #81

Closed
smazurov opened this issue Dec 2, 2015 · 3 comments
Closed

Bug with subdirectories? #81

smazurov opened this issue Dec 2, 2015 · 3 comments
Labels

Comments

@smazurov
Copy link

smazurov commented Dec 2, 2015

I'm running into an issue where files in subdirectories aren't correctly checked (at least for peerDependancies) for require statements

Quick test:

./package.json and npm install

{
  "name": "test-dep",
  "version": "1.0.0",
  "description": "test peerdeps",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "css-modules-require-hook": "^2.1.0",
    "postcss-modules-extract-imports": "^1.0.0",
    "postcss-modules-local-by-default": "^1.0.0",
    "postcss-modules-scope": "^1.0.0",
    "postcss-modules-values": "^1.1.1"
  }
}

./entry.js

require('css-modules-require-hook');

Running depcheck:

No unused dependencies

Working as intended

Breaks:

make a folder test/ and move entry.js there:

$ mkdir test && mv entry.js test

Running depcheck:

Unused devDependencies

  • postcss-modules-extract-imports
  • postcss-modules-local-by-default
  • postcss-modules-scope
  • postcss-modules-values

Debug info:

$ npm --version
3.3.12
$ node --version
v5.1.0

depcheck is latest installed with npm install -g depcheck


Is this desired behavior? Quick look at the folder scanning, it seems to be going into (sub)directories unless they're ignored.

@lijunle lijunle added the bug label Dec 2, 2015
@lijunle
Copy link
Member

lijunle commented Dec 2, 2015

Confirmed as a bug, It is caused by subdir is passed to checkDirectory by mistake (code), should be (root) dir.

lijunle added a commit to lijunle/depcheck-es6 that referenced this issue Dec 2, 2015
@lijunle
Copy link
Member

lijunle commented Dec 2, 2015

Release 0.5.11 to fix this.

@smazurov
Copy link
Author

smazurov commented Dec 2, 2015

Thanks a ton, this is an awesome tool (I use it with npm-check), thank you for maintaining it.

gtanner pushed a commit to gtanner/depcheck that referenced this issue Jan 19, 2016
Run npm publish only on latest version job.
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

2 participants