Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ho991217/ts-plugin-prefers-barrel-imports

A typescript plugin that helps your auto-import have priority on index files
https://github.com/ho991217/ts-plugin-prefers-barrel-imports

plugin typescript

Last synced: about 7 hours ago
JSON representation

A typescript plugin that helps your auto-import have priority on index files

Awesome Lists containing this project

README

        

## `ts-plugin-prefers-barrel-imports`

This is a TypeScript plugin that enforces the use of barrel imports in your project. It will automatically fix your imports to use barrel imports when possible.

| before | after |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|![before](https://github.com/user-attachments/assets/cfddb430-8d95-425d-aeab-e4e4e11bc424)|![after](https://github.com/user-attachments/assets/8608a5d3-32f1-46b6-b425-33373cdbd004)|

### TODOs

- [x] Sort import suggestions to prioritize barrel imports
- [ ] Auto-import completion for barrel imports
- [ ] Add tests