dylang / npm-check

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

unsed depdendecy finding issue #419

Open nishwalshetty opened 2 years ago

nishwalshetty commented 2 years ago

npm-check searches for unsed depdendecies with this pattern "Depcheck did not find code similar to require('bricks.js') or import from 'bricks.js'" but we use like this "import bricks from 'bricks.js'; in code"

is this a bug or import .... from ... is not identificed by npm-check ? is there a fix for this becuase this looks like false postive.

Ajayff4 commented 2 years ago

I am also experiencing the exactly same outcome on my react app too. It isn't able to find the import statements but libraries are being used.

nishwalshetty commented 2 years ago

@dylang could you please clarify ?

vertti commented 2 years ago

I encountered the same when import has the form import * as redis from 'redis'. Npm-check claims redis is not used. And with import { useForm } from 'react-hook-form', npm-check claims react-hook-form not used.

ian-axelrod commented 2 years ago

Same.

JB712 commented 1 year ago

Same with '@react-native-community/datetimepicker', i got import DateTimePicker from '@react-native-community/datetimepicker'; in my code but it cannot find it and tell me "Depcheck did not find code similar to require('@react-native-community/datetimepicker') or import from '@react-native-community/datetimepicker'."