lijunle / depcheck-es6 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from depcheck/depcheck
Check your npm module for unused dependencies
This project forked from depcheck/depcheck
Check your npm module for unused dependencies
Hi,
Does both the below issues are satisfied in our package
dylang/npm-check#50
dylang/npm-check#44
npm run depcheck
cannot be run on WindowsThe document has moved to here.
While, if anybody has feedback on the design, please comment on this thread..
Something happening during the latest publish to npm
:
❯ nvm use 4
Now using node v4.2.1 (npm v3.3.6)
❯ npm cache clean
❯ npm i depcheck-es6
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/dgreene/.nvm/versions/node/v4.2.1/bin/node" "/Users/dgreene/.nvm/versions/node/v4.2.1/bin/npm" "i" "depcheck-es6"
npm ERR! node v4.2.1
npm ERR! npm v3.3.6
npm ERR! shasum check failed for /var/folders/hl/c611mdq92fd6q6_rf_mj33cr0000gp/T/npm-34889-dad6951d/registry.npmjs.org/depcheck-es6/-/depcheck-es6-0.5.4.tgz
npm ERR! Expected: 7cfa907d49a6db295acfd0da89b326d9e8a5a071
npm ERR! Actual: a4e35e665e4d13d749edddeb1419dd4621175c4a
npm ERR! From: https://registry.npmjs.org/depcheck-es6/-/depcheck-es6-0.5.4.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /private/var/folders/hl/c611mdq92fd6q6_rf_mj33cr0000gp/T/node_modules/package-json/npm-debug.log
I've repeated this in various versions of node, and my users are reporting this as well.
It would be good if we got a feel for our test coverage, and assure test coverage moving forward. I've seen other projects using coveralls.io for this purpose, and thought it might be neat to try out.
Hi
can you tell me whether it will support unused peer dependencies.
Thanks
Update the README before release 0.6.0
I saw you were working on this on the jsx-support branch, any plans to push this ahead?
The test/index.js file is in boiler-plate code. Refactor the test code to abstract the common part.
Hi,
i am facing issue with syntax like "new require('express')();"
showing 'express' unused dependency.
seems to be problem with 'new' keyword.
do we have any solution to incorporate this syntax also.
you can find code here.
https://github.com/rackt/redux/blob/master/examples/todomvc/server.js
Thanks
Leverage ESLint instead of JSLint.
I prefer to use Airbnb JavaScript guideline.
Hi,
I tried calling api from my code, I am getting the following error, can you tell me why its happening.
-MacBook-Pro:todomvc $ npm install
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No repository field.
[email protected] install /Users/Desktop/FrontEnd/redux-master/examples/todomvc
node test-depcheck.js
testing
module.js:338
throw err;
^
Error: Cannot find module '/path/to/your/project/package.json'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at depcheck (/Users/Desktop/FrontEnd/redux-master/examples/todomvc/node_modules/depcheck-es6/dist/index.js:251:40)
at Object. (/Users/Desktop/FrontEnd/redux-master/examples/todomvc/test-depcheck.js:31:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node test-depcheck.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node test-depcheck.js'.
npm ERR! This is most likely a problem with the redux-todomvc-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node test-depcheck.js
npm ERR! You can get their info via:
npm ERR! npm owner ls redux-todomvc-example
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Desktop/FrontEnd/redux-master/examples/todomvc/npm-debug.log
https://github.com/lijunle/depcheck-es6#api
Thanks,
Both dependencies and devDependencies badges:
We should avoid use the xxxSync file, use promise + async function instead.
Thanks for doing this, I think it was necessary! Thought I'd make this issue just so I got the notification for when it got published on npm :)
Hi,
What I am trying to do is when I do npm install itslef I need to check unused dependencies, is there any way to include depcheck-es6 package during npm install itself, so that I dont need to install it seprately and it will show me the result unused depencies.
Thanks,
In .babelrc
:
{
"stage": 2,
"env": {
"development": {
"plugins": [
"react-transform"
],
"extra": {
"react-transform": {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}]
}
}
}
}
}
Expected packages:
Work items:
.babelrc
file.package.json
(example).Note: It need more affect to support Babel plugins in CLI and API calls. They are not recommended by Babel. Please open an issue and let me know the reason if anybody think they are necessary.
Hi,
We have tested the depcheck-es6 package with a sample todo react app, but its not recognizing the *react-redux and *classnames package. We are using the npm version : 2.11.3 and node version: v0.12.7.
You can see in the code where they have used react-redux and classnames packages
https://github.com/rackt/redux/blob/master/examples/todomvc/containers/App.js
import { connect } from 'react-redux';
https://github.com/rackt/redux/blob/master/examples/todomvc/components/TodoTextInput.js
import classnames from 'classnames';
Providing the output below.
D:\todomvc>.\node_modules.bin\depcheck
Unused Dependencies
Unused devDependencies
Thanks
Hi @lijunle,
Thanks a lot for great plug-in, it helping us a lot to identify unused dependencies.
As per my understanding, depcheck-es6 will looks in to current package.json and identifies whether dependencies are used in the code or not and list down the results.
is there any possibility to check recursively into custom node_modules and list down the same by special configurations.
While i run the "depcheck" against the App/package.json, based on configurations it should do recursive check and provide results in one shot.
Hope my problem is clear to you.. :)
Please guide me if there is possibility, have tried some possibilities, but not succeeded.
Thanks again..
Adding a parser for coffeescript files would be awesome.
I'm not familiar with the code, we just need to find a parser?
Babel is a good choice. 🎅
Is it possble to identify the package name in package.json file when that module is not present. I mean can we do a vice versa function in depcheck-es6
It seems like requireCallExpression.js doesn't match module names in this format:
var app = new require('express')();
Currently no errors are reported if node-source-walk
encounters an error while parsing a file, which makes it tough to differentiate between a file that simply didn't include dependencies and a file with a syntax error.
I'm not sure what the best way to report errors would be... Should it be with a debug option that triggers a console.debug
or perhaps returns some kind of ParsingError
object that the calling method can use... or simply re-raise the error?
Currently, depCheck looks for all files under directory to get dependency result.
Some strategies can be used to optimize the performance:
Concretely, it need to convert the promise
queue in checkDirectory
to Array<Func<Promise>>
queue. The promises are triggered only then function is invoked.
Webpack loaders are a special way to "load" code into webpack.
There are two syntax to use webpack loader:
require
functionIn index.js, if the parser throws an error, we give up.
This means es6
files with the .js
extension will never parse.
Instead, it should fall back to another parser.
This probably should only happen with .js
files and if the original parser isn't already es6
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.