-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Installed peer dependencies are marked as unused #181
Comments
Hi, @remcohaszing Thanks for reporting issues for depcheck. Which version of node and npm are you using? |
|
I am also seeing the same issue.
Note: I am using Webpack (v1.13.2) as my module bundler. |
@remcohaszing It is strange, the peer dependencies should be supported. Which version of depcheck are you running? @Matt-Webb If it is related to webpack, what is your file name of webpack config? Currently, it is hard code as |
I'm using Note that webpack.config.js: const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const pkg = require('./package.json');
module.exports = {
entry: path.resolve(__dirname, './app/main.jsx'),
output: {
path: path.resolve(__dirname, 'build/'),
filename: 'gallery.js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
contentBase: path.resolve(__dirname, 'app')
},
devtool: 'inline-source-map',
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.css$/,
loaders: ['style', 'css']
},
{
test: /\.(eot|gif|jpe?g|png|svg|ttf|woff2?)(\?.*)?$/,
loaders: ['file']
}
]
},
externals: {
// Workaround for https://github.com/airbnb/enzyme/issues/47
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
},
plugins: [
new HtmlWebpackPlugin({
title: pkg.name
})
]
}; |
Thank you @remcohaszing , I identify it as a bug. Bascially, it is caused by the webpack detector returns an array as dependencies, For the such case, depcheck directly returns the array as dependencies without drill out its peer dependencies and optional dependencies. |
Update: I published version 0.6.6 to resolve this issue. Please test it. Again, thank you for reporting this. 👍 |
It works! Thanks 😄 |
This still appears to be happening. My project has a peer dependency on
However,
|
For example,
babel-core
is a peer dependency ofbabel-loader
. It should not be marked as unused. The same goes forjasmine-core
andkarma-jasmine
.There are probably many more similar cases.
The text was updated successfully, but these errors were encountered: