Closed tbroadley closed 2 years ago
Another complication: ts-node doesn't currently have stable support for ES modules.
Draft PR that fixes this issue by removing ts-node from the project: https://github.com/tbroadley/spellchecker-cli/pull/89
The next issue is that I use non-top-level require
calls in the Spellchecker class's constructor. I'll need to convert these into async import
calls.
This is a bit of a challenge because the latest version of Remark is only published as an ES module, not as a CommonJS module. https://github.com/remarkjs/remark/releases/tag/14.0.0
And spellchecker-cli uses CommonJS.
Maybe the solution is to change
tsconfig.json
to compile the TypeScript down to ES modules? Then tell Node to use ES modules by setting thetype
field inpackage.json
?It seems that Node 14 is the oldest , and it has stable support for ES modules. But maybe still worth bumping this project's major version for safety.