tbroadley / spellchecker-cli

A command-line tool for spellchecking files.
MIT License
119 stars 16 forks source link

Upgrade to latest version of Remark and related packages #88

Closed tbroadley closed 2 years ago

tbroadley commented 2 years ago

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 the type field in package.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.

tbroadley commented 2 years ago

Another complication: ts-node doesn't currently have stable support for ES modules.

tbroadley commented 2 years ago

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.