From c16510d19a02f5ddb84342e02918d69ae5547645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20=C5=A0er=C3=BD?= Date: Thu, 2 Apr 2026 10:05:29 +0200 Subject: [PATCH] make @tailwindcss/node a required peer dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plugin does not function without it — class sorting is its sole purpose. Removes optional flag from peerDependenciesMeta and updates documentation accordingly. --- README.md | 2 +- docs/options.md | 2 -- package.json | 8 ++------ src/tailwind.ts | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b99bff8..a1fdafb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The official `prettier-plugin-tailwindcss` does not support Latte. This plugin f npm install -D prettier-plugin-latte-tailwindcss ``` -Peer dependencies: `prettier >= 3.0.0`. For class sorting, you also need `@tailwindcss/node >= 4.0.0`. +Peer dependencies: `prettier >= 3.0.0` and `@tailwindcss/node >= 4.0.0`. Minimal `.prettierrc`: diff --git a/docs/options.md b/docs/options.md index ed8c09c..12ae0c4 100644 --- a/docs/options.md +++ b/docs/options.md @@ -20,8 +20,6 @@ If omitted, the plugin uses a default `@import "tailwindcss"` internally, which - You use **custom `@source` directives** or theme presets - Your CSS entry point imports additional stylesheets that affect class order -If omitted and `@tailwindcss/node` is not installed, class sorting is disabled entirely (the plugin still formats Latte templates). - ## `tailwindClassRegex` **Type:** `string` · **Default:** `""` (empty — auto-detect) diff --git a/package.json b/package.json index 0f70d19..533a7b8 100644 --- a/package.json +++ b/package.json @@ -44,12 +44,8 @@ "url": "https://github.com/zipper/prettier-plugin-latte-tailwindcss/issues" }, "peerDependencies": { - "prettier": ">=3.0.0" - }, - "peerDependenciesMeta": { - "@tailwindcss/node": { - "optional": true - } + "prettier": ">=3.0.0", + "@tailwindcss/node": ">=4.0.0" }, "devDependencies": { "@eslint/js": "^10.0.1", diff --git a/src/tailwind.ts b/src/tailwind.ts index effba2f..734c830 100644 --- a/src/tailwind.ts +++ b/src/tailwind.ts @@ -72,7 +72,7 @@ async function doLoad( } catch { console.warn( '[prettier-plugin-latte-tailwindcss] @tailwindcss/node not found — class sorting disabled.\n' + - 'Install it: npm install --save-dev @tailwindcss/node' + 'This is a required peer dependency. Install it: npm install --save-dev @tailwindcss/node' ) return null }