Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitignore #870

Open
stephen-willoughby opened this issue Dec 19, 2023 · 2 comments
Open

gitignore #870

stephen-willoughby opened this issue Dec 19, 2023 · 2 comments
Labels

Comments

@stephen-willoughby
Copy link

Bug Description

A description of the bug
We have some gitignore files which add a * to ignore everything and then add back in explicitly what they need with e.g. ! README.md. depcheck doesn't seem to honour these nots and so complains of unused dependencies despite being used

e.g.

# Start by disallowing everything
*
# Now allowlist what we actually want
!thing/
!stuff/
!config/

Code snippets

Where the dependency is used:

code snippet here

Where the dependency is listed in package.json:

package.json snippet here
please include the section name (e.g. devDependencies, dependencies)

Versions

  • node -v: v18.17.1
  • npm -v: 9.6.7
  • depcheck --version: 1.4.7

Extra info

Any extra info you want to include. Thank you for the bug report!

BONUS POINTS: If you wish to help us debug further, the depcheck --json option will show more information. Check here in the README for documentation on json output.

@stephen-willoughby
Copy link
Author

have found can work around with the creation of an empty .depcheckignore

@znarf
Copy link
Collaborator

znarf commented Dec 23, 2023

depcheck use the npm package ignore which implements the .gitignore spec fully.

I guess there is something else going on, please give a full reproduction so someone can have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants