{"library":"prettier-plugin-bootstrap","title":"Prettier Plugin Bootstrap","description":"A Prettier plugin that automatically sorts Bootstrap CSS classes following the framework's recommended order (layout → components → utilities). Current stable version is 0.3.0, released May 2026, with regular releases. Key differentiators: zero configuration, works with multiple template engines (HTML, JSX/TSX, Vue, Angular, Svelte, Astro), supports custom attributes and functions like clsx, and preserves unknown classes. Requires Prettier ^3.0.0 and Node >=20. Offers options for attribute matching (regex), whitespace preservation, duplicate handling, and version targeting.","language":"javascript","status":"active","last_verified":"Sat May 09","install":{"commands":["npm install prettier-plugin-bootstrap"],"cli":null},"imports":["import prettierPluginBootstrap from 'prettier-plugin-bootstrap'","{\n  \"plugins\": [\"prettier-plugin-bootstrap\"],\n  \"bootstrapFunctions\": [\"clsx\"]\n}","import { type Plugin } from 'prettier';\nimport bootstrapPlugin from 'prettier-plugin-bootstrap';\nconst plugin: Plugin = bootstrapPlugin;"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install: npm install -D prettier prettier-plugin-bootstrap\n// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-bootstrap\"],\n  \"bootstrapFunctions\": [\"clsx\", \"cn\"],\n  \"bootstrapAttributes\": [\"/^data-class/\"],\n  \"bootstrapPreserveDuplicates\": false\n}\n\n// Input file (test.html)\n<div class=\"text-center p-3 container bg-primary text-white mb-4 rounded\"></div>\n\n// Run: npx prettier --write test.html\n// Output:\n<div class=\"container bg-primary text-center text-white mb-4 p-3 rounded\"></div>","lang":"typescript","description":"Shows installation, configuration with options, and the sorting result on an HTML file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}