-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
False Positives with gulp-load-plugins && gulp-jshint #18
Comments
Can confirm. I am using a yeoman project along with the common
syntax, and each of those gulp plugins are firing as unused deps. I may not be using all of them, but I am using more than enough to know that this is breaking. To reproduce, use the https://github.com/yeoman/generator-gulp-webapp, start a new project, and simply run depcheck on it. It should fire even though many (if not all) of the gulp-plugin packages are being used. |
Hey guys, thanks for the interest in depcheck :) Internally, depcheck handles this kind of things with its I started a new repo for a grunt plugin, as soon as it's released I will start working on a gulp plugin too, with these plugins you will be able to set the At one time I was thinking about an rc file, something like |
@rumpl I think rc files are good, but I also think building a command line tool that can be passed all the options is the most versatile and future proof solution. If you add a .depcheckrc file that would be nice solution for some I am sure. I am starting to dislike rc files, because the last project I inherited had about 10 rc files in the project root. |
Accept custom extensions.
Hi, all. I am taking care of this project. Could anybody tell me if he still has this problem with version 0.5.9? Is it worth to worth on this? |
I looked into this problem. The false alerts are caused by gulp-load-plugins loading dependencies with its own way. |
@lijunle I don't think dynamic loaders (e.g.; var pkg = 'f' + 'o' + 'o';
var foo = require(pkg); Maybe just me, but I don't expect this behavior to be supported in a tool like this. |
@staxmanade re var gulp = require('gulp');
var jshint = require('gulp-jshint');
var styllish = require('jshint-stylish'); // <==
gulp.task('default', function () {
gulp.src(['file.js'])
.pipe(jshint('.jshintrc'))
// .pipe(jshint.reporter('jshint-stylish'));
.pipe(jshint.reporter(stylish));
}); |
@eckdanny I understand that, it is very hard to detect all dynamic dependencies. However, our principle is to try to enable one more, and one more detector. For this particular issue (
From my estimate, the first feature will cover 80% user cases - although it will miss some unused dependencies. Besides the second feature, it will cover ~90% cases. The first one should be easy, the second is hard - I will make a try. We won't consider the third feature until someone comes back and request a third feature. |
Came here for this.
# nfantone at thelonious in ~/Development/js/2pv/floating-bar on git:bug/8106-yargs-missing ✖︎ [20:26:57]
→ depcheck
Unused devDependencies
* eslint
* gulp-autoprefixer
* gulp-changed
* gulp-clean-css
* gulp-concat
* gulp-debug
* gulp-declare
* gulp-eslint
* gulp-gzip
* gulp-handlebars
* gulp-htmlmin
* gulp-if
* gulp-iife
* gulp-imagemin
* gulp-inject
* gulp-install
* gulp-istanbul
* gulp-mocha
* gulp-plumber
* gulp-print
* gulp-replace-task
* gulp-rev
* gulp-rev-replace
* gulp-robots
* gulp-sequence
* gulp-sonar
* gulp-strip-debug
* gulp-tar
* gulp-uglify
* gulp-useref
* gulp-util
* gulp-webserver
* pre-commit
"pre-commit": [
"validate"
]
|
Version 0.6.2 will be released soon to recognize the lazy loaded gulp plugins via From my offline testing, a yoeman generated web-app has 99% support. The only exception is I am closing this issue. If you get new false alerts, please open a new issue. Thanks for reporting! Update: Version 0.6.2 is out. |
Nice! |
Hello,
Was looking around at how to determine un-used npm packages and found your project.
When I ran it the following report was generated. However, due to the way I'm loading gulp plugins (using
gulp-load-plugins
, my guess is this tool is not picking up anything that is dynamically loaded. Similarly, I'm asking it to use thejshint-stylish
reporter for my jshint, which I presume is another dynamically loaded thing...I can't say I have any bright ideas on how you can solve these problems, but in case you hadn't heard of them, they might be interesting ones to look into.
The text was updated successfully, but these errors were encountered: