glTF-Project-Explorer icon indicating copy to clipboard operation
glTF-Project-Explorer copied to clipboard

Missing and unused dependencies

Open javagl opened this issue 4 years ago • 2 comments

When running depcheck in the main directory (after a yarn global add depcheck), there are some unused and missing dependencies reported:

Unused dependencies
* @types/jest
* @types/node
Missing dependencies
* eslint-config-react-app: .\package.json
* babel-eslint: .\package.json
* eslint-plugin-import: .\package.json
* eslint-plugin-flowtype: .\package.json
* eslint-plugin-jsx-a11y: .\package.json
* eslint-plugin-react: .\package.json
* eslint-plugin-react-hooks: .\package.json
* @redux-saga/core: .\src\index.tsx

(Where one of the "unused" dependencies caused some issues in another context).

Can somebody who is more familiar with dependency management confirm that

  1. the unused dependencies can safely be removed
  2. it makes sense to add the missing dependencies

?

(The missing ones don't seem to be strictly necessary, that's why I'm not sure...)

javagl avatar Sep 28 '20 18:09 javagl

The unused dependencies are type packages for TypeScript. @types/jest is for the Jest unit test stuff which we aren't using much of, and @types/node is the typical node stuff. Including each isn't necessarily a bad thing, although both could be moved to devDependencies.

I believe the eslint missing dependencies are due to the fact that depcheck checks against the package.json, and all of the linter configuration is within the react-scripts package. I'm not sure why it's also flagging @redux-saga/core as a missing dependency as the project wouldn't build without that.

We probably can do a little cleanup of the package.json file. I see a bunch of things under dependencies that should probably be moved to devDependencies for the sake of the CI build process. Ultimately, the production builds are only including what is actually being used by the code under /src given how react-scripts configures webpack.

weegeekps avatar Sep 28 '20 19:09 weegeekps

Recently the new version of React and Create React App came out, which I'll be upgrading us to soon. When I do so I will audit the dependencies and move those that should be moved to devDependencies.

weegeekps avatar Oct 29 '20 14:10 weegeekps