Skip to content

Admin - NoMongo: GitHub Action to Detect Unused Dependencies #3932

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

Open
palisadoes opened this issue Apr 13, 2025 · 8 comments
Open

Admin - NoMongo: GitHub Action to Detect Unused Dependencies #3932

palisadoes opened this issue Apr 13, 2025 · 8 comments
Labels
dependencies Pull requests that update a dependency file feature request good first issue Good for newcomers MVP Needed for our 2025 MVP no-issue-activity No issue activity security Security fix unapproved

Comments

@palisadoes
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  • The code base may have unused dependencies. These need to be detected for removal.

Describe the solution you'd like

  1. Use this method to identify them in the root directory package.json
    1. https://stackoverflow.com/questions/22675725/how-to-find-unused-packages-in-package-json
  2. Remove the unused dependencies.
  3. Add any missing dependencies.
  4. Create a GitHub action that tests for unused dependencies and fails if they are found
  5. Add the check to the husky pre-commit
  6. All tests must be valid and pass

Describe alternatives you've considered

  • N/A

Approach to be followed (optional)

  • N/A

Additional context

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@github-actions github-actions bot added dependencies Pull requests that update a dependency file unapproved good first issue Good for newcomers security Security fix labels Apr 13, 2025
@bandhan-majumder
Copy link
Contributor

can i work on this?

@dhanagopu
Copy link

@bandhan-majumder Our policy is to assign no more than two issues to each contributor across all repositories. This way everyone gets a chance to participate in the projects. We sometimes give exceptions for more urgent cases and sometimes we lose track, but the policy stands. You have reached your limit, please wait until your existing issues are closed before requesting more issues. You could unassign yourself from one of the other issues too.

@shivasankaran18
Copy link
Contributor

can I work on this issue @palisadoes @dhanagopu @Cioppolo14

@shivasankaran18
Copy link
Contributor

shivasankaran18 commented Apr 16, 2025

Image

Hello @palisadoes @varshith257
I have run depcheck and I’ve noticed a few false positives regarding "missing dependencies". These seem to be caused by the way path aliases are handled in the project.

Eg : an import like import Users from 'screens/Users' (defined via tsconfig.json paths) is flagged as a missing dependency (screens), even though it points to a local file

Solutions

  1. using ./ Relative paths causes the false positives to go away
  2. using the --ignore-paths flag to ignore common alias prefixes like screens, components,
    3 . using of Path Aliases via tsconfig.json
    { "compilerOptions": { "baseUrl": "src", "paths": { "screens/*": ["screens/*"], "components/*": ["components/*"] } } }

which one can I opt for ?

@varshith257
Copy link
Member

varshith257 commented Apr 16, 2025

IMO, the best option is to keep using path aliases in tsconfig.json and we can configure dep check with the --ignore-paths flag to ignore those alias prefixes as this balances both scenarios

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@palisadoes
Copy link
Contributor Author

Unassigned. Inactivity

@github-actions github-actions bot removed the no-issue-activity No issue activity label May 19, 2025
@palisadoes palisadoes added the MVP Needed for our 2025 MVP label May 19, 2025
Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file feature request good first issue Good for newcomers MVP Needed for our 2025 MVP no-issue-activity No issue activity security Security fix unapproved
Projects
Status: Backlog
Status: Backlog
Development

No branches or pull requests

5 participants