False Alert on importing from self
See original GitHub issueBug Description
If doing import
on your own package from within the very same package (for example having your bundler resolve it through alias) depcheck will report the dependency as missing.
Code snippets
Where the dependency is used:
import { Button } from '@myOwn/components';
Where the dependency is listed in package.json:
Nowhere.
@myOwn/components
is the package itself.
{
"name": "@myOwn/components",
"version": "0.0.1",
"module": "dist/index.js",
...
}
Versions
node -v
: v8.11.4npm -v
: 6.8.0depcheck --version
: 0.7.2
Extra info
npx depcheck
reports:
Missing dependencies
* @myOwn/components
I guess this could be fixed by simply accounting for the name of the package that depcheck is running within.
I could create a PR for this if you think it’s a bug and it should be fixed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
False positive: unused import warning for multiple ... - YouTrack
PY-20075 "Unused import" warning for module.module imports when importing two modules from the same package. ... It seems like the first import written...
Read more >False "import-self" when importing a package from stdlib with ...
I have a package named logging, which is inside a namespace package (python 3.0 style) bar ├── logging │ ├─ __init__.py in __init__.py ......
Read more >Python class with a decorator is being flagged by pylint as ...
Pylint isn't wrong. You aren't using endpoint anywhere in main.py. The only reason you're importing endpoint is to execute the decorator.
Read more >warnings — Warning control — Python 3.11.1 documentation
Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that...
Read more >Python import: Advanced Techniques and Tips
The Python import system is as powerful as it is useful. In this in-depth tutorial, you'll learn how to harness this power to...
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
Anyone feel a need for this to be fixed?
Closing this one, we have another issue for webpack aliases