isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
487 stars 48 forks source link

Fix exports in type definitions #83

Closed joelspadin closed 2 years ago

joelspadin commented 3 years ago

Since the code uses module.exports = ..., the TypeScript types should use export = ... to match. This ensures it works when neither esModuleInterop nor allowSyntheticDefaultImports are enabled.

For more context, see https://github.com/DefinitelyTyped/DefinitelyTyped#a-package-uses-export--but-i-prefer-to-use-default-imports-can-i-change-export--to-export-default

jcubic commented 3 years ago

Sorry, but the syntax looks invalid. This is not a way to export in TypeScript. There are no syntax like export = ... in JavaScript ad TypeScript.

joelspadin commented 3 years ago

This is not a way to export in TypeScript. There are no syntax like export = ... in JavaScript ad TypeScript.

I don't understand what you mean. This is valid TypeScript syntax, and given the link in my original comment it is the correct syntax to model JavaScript that uses module.exports =.

jcubic commented 3 years ago

Sorry didn't know that, I'm not an expert in typescript.

isomorphic-git-bot commented 2 years ago

:tada: This PR is included in version 4.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: