From fd6303c04e0fed627c7a89792d707b2da9fb6884 Mon Sep 17 00:00:00 2001 From: Pierluigi Lenoci Date: Sun, 3 May 2026 22:50:39 +0200 Subject: [PATCH] feat(docs): add prettier-plugin-bootstrap for automatic class sorting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `prettier-plugin-bootstrap` (v0.3.0) to automatically sort Bootstrap CSS classes following the framework's architecture order. - Adds `prettier-plugin-bootstrap@^0.3.0` as a dev dependency - Configures `.prettierrc.json` with the plugin (after prettier-plugin-astro) - Reformats 28 `.astro` files with sorted class attributes (no functional changes) Plugin features: - Sorts classes: layout → components → helpers → utilities - Responsive variants sort after their base class - Supports HTML, JSX/TSX, Vue, Angular, Svelte, and Astro - Public sorting API via `prettier-plugin-bootstrap/sorter` - 121 tests, 100% coverage, zero runtime dependencies Signed-off-by: Pierluigi Lenoci --- package-lock.json | 14 +++++++++++++ package.json | 1 + site/.prettierrc.json | 2 +- site/src/components/Ads.astro | 4 ++-- site/src/components/DocsSidebar.astro | 4 ++-- site/src/components/footer/Footer.astro | 14 ++++++------- site/src/components/header/LinkItem.astro | 2 +- site/src/components/header/Navigation.astro | 20 +++++++++---------- site/src/components/header/Skippy.astro | 4 ++-- site/src/components/header/Versions.astro | 6 +++--- site/src/components/home/CSSVariables.astro | 10 +++++----- .../components/home/ComponentUtilities.astro | 20 +++++++++---------- site/src/components/home/Customize.astro | 6 +++--- site/src/components/home/GetStarted.astro | 20 +++++++++---------- site/src/components/home/Icons.astro | 6 +++--- site/src/components/home/MastHead.astro | 16 +++++++-------- site/src/components/home/Plugins.astro | 10 +++++----- site/src/components/shortcodes/AddedIn.astro | 2 +- .../components/shortcodes/DeprecatedIn.astro | 2 +- site/src/components/shortcodes/JsDocs.astro | 4 ++-- site/src/components/shortcodes/ScssDocs.astro | 4 ++-- site/src/layouts/BaseLayout.astro | 2 +- site/src/layouts/ExamplesLayout.astro | 2 +- site/src/layouts/SingleLayout.astro | 8 ++++---- site/src/layouts/partials/ThemeToggler.astro | 14 ++++++------- site/src/pages/404.astro | 2 +- .../pages/docs/[version]/examples/index.astro | 6 +++--- 27 files changed, 110 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index 206c0399533f..6de452720586 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,6 +78,7 @@ "postcss-cli": "^11.0.1", "prettier": "^3.8.3", "prettier-plugin-astro": "^0.14.1", + "prettier-plugin-bootstrap": "^0.3.0", "rehype-autolink-headings": "^7.1.0", "remark": "^15.0.1", "remark-html": "^16.0.1", @@ -15868,6 +15869,19 @@ "node": "^14.15.0 || >=16.0.0" } }, + "node_modules/prettier-plugin-bootstrap": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-bootstrap/-/prettier-plugin-bootstrap-0.3.0.tgz", + "integrity": "sha512-1hSibEoQNsYfboNOTWQdbptjZH8hHZuIJ8BMW8GJ7fEjgkTYPgEH9SIhYJRqknB4mo389SRB+fmzX2xI28P3sw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "prettier": "^3.0.0" + } + }, "node_modules/pretty-format": { "version": "30.2.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.2.0.tgz", diff --git a/package.json b/package.json index b5a12ca108f4..504d1845028f 100644 --- a/package.json +++ b/package.json @@ -167,6 +167,7 @@ "postcss-cli": "^11.0.1", "prettier": "^3.8.3", "prettier-plugin-astro": "^0.14.1", + "prettier-plugin-bootstrap": "^0.3.0", "rehype-autolink-headings": "^7.1.0", "remark": "^15.0.1", "remark-html": "^16.0.1", diff --git a/site/.prettierrc.json b/site/.prettierrc.json index b3ef3394272b..c9a412929d5f 100644 --- a/site/.prettierrc.json +++ b/site/.prettierrc.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/prettierrc", "arrowParens": "always", - "plugins": ["prettier-plugin-astro"], + "plugins": ["prettier-plugin-astro", "prettier-plugin-bootstrap"], "printWidth": 120, "semi": false, "singleQuote": true, diff --git a/site/src/components/Ads.astro b/site/src/components/Ads.astro index 2a53c0a615f5..71b15bbeb95a 100644 --- a/site/src/components/Ads.astro +++ b/site/src/components/Ads.astro @@ -1,9 +1,9 @@ --- + --- + id="_carbonads_js"> diff --git a/site/src/components/DocsSidebar.astro b/site/src/components/DocsSidebar.astro index 1282ed7026e1..ec80e1be24c1 100644 --- a/site/src/components/DocsSidebar.astro +++ b/site/src/components/DocsSidebar.astro @@ -7,8 +7,8 @@ import { getSlug } from '@libs/utils' const sidebar = getData('sidebar') --- -