@jmlweb/prettier-config-tailwind 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +55 -3
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @jmlweb/prettier-config-tailwind
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 4a9ece1: Update documentation to use pnpm commands instead of npm
8
+ - Updated dependencies [4a9ece1]
9
+ - @jmlweb/prettier-config-base@1.0.4
10
+
11
+ ## 1.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - 6b73301: Add changelog section with link to CHANGELOG.md in package READMEs
16
+ - Updated dependencies [6b73301]
17
+ - @jmlweb/prettier-config-base@1.0.3
18
+
3
19
  ## 1.0.2
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -16,11 +16,13 @@
16
16
  ## 📦 Installation
17
17
 
18
18
  ```bash
19
- npm install --save-dev @jmlweb/prettier-config-tailwind prettier prettier-plugin-tailwindcss
19
+ pnpm add -D @jmlweb/prettier-config-tailwind prettier prettier-plugin-tailwindcss
20
20
  ```
21
21
 
22
22
  **Note**: The `prettier-plugin-tailwindcss` plugin must be installed as a dev dependency.
23
23
 
24
+ > 💡 **Upgrading from a previous version?** See the [Migration Guide](#-migration-guide) for breaking changes and upgrade instructions.
25
+
24
26
  ## 🚀 Quick Start
25
27
 
26
28
  ### Option 1: Using `package.json` (Recommended)
@@ -82,6 +84,32 @@ This package extends `@jmlweb/prettier-config-base` and adds:
82
84
  - And all other base settings
83
85
  - ✅ `prettier-plugin-tailwindcss` - Automatically sorts Tailwind CSS classes
84
86
 
87
+ ## 🤔 Why Use This?
88
+
89
+ > **Philosophy**: Tailwind class order should be consistent and automatic. Don't waste time manually organizing utility classes.
90
+
91
+ This package extends the base Prettier config with Tailwind-specific class sorting. Following Tailwind's recommended class order improves readability and makes it easier to scan markup quickly.
92
+
93
+ ### Design Decisions
94
+
95
+ **Automatic Class Sorting**: Uses the official `prettier-plugin-tailwindcss`
96
+
97
+ - **Why**: Tailwind's recommended order groups related utilities together (layout → spacing → typography → visual effects), making classes easier to read and understand at a glance
98
+ - **Trade-off**: Initial formatting may reorder classes you've manually organized, but consistency across the codebase outweighs individual preferences
99
+ - **When to override**: If you have a strong reason to deviate from Tailwind's official recommendations (rare)
100
+
101
+ **Plugin Load Order**: The Tailwind plugin is loaded last in Prettier's plugin chain
102
+
103
+ - **Why**: Ensures Tailwind class sorting doesn't conflict with other Prettier plugins and runs after all other formatting
104
+ - **Trade-off**: None - this is the recommended approach by Tailwind Labs
105
+ - **When to override**: Never - this is a technical requirement, not a stylistic choice
106
+
107
+ **Extends Base Config**: Inherits all settings from `@jmlweb/prettier-config-base`
108
+
109
+ - **Why**: Maintains consistency with non-Tailwind projects while adding Tailwind-specific features
110
+ - **Trade-off**: If you need to change base formatting rules, you must override the base config settings
111
+ - **When to override**: When you need different base Prettier settings than the standard config
112
+
85
113
  ## 🎯 When to Use
86
114
 
87
115
  Use this package when:
@@ -124,8 +152,8 @@ Add formatting scripts to your `package.json`:
124
152
  Then run:
125
153
 
126
154
  ```bash
127
- npm run format # Format all files
128
- npm run format:check # Check formatting without modifying files
155
+ pnpm format # Format all files
156
+ pnpm format:check # Check formatting without modifying files
129
157
  ```
130
158
 
131
159
  ## 📋 Requirements
@@ -150,9 +178,33 @@ See real-world usage examples:
150
178
 
151
179
  ## 🔗 Related Packages
152
180
 
181
+ ### Internal Packages
182
+
153
183
  - [`@jmlweb/prettier-config-base`](../prettier-config-base) - Base Prettier configuration (extended by this package)
154
184
  - [`@jmlweb/eslint-config-base`](../eslint-config-base) - ESLint config for TypeScript projects
155
185
 
186
+ ### External Tools
187
+
188
+ - [Prettier](https://prettier.io/) - Opinionated code formatter
189
+ - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
190
+ - [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) - Official Tailwind class sorting plugin
191
+
192
+ ## 🔄 Migration Guide
193
+
194
+ ### Upgrading to a New Version
195
+
196
+ > **Note:** If no breaking changes were introduced in a version, it's safe to upgrade without additional steps.
197
+
198
+ **No breaking changes have been introduced yet.** This package follows semantic versioning. When breaking changes are introduced, detailed migration instructions will be provided here.
199
+
200
+ For version history, see the [Changelog](./CHANGELOG.md).
201
+
202
+ **Need Help?** If you encounter issues during migration, please [open an issue](https://github.com/jmlweb/tooling/issues/new).
203
+
204
+ ## 📜 Changelog
205
+
206
+ See [CHANGELOG.md](./CHANGELOG.md) for version history and release notes.
207
+
156
208
  ## 📄 License
157
209
 
158
210
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmlweb/prettier-config-tailwind",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Prettier configuration for jmlweb projects with Tailwind CSS support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "prettier-plugin-tailwindcss": "^0.7.2",
52
- "@jmlweb/prettier-config-base": "1.0.2"
52
+ "@jmlweb/prettier-config-base": "1.0.4"
53
53
  },
54
54
  "devDependencies": {
55
55
  "prettier": "^3.3.3",