question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

False Alert on importing from self

See original GitHub issue

Bug 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.4
  • npm -v: 6.8.0
  • depcheck --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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
partynikkocommented, May 1, 2019

Anyone feel a need for this to be fixed?

0reactions
rumplcommented, Nov 3, 2019

Closing this one, we have another issue for webpack aliases

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found