dylang / npm-check

Check for outdated, incorrect, and unused dependencies.
https://www.npmjs.com/package/npm-check
MIT License
6.58k stars 236 forks source link

False positive on webpack loaders #304

Open kud opened 6 years ago

kud commented 6 years ago

I've got this kind of information:

postcss-loader                      😕  NOTUSED?  Still using postcss-loader?
                                                 Depcheck did not find code similar to require('postcss-loader') or import  from 'postcss-loader'.
                                                 Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                                 Use --skip-unused to skip this check.
                                                 To remove this package: npm uninstall --save-dev postcss-loader

However, it's used in my code like this:

        {
          test: /\.css$/,
          exclude: /\.module\.css$/,
          use: [
            {
              loader: "postcss-loader", // here
              options: {
                ident: "postcss",
                plugins: loader => [
                  require("autoprefixer"),
                  require("postcss-axis"),
                  require("postcss-custom-media")({
                    extensions: require("./mediaQueries"),
                  }),
                ],
              },
            },
          ],
        },
kud commented 5 years ago

Oh god. :D

image