Using an index.ts in the root directory of each folder to export it's contents is a great way to organise your projects.
However explicitly providing a barrel in each folder then exporting each file in that barel is both cumbersome, cluttering and prone to mistakes.
What I'd like to see is each folder has all of it's exports available to import, unless that folder has an index.ts and explicitly re-exports.
/my-module
index.ts
part-1.ts
part-2.ts
part-3.tsx
The above folder structure would be replaced with
/my-module
part-1.ts
part-2.ts
part-3.tsx
and the import statement could still be
import {} from './my-module'
For an implementation example/reference, check out Go (Golang). Achieving a similar behaviour to it would be nice.
Using an
index.tsin the root directory of each folder to export it's contents is a great way to organise your projects.However explicitly providing a barrel in each folder then exporting each file in that barel is both cumbersome, cluttering and prone to mistakes.
What I'd like to see is each folder has all of it's exports available to import, unless that folder has an index.ts and explicitly re-exports.
The above folder structure would be replaced with
and the import statement could still be
For an implementation example/reference, check out Go (Golang). Achieving a similar behaviour to it would be nice.