react-flip-toolkit
react-flip-toolkit copied to clipboard
refactor: Add explicit file paths/extensions to all source files in flip-toolkit to appease TS
Following up from https://github.com/developit/microbundle/issues/1085
Absolutely feel free to discard this -- it's a big change and reaches into coding style/preference a bit. This is essentially what's necessary. With this change, TS outputs "ESM .d.ts" files which has correct file paths.
The best way to test this that I've found is to switch the "moduleResolution" of the tsconfig.json to "node16" and also add "type": "module" in the package.json. There might be another way to get TS to surface errors, not quite sure. I imagine there's an ESLint plugin that could help enforce this too.
Running yarn build && npm pack generates a tarball that https://arethetypeswrong.github.io/ seems to give a thumbs-up for.