Swizec / useDimensions

A React Hook to measure DOM nodes
596 stars 45 forks source link

Typescript related peerDependencies trigger errors in npm list #21

Open johnhunter opened 4 years ago

johnhunter commented 4 years ago

typescript and @types/react are included as peerDependencies although they seem to be optional. I don't use Typescript and don't want to install them. But npm install raises warnings for these missing peer deps. Worse is that npm list errors on them and this breaks https://github.com/pivotal/LicenseFinder which we use in our CI pipeline.

Maybe these should be devDependencies?

    "peerDependencies": {
        "@types/react": "^16.8.20",
        "react": "^16.8.x",
        "typescript": "^3.5.2"
    },

https://github.com/Swizec/useDimensions/blob/master/package.json#L21-L25

MattWilliamsDev commented 4 years ago

+1 to this.

Currently working on a project that cannot use TS but we don't seem to have issues using the hook. However, the warning that pops up could give pause to other devs working on the project and make them want to drop the library.