tinylibs / tinybench

🔎 A simple, tiny and lightweight benchmarking library!
MIT License
1.73k stars 36 forks source link

Move types/index.d.ts to src/types.ts #49

Closed jcbhmr closed 11 months ago

jcbhmr commented 1 year ago

image https://www.youtube.com/watch?v=zu-EgnbmcLY Basically this 👆 by Matt Pocock https://www.mattpocock.com/

Summary of my own interpretation of it: .d.ts is for typescript types with an associated .js "real file". They often get excluded from type checking due to skipLibCheck: true, which can be not good. The recommended solution appears to be: just use normal .ts files. TypeScript will remove all the type code (since that's what tsc does after all 😉) and the import will be dropped entirely since it was all just types. Thus, the same end result.

Aslemammad commented 1 year ago

Nice, learned something new. Please send a PR if you want.

Aslemammad commented 11 months ago

@jcbhmr It's being done in #51

Thank you so much.