joshwcomeau / use-sound

A React Hook for playing sound effects
MIT License
2.76k stars 98 forks source link

[Types] Add Howler types as optional peer dependency #130

Open jdeblasse opened 1 year ago

jdeblasse commented 1 year ago

Consider changing your package.json file to have @types/howler as a peer dependency that's optional. Optional is important because not everyone uses Typescript.

You package.json would then look something like this (depends on your deps conventions for SEMVER et al):

  "peerDependencies": {
    "react": ">=16.8",
    "@types/howler": "^2.1.0",
  },
  "peerDependenciesMeta": {
    "@types/howler": {
      "optional": true
    }
  }

This will let users know that it's a recommended peer dependency when adding to their projects. This will resolve some of the repetitive open issues with regards to missing type definitions.