checkupjs / checkup

A health checkup for your project.
https://checkupjs.github.io/
MIT License
76 stars 23 forks source link

Fix `fs-extra` imports #1369

Closed bertdeblock closed 11 months ago

bertdeblock commented 1 year ago

fs-extra v9 is a cjs module, so it doesn't have named exports. If this lib wants to (reliably) use named exports, it should upgrade fs-extra to v11, and import the named exports from fs-extra/esm.

More info: https://github.com/jprichardson/node-fs-extra#esm

I'm not sure how most of these imports work fine in this lib (maybe because of TS?), but the error mentioned in #1368 is consistently reproducible.

You can also easily reproduce the error by running a JS file with the following contents:

import { readJsonSync } from 'fs-extra';
console.log(readJsonSync);

Closes #1368.

bertdeblock commented 1 year ago

Related issue in the TS repo: https://github.com/microsoft/TypeScript/issues/54018