Modules with same name as a built-in (e.g. 'path') are incorrectly identified as unused dependency
See original GitHub issueIt appears as though path is incorrectly identified as an unused dependency.
dmurray@ss9:...andbox/depcheck-path 0> npm run depcheckjson
> depcheck-path@1.0.0 depcheckjson /home/dmurray/sandbox/depcheck-path
> depcheck --json|json
{
"dependencies": [
"path"
],
"devDependencies": [],
"missing": {},
"using": {
"depcheck": [
"/home/dmurray/sandbox/depcheck-path/package.json"
]
},
"invalidFiles": {},
"invalidDirs": {}
}
dmurray@ss9:...andbox/depcheck-path 0>
This is a trivial demo project, containing server.js which includes log.js, which uses path.
To reproduce:
- unpack depcheck-path.zip
- npm install
- npm run depcheckjson
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Importing from builtin library when module with same name ...
The solution is "pick a different name". Your approach of not renaming is a bad idea. Why can't you rename your module? What's...
Read more >Installation fails for @types/<dependency_name> packages
Attempt to initialise with the yarn command when there are @types/<dependency_name> dependencies in package.json , for example: { "name": "opus.
Read more >Go Modules Reference - The Go Programming Language
A module is identified by a module path, which is declared in a go.mod file, together with information about the module's dependencies. The...
Read more >How to fix "The following module is missing from the file ...
Then go to your admin>>modules, click the Uninstall Tab and uninstall all modules listed there. Some error may occur when uninstalling all at...
Read more >Imports - checkstyle
To configure the check so that star imports from packages java.io and java.net are allowed: <module name="AvoidStarImport"> <property ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rumpl In my case, I’m here because of this issue where the dependency (
lodash
) was classified as unused… Which wasn’t.Regarding using native modules (read dependencies that are already imported), I guess it would make sense to flag said dependencies as unneeded (note: the “unneeded” as opposed to the “unused”).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.