False positivies on app-module-path
See original GitHub issueWhile using app-module-path, every require
d module affected by that is reported as a “missing dependency”.
Missing dependencies
* logger
* config
* services
* lodash
Here, logger
and config
are actually located under an ./app
directory, but the relative path can be omitted thanks to:
require('app-module-path').addPath(__dirname + '/app');
being present at the beginning of the main script. Moreover, services
is not even a module. The actual requirements comes from:
const seneca = require('services/seneca');
Can’t say why depcheck reports it that way.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
False positives reported when using yarn instead of npm to ...
I can reproduce the issue when using yarn instead of npm to install the modules. It doesn't make sense to use npm ls...
Read more >How To Test a Node.js Module with Mocha and Assert
A false-positive is a test case that passes when it should fail. We currently check that the length of the array is not...
Read more >Resolving require paths with webpack - Stack Overflow
As you see, all my app code lives within a mandatory path namespace. This makes quite clear which require call takes a library,...
Read more >app-module-path - npm.io
app -module-path. This simple module enables you to add additional directories to the Node.js module search path (for top-level app modules only).
Read more >npm and distribution path length problems - Adam Lynch
There could easily be false positives. It's one thing having issues locally or within a team, it's a whole other thing to have...
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 FreeTop 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
Top GitHub Comments
I agree with @lijunle on this one. The extra dots are simple and intuitive.
app-module-path
not only alter default behaviors and thus breaking any tool chain that rely on default behavior, but it also open up the possibility of abuse and violates the principle of least surprise.I’d actually vote for not supporting it. If possible, make the support for non-standard things available via plugins. People can opt-in if they choose to do so.
FYI, it’s reporting false positives for modules in
NODE_PATH
, too.