alexbrazier / simple-update-notifier

Simple update notifier to check for npm updates for cli applications
MIT License
17 stars 9 forks source link

Incorrect default export #29

Open nicojs opened 3 months ago

nicojs commented 3 months ago

The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default.

image

See https://arethetypeswrong.github.io/?p=simple-update-notifier%402.0.0

nicojs commented 3 months ago

Current workaround:

import updateNotifierModule from 'simple-update-notifier';

/** @ts-expect-error: The types are wrong, see https://github.com/alexbrazier/simple-update-notifier/issues/29 */
const updateNotifier: typeof updateNotifierModule.default = updateNotifierModule;