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

Dependency parsing should have at most one "/" #864

Open
sitch opened this issue Dec 11, 2023 · 0 comments
Open

Dependency parsing should have at most one "/" #864

sitch opened this issue Dec 11, 2023 · 0 comments
Labels

Comments

@sitch
Copy link

sitch commented Dec 11, 2023

Bug Description

Currently something like this:

// package.json
{
  prettier: "@myrepo/prettier/profiles/recommended"
}

Will fail using:

$ npx depcheck --specials=prettier

This is because the actual string "@myrepo/prettier/profiles/recommended" is treated as a package instead of stripping the trailing path into "@myrepo/prettier".

This seems to be consistent across all specials I've used and not just limited to using the prettier special.

The fix for this is just to add a helper function to strip the trailing path portion of a possible dependency string.

@sitch sitch added the bug label Dec 11, 2023
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

1 participant