@zayne-labs/prettier-config 0.10.10 → 0.11.0
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.
- package/README.md +60 -32
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @zayne-labs/prettier-config
|
|
2
2
|
|
|
3
|
-
Shared Prettier configuration
|
|
3
|
+
Shared Prettier configuration for Zayne Labs projects.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,62 +10,90 @@ pnpm add -D @zayne-labs/prettier-config
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
The package exports
|
|
13
|
+
The package exports three configurations:
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- `configWithTailwind`: Extended configuration with Tailwind CSS support (includes plugins)
|
|
15
|
+
### Base Config
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
Basic Prettier configuration without any plugins.
|
|
19
18
|
|
|
20
19
|
```js
|
|
21
20
|
import { baseConfig } from '@zayne-labs/prettier-config';
|
|
22
21
|
|
|
23
|
-
// Use base config
|
|
24
22
|
export default baseConfig;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Configuration in `baseConfig`:**
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
```js
|
|
27
28
|
export default {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
experimentalOperatorPosition: "start",
|
|
30
|
+
experimentalTernaries: true,
|
|
31
|
+
jsxSingleQuote: false,
|
|
32
|
+
printWidth: 107,
|
|
33
|
+
singleQuote: false,
|
|
34
|
+
tabWidth: 3,
|
|
35
|
+
trailingComma: "es5",
|
|
36
|
+
useTabs: true
|
|
37
|
+
}
|
|
31
38
|
```
|
|
32
39
|
|
|
40
|
+
### Tailwind Config
|
|
41
|
+
|
|
42
|
+
Extended base configuration with Tailwind CSS support. Includes plugins for class sorting, merging, and formatting.
|
|
43
|
+
|
|
33
44
|
```js
|
|
34
45
|
import { configWithTailwind } from '@zayne-labs/prettier-config';
|
|
35
46
|
|
|
36
|
-
// OR use Tailwind config
|
|
37
47
|
export default configWithTailwind;
|
|
48
|
+
```
|
|
38
49
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
**Plugins included:**
|
|
51
|
+
|
|
52
|
+
- `prettier-plugin-tailwindcss` - Sorts Tailwind classes
|
|
53
|
+
- `prettier-plugin-classnames` - Formats className strings
|
|
54
|
+
- `prettier-plugin-merge` - Merges plugin functionality
|
|
55
|
+
|
|
56
|
+
**Default settings:**
|
|
57
|
+
|
|
58
|
+
- Custom attributes: `classNames`, `classes`
|
|
59
|
+
- Custom functions: `cnMerge`, `cnJoin`, `cn`, `tv`, `tw`
|
|
60
|
+
- Tailwind stylesheet: `./tailwind.css`
|
|
61
|
+
|
|
62
|
+
**Note:** You'll need to install the plugins separately:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm add -D prettier-plugin-tailwindcss prettier-plugin-classnames prettier-plugin-merge
|
|
44
66
|
```
|
|
45
67
|
|
|
46
|
-
###
|
|
68
|
+
### Astro Config
|
|
47
69
|
|
|
48
|
-
|
|
70
|
+
Extended base configuration with Astro support.
|
|
49
71
|
|
|
50
72
|
```js
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
printWidth: 107,
|
|
55
|
-
singleQuote: false,
|
|
56
|
-
tabWidth: 3,
|
|
57
|
-
trailingComma: "es5",
|
|
58
|
-
useTabs: true
|
|
59
|
-
}
|
|
73
|
+
import { configWithAstro } from '@zayne-labs/prettier-config';
|
|
74
|
+
|
|
75
|
+
export default configWithAstro;
|
|
60
76
|
```
|
|
61
77
|
|
|
62
|
-
|
|
78
|
+
**Note:** You'll need to install the plugin separately:
|
|
63
79
|
|
|
64
|
-
|
|
80
|
+
```bash
|
|
81
|
+
pnpm add -D prettier-plugin-astro
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Extending Configurations
|
|
65
85
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
You can extend any configuration with your own options:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
import { baseConfig } from '@zayne-labs/prettier-config';
|
|
90
|
+
|
|
91
|
+
export default {
|
|
92
|
+
...baseConfig,
|
|
93
|
+
printWidth: 120,
|
|
94
|
+
semi: true,
|
|
95
|
+
};
|
|
96
|
+
```
|
|
69
97
|
|
|
70
98
|
## License
|
|
71
99
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zayne-labs/prettier-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"description": "Zayne Labs' Prettier config",
|
|
6
6
|
"author": "Ryan Zayne",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,19 +29,18 @@
|
|
|
29
29
|
"node": ">=18.x"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zayne-labs/toolkit-type-helpers": "^0.12.
|
|
32
|
+
"@zayne-labs/toolkit-type-helpers": "^0.12.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
36
36
|
"@changesets/cli": "^2.29.7",
|
|
37
37
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
38
|
-
"clsx": "^2.1.1",
|
|
39
38
|
"concurrently": "^9.2.1",
|
|
40
39
|
"cross-env": "^10.1.0",
|
|
41
|
-
"publint": "^0.3.
|
|
42
|
-
"tsdown": "^0.15.
|
|
40
|
+
"publint": "^0.3.15",
|
|
41
|
+
"tsdown": "^0.15.9",
|
|
43
42
|
"typescript": "5.9.3",
|
|
44
|
-
"@zayne-labs/tsconfig": "0.
|
|
43
|
+
"@zayne-labs/tsconfig": "0.11.0"
|
|
45
44
|
},
|
|
46
45
|
"publishConfig": {
|
|
47
46
|
"access": "public",
|