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

Some unused and some missing Javascript dependencies? #1242

Closed
fabcor-maxiv opened this issue Jun 4, 2024 · 3 comments · Fixed by #1267
Closed

Some unused and some missing Javascript dependencies? #1242

fabcor-maxiv opened this issue Jun 4, 2024 · 3 comments · Fixed by #1267

Comments

@fabcor-maxiv
Copy link
Contributor

fabcor-maxiv commented Jun 4, 2024

Seems like we might have a bunch of unused Javascript dependencies and some that are missing (!?), see below. Maybe we could investigate further and tidy up.

$ pnpx depcheck
Packages: +126
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 126, reused 76, downloaded 50, added 126, done
Unused dependencies
* @fortawesome/react-fontawesome
* dustjs-helpers
* dustjs-linkedin
* everpolate
* history
* jsmpeg
* liform-react
* plotly.js
* popper.js
* react-clipboard.js
* react-plotly.js
* react-router
* react-sticky
* shortid
* underscore
* ws
Unused devDependencies
* @testing-library/react
* @testing-library/user-event
* babel-preset-react-app
* concurrently
* less
* less-watch-compiler
* sass
* wait-on
* webpack
* webpack-dev-server
Missing dependencies
* @babel/eslint-parser: ./.eslintrc.js
* eslint-plugin-unicorn: ./.eslintrc.js
* eslint-plugin-promise: ./.eslintrc.js
* eslint-plugin-sonarjs: ./.eslintrc.js
* eslint-plugin-simple-import-sort: ./.eslintrc.js
* eslint-plugin-react-hooks: ./.eslintrc.js
* eslint-plugin-jest-dom: ./.eslintrc.js
* eslint-plugin-testing-library: ./.eslintrc.js
* eslint-plugin-jest-formatting: ./.eslintrc.js
@fabcor-maxiv
Copy link
Contributor Author

What do you think @axelboc?

@fabcor-maxiv fabcor-maxiv changed the title Unused Javascript dependencies? Some unused and some missing Javascript dependencies? Jun 4, 2024
@axelboc
Copy link
Contributor

axelboc commented Jun 4, 2024

It'd be good to do a bit of a clean-up, you're right.

I'd be very careful about this, though. I'm not sure how depcheck works, but identifying unused dependencies can be tricky. For instance, some of the dependencies reported are peer dependencies, like plotly.js (peer dep of react-plotly.js).

As a safety check, after removing a dependency, one can run pnpm install --resolution-only to make sure there aren't any peer dependency issues.

I'll see if I have time to take a look.

@fabcor-maxiv
Copy link
Contributor Author

I'd be very careful about this, though. I'm not sure how depcheck works, but identifying unused dependencies can be tricky. For instance, some of the dependencies reported are peer dependencies, like plotly.js (peer dep of react-plotly.js).

Yes, I picked the depcheck tool at random, and I for sure do not know enough about this topic to judge its output. Definitely needs closer investigation. Not a high priority, obviously. There might be some low-hanging fruit in terms of cleaning. And maybe the "missing dependencies" part is an actual issue (I do not know).

@fabcor-maxiv fabcor-maxiv linked a pull request Jun 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants