{"id":20428,"library":"prettier-plugin-sort-re-exports","title":"Prettier Plugin Sort Re-exports","description":"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.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/dayongkr/prettier-plugin-sort-re-exports","tags":["javascript","prettier","plugin","sort","re-exports"],"install":[{"cmd":"npm install prettier-plugin-sort-re-exports","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-sort-re-exports","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-sort-re-exports","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency – the plugin runs as a Prettier plugin","package":"prettier","optional":false}],"imports":[],"quickstart":{"code":"// No import needed – add to .prettierrc\n// Install: npm install --save-dev prettier-plugin-sort-re-exports\n// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-sort-re-exports\"]\n}\n\n// Then run prettier --write on your files\n// Example barrel file (index.js):\nexport { b } from \"./a/bar\";\nexport { c } from \"./a/baz\";\nexport { a } from \"./a/foo\";","lang":"javascript","description":"Install plugin, configure in .prettierrc, and run Prettier to sort re-exports by source path."},"warnings":[{"fix":"Ensure your file contains only re-exports if you expect full sorting.","message":"Plugin only sorts re-exports (export … from …), not regular export statements or other code.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always separate logically distinct re-export groups with a blank line to prevent merging.","message":"Plugin may reorder groups if blank lines or comments are missing – groups are defined by separating blank lines.","severity":"breaking","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev prettier-plugin-sort-re-exports","cause":"Plugin not installed or not in node_modules.","error":"Cannot find module 'prettier-plugin-sort-re-exports'"},{"fix":"Only include re-export statements (export {…} from '…') in the file.","cause":"Plugin encounters a non-re-export statement (e.g., export const).","error":"Error: Cannot read properties of undefined (reading 'source')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}