Prettier plugin (v0.1.0) that sorts re-export statements by source path, ideal for barrel files. It groups re-exports separated by blank lines or comments and sorts each group independently. Requires Node >=18 and Prettier ^3. Unlike general export sorting plugins, this focuses only on re-exports and preserves group structure. Currently young with potential breaking changes in future versions.
npm install prettier-plugin-sort-re-exportsNo compatibility data collected yet for this library.
Install plugin, configure in .prettierrc, and run Prettier to sort re-exports by source path.
Ensure your file contains only re-exports if you expect full sorting.
Always separate logically distinct re-export groups with a blank line to prevent merging.
npm install --save-dev prettier-plugin-sort-re-exports
Only include re-export statements (export {…} from '…') in the file.