{"library":"prettier-plugin-sort-class-names","title":"Prettier Plugin Sort Class Names","description":"A Prettier plugin that sorts HTML class attributes alphabetically or with a custom order file. Version 3.0.1 supports HTML, CSS @apply, JSX/TSX, and twin.macro. It automatically detects the plugin when installed alongside Prettier 2.x. Unlike similar tools (e.g., prettier-plugin-tailwindcss), this plugin offers flexible ordering via an external file and custom prefixes for responsive variants. Maintenance is community-driven.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-sort-class-names"],"cli":null},"imports":["/* no explicit import needed; plugin auto-detected */","// set in prettier config: module.exports = { sortClassNamesOrderFile: './my-order.txt' }","// set in prettier config: module.exports = { sortClassNamesPrefixes: 'xs:,sm:,md:' }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install prettier prettier-plugin-sort-class-names --save-dev\necho 'div.flex.items-center>p' > test.html\n# prettier auto-formats sorting class attributes alphabetically\nnpx prettier test.html\n# output: <div class=\"flex items-center\"><p></p></div>","lang":"typescript","description":"Installs the plugin and shows it sorts classes alphabetically in an HTML file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}