ChainSafe / js-libp2p-gossipsub

TypeScript implementation of Gossipsub
Apache License 2.0
151 stars 43 forks source link

fix: mark import as type #365

Closed achingbrain closed 2 years ago

achingbrain commented 2 years ago

This line copies all files from the src/messages folder into dist including this .ts file, which can then end up getting compiled which depending on your setup fails with:

./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decodeRpc.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

The change here is to mark it import type as per the error. An alternative (better?) would be to not copy it into dist, either way would solve the problem.