Skip to content

Commit 52ba0ad

Browse files
committed
Rename attribute matching options
1 parent 64762d8 commit 52ba0ad

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ By default this plugin sorts classes in the `class` attribute, any framework-spe
7373
You can extend this behavior to sort classes in any attribute using the following options:
7474

7575
- `tailwindAttributes`: An array of exact attribute names to sort.
76-
- `tailwindAttributesStartsWith`: An array of prefixes to match attributes that begin with a certain string.
77-
- `tailwindAttributesEndsWith`: An array of suffixes to match attributes that end with a certain string.
76+
- `tailwindAttributesStartWith`: An array of prefixes to match attributes that begin with a certain string.
77+
- `tailwindAttributesEndWith`: An array of suffixes to match attributes that end with a certain string.
7878

7979
#### Example 1
8080

@@ -102,7 +102,7 @@ function MyButton({ children }) {
102102
```json5
103103
// .prettierrc
104104
{
105-
"tailwindAttributesEndsWith": ["ClassName"]
105+
"tailwindAttributesEndWith": ["ClassName"]
106106
}
107107
```
108108

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,12 +1247,12 @@ export interface PluginOptions {
12471247
/**
12481248
* List of prefixes to match attributes that contain classes.
12491249
*/
1250-
tailwindAttributesStartsWith?: string[]
1250+
tailwindAttributesStartWith?: string[]
12511251

12521252
/**
12531253
* List of suffixes to match attributes that contain classes.
12541254
*/
1255-
tailwindAttributesEndsWith?: string[]
1255+
tailwindAttributesEndWith?: string[]
12561256

12571257
/**
12581258
* Preserve whitespace around Tailwind classes when sorting.

src/options.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ export const options: Record<string, SupportOption> = {
3131
description: 'List of attributes/props that contain sortable Tailwind classes',
3232
},
3333

34-
tailwindAttributesStartsWith: {
34+
tailwindAttributesStartWith: {
3535
type: 'string',
3636
array: true,
3737
default: [{ value: [] }],
3838
category: 'Tailwind CSS',
3939
description: 'List of prefixes for attributes that contain sortable Tailwind classes',
4040
},
4141

42-
tailwindAttributesEndsWith: {
42+
tailwindAttributesEndWith: {
4343
type: 'string',
4444
array: true,
4545
default: [{ value: [] }],
@@ -114,11 +114,11 @@ export function getCustomizations(options: RequiredOptions, parser: string, defa
114114
functions.add(fn)
115115
}
116116

117-
for (let attr of options.tailwindAttributesStartsWith ?? []) {
117+
for (let attr of options.tailwindAttributesStartWith ?? []) {
118118
prefixAttrs.add(attr)
119119
}
120120

121-
for (let attr of options.tailwindAttributesEndsWith ?? []) {
121+
for (let attr of options.tailwindAttributesEndWith ?? []) {
122122
suffixAttrs.add(attr)
123123
}
124124

0 commit comments

Comments
 (0)