Closed antongolub closed 3 years ago
Thanks for working on this.
You need to update index.d.ts (https://github.com/sindresorhus/typescript-definition-style-guide) and the readme for ESM too.
rfr
I can never decide how to handle named exports with async and sync methods:
globby
and globbySync
globbyAsync
and globbySync
The former looks nicer, but the latter is clearer. Any opinion?
My guess is that for most users, the migration will look like this:
const globby = require('globby') → import {globbyAsync as globby} from 'globby'
.
Well... I'd prefer just import {globby} from 'globby'
instead.
Alright. Let's go with globby
for async and drop globbyAsync
.
@sindresorhus, your turn
@sindresorhus sorry, why do you avoid the default export here?
I guess for consistency import? But I think maybe we can export both named and default? export {globby as default, globby}
It's weird to have one default and one named when there are two main exports. I only do default and named export mix when there's only one main export and some secondary exports (like error, or helper utilities).
But I think maybe we can export both named and default? export {globby as default, globby}
No, there should be only one way to import the thing. Aliases create confusion and inconsistency.