react-flip-toolkit icon indicating copy to clipboard operation
react-flip-toolkit copied to clipboard

refactor: Add explicit file paths/extensions to all source files in flip-toolkit to appease TS

Open rschristian opened this issue 1 year ago • 0 comments

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.

rschristian avatar Jul 07 '24 01:07 rschristian