{"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,"search_vec":"'18':41 '3':44 'barrel':21 'blank':30 'break':65 'chang':66 'comment':33 'current':61 'export':6,14,27,47,56,76 'file':22 'focus':51 'futur':68 'general':46 'group':24,37,59 'ideal':19 'independ':38 'javascript':70 'line':31 'node':40 'path':18 'plugin':2,8,49,72 'potenti':64 'preserv':58 'prettier':1,7,43,71 're':5,13,26,55,75 're-export':4,12,25,54,74 'requir':39 'separ':28 'sort':3,11,35,48,73 'sourc':17 'statement':15 'structur':60 'unlik':45 'v0.1.0':9 'version':69 'young':62","created_at":"2026-04-25T11:23:03.556015+00:00","updated_at":"2026-04-25T11:23:03.556015+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dayongkr/prettier-plugin-sort-re-exports","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/prettier-plugin-sort-re-exports","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-25","next_check":"2026-07-24","install_tag":null}}