Skip to content

Commit d0d9115

Browse files
committed
feat!: make recommended options default
1 parent a0208ac commit d0d9115

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2489
-1964
lines changed

docs/content/rules/sort-array-includes.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ This rule accepts an options object with the following properties:
121121

122122
### type
123123

124-
<sub>(default: `'alphabetical'`)</sub>
124+
<sub>default: `'alphabetical'`</sub>
125125

126126
Specifies the sorting method.
127127

@@ -131,7 +131,7 @@ Specifies the sorting method.
131131

132132
### order
133133

134-
<sub>(default: `'asc'`)</sub>
134+
<sub>default: `'asc'`</sub>
135135

136136
Determines whether the sorted items should be in ascending or descending order.
137137

@@ -140,7 +140,7 @@ Determines whether the sorted items should be in ascending or descending order.
140140

141141
### ignoreCase
142142

143-
<sub>(default: `true`)</sub>
143+
<sub>default: `true`</sub>
144144

145145
Controls whether sorting should be case-sensitive or not.
146146

@@ -150,7 +150,7 @@ Controls whether sorting should be case-sensitive or not.
150150

151151
### spreadLast
152152

153-
<sub>(default: `false`)</sub>
153+
<sub>default: `true`</sub>
154154

155155
Determines the position of spread elements within the array.
156156

@@ -175,8 +175,9 @@ Determines the position of spread elements within the array.
175175
'perfectionist/sort-array-includes': [
176176
'error',
177177
{
178-
type: 'natural',
178+
type: 'alphabetical',
179179
order: 'asc',
180+
ignoreCase: true,
180181
spreadLast: true,
181182
},
182183
],
@@ -198,8 +199,9 @@ Determines the position of spread elements within the array.
198199
'perfectionist/sort-array-includes': [
199200
'error',
200201
{
201-
type: 'natural',
202+
type: 'alphabetical',
202203
order: 'asc',
204+
ignoreCase: true,
203205
spreadLast: true,
204206
},
205207
],

docs/content/rules/sort-astro-attributes.mdx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This rule accepts an options object with the following properties:
110110

111111
### type
112112

113-
<sub>(default: `'alphabetical'`)</sub>
113+
<sub>default: `'alphabetical'`</sub>
114114

115115
Specifies the sorting method.
116116

@@ -120,7 +120,7 @@ Specifies the sorting method.
120120

121121
### order
122122

123-
<sub>(default: `'asc'`)</sub>
123+
<sub>default: `'asc'`</sub>
124124

125125
Determines whether the sorted items should be in ascending or descending order.
126126

@@ -129,7 +129,7 @@ Determines whether the sorted items should be in ascending or descending order.
129129

130130
### ignoreCase
131131

132-
<sub>(default: `true`)</sub>
132+
<sub>default: `true`</sub>
133133

134134
Controls whether sorting should be case-sensitive or not.
135135

@@ -138,7 +138,7 @@ Controls whether sorting should be case-sensitive or not.
138138

139139
### groups
140140

141-
<sub>(default: `[]`)</sub>
141+
<sub>default: `[]`</sub>
142142

143143
Allows you to specify a list of Astro attribute groups for sorting. Groups help organize attributes into categories, prioritizing them during sorting. Multiple groups can be combined to achieve the desired sorting order.
144144

@@ -169,7 +169,7 @@ Example:
169169

170170
### customGroups
171171

172-
<sub>(default: `{}`)</sub>
172+
<sub>default: `{}`</sub>
173173

174174
You can define your own groups for Astro attributes. The [minimatch](https://github.com/isaacs/minimatch) library is used for pattern matching.
175175

@@ -243,13 +243,11 @@ In order to start using this rule, you need to install additional dependency:
243243
'perfectionist/sort-astro-attributes': [
244244
'error',
245245
{
246-
type: 'natural',
246+
type: 'alphabetical',
247247
order: 'asc',
248-
groups: [
249-
'multiline',
250-
'unknown',
251-
['shorthand', 'astro-shorthand'],
252-
],
248+
ignoreCase: true,
249+
groups: [],
250+
customGroups: {},
253251
},
254252
],
255253
},
@@ -276,13 +274,11 @@ In order to start using this rule, you need to install additional dependency:
276274
'perfectionist/sort-astro-attributes': [
277275
'error',
278276
{
279-
type: 'natural',
277+
type: 'alphabetical',
280278
order: 'asc',
281-
groups: [
282-
'multiline',
283-
'unknown',
284-
['shorthand', 'astro-shorthand'],
285-
],
279+
ignoreCase: true,
280+
groups: [],
281+
customGroups: {},
286282
},
287283
],
288284
},

docs/content/rules/sort-classes.mdx

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ This rule accepts an options object with the following properties:
155155

156156
### type
157157

158-
<sub>(default: `'alphabetical'`)</sub>
158+
<sub>default: `'alphabetical'`</sub>
159159

160160
Specifies the sorting method.
161161

@@ -165,7 +165,7 @@ Specifies the sorting method.
165165

166166
### order
167167

168-
<sub>(default: `'asc'`)</sub>
168+
<sub>default: `'asc'`</sub>
169169

170170
Determines whether the sorted items should be in ascending or descending order.
171171

@@ -174,7 +174,7 @@ Determines whether the sorted items should be in ascending or descending order.
174174

175175
### ignoreCase
176176

177-
<sub>(default: `true`)</sub>
177+
<sub>default: `true`</sub>
178178

179179
Controls whether sorting should be case-sensitive or not.
180180

@@ -183,7 +183,7 @@ Controls whether sorting should be case-sensitive or not.
183183

184184
### partitionByComment
185185

186-
<sub>(default: `false`)</sub>
186+
<sub>default: `false`</sub>
187187

188188
Allows you to use comments to separate the class members into logical groups. This can help in organizing and maintaining large enums by creating partitions within the enum based on comments.
189189

@@ -193,7 +193,23 @@ Allows you to use comments to separate the class members into logical groups. Th
193193

194194
### groups
195195

196-
<sub>(default: `['property', 'constructor', 'method', 'unknown']`)</sub>
196+
<sub>
197+
default:
198+
```
199+
[
200+
'index-signature',
201+
'static-property',
202+
'private-property',
203+
'property',
204+
'constructor',
205+
'static-method',
206+
'private-method',
207+
'method',
208+
['get-method', 'set-method'],
209+
'unknown',
210+
]
211+
```
212+
</sub>
197213

198214
Allows you to specify a list of class member groups for sorting. Groups help organize class members into categories, prioritizing them during sorting. Multiple groups can be combined to achieve the desired sorting order.
199215

@@ -314,7 +330,7 @@ class Example {
314330

315331
### customGroups
316332

317-
<sub>(default: `{}`)</sub>
333+
<sub>default: `{}`</sub>
318334

319335
You can define your own groups for class members. The [minimatch](https://github.com/isaacs/minimatch) library is used for pattern matching.
320336

@@ -360,8 +376,10 @@ Example:
360376
'perfectionist/sort-classes': [
361377
'error',
362378
{
363-
type: 'natural',
379+
type: 'alphabetical',
364380
order: 'asc',
381+
ignoreCase: true,
382+
partitionByComment: false,
365383
groups: [
366384
'index-signature',
367385
'static-property',
@@ -371,7 +389,10 @@ Example:
371389
'static-method',
372390
'private-method',
373391
'method',
392+
['get-method', 'set-method'],
393+
'unknown',
374394
],
395+
customGroups: {},
375396
},
376397
],
377398
},
@@ -392,8 +413,10 @@ Example:
392413
'perfectionist/sort-classes': [
393414
'error',
394415
{
395-
type: 'natural',
416+
type: 'alphabetical',
396417
order: 'asc',
418+
ignoreCase: true,
419+
partitionByComment: false,
397420
groups: [
398421
'index-signature',
399422
'static-property',
@@ -403,7 +426,10 @@ Example:
403426
'static-method',
404427
'private-method',
405428
'method',
429+
['get-method', 'set-method'],
430+
'unknown',
406431
],
432+
customGroups: {},
407433
},
408434
],
409435
},

docs/content/rules/sort-enums.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ This rule accepts an options object with the following properties:
8686

8787
### type
8888

89-
<sub>(default: `'alphabetical'`)</sub>
89+
<sub>default: `'alphabetical'`</sub>
9090

9191
Specifies the sorting method.
9292

@@ -96,7 +96,7 @@ Specifies the sorting method.
9696

9797
### order
9898

99-
<sub>(default: `'asc'`)</sub>
99+
<sub>default: `'asc'`</sub>
100100

101101
Determines whether the sorted items should be in ascending or descending order.
102102

@@ -105,7 +105,7 @@ Determines whether the sorted items should be in ascending or descending order.
105105

106106
### ignoreCase
107107

108-
<sub>(default: `true`)</sub>
108+
<sub>default: `true`</sub>
109109

110110
Controls whether sorting should be case-sensitive or not.
111111

@@ -114,7 +114,7 @@ Controls whether sorting should be case-sensitive or not.
114114

115115
### partitionByComment
116116

117-
<sub>(default: `false`)</sub>
117+
<sub>default: `false`</sub>
118118

119119
Allows you to use comments to separate the members of enums into logical groups. This can help in organizing and maintaining large enums by creating partitions within the enum based on comments.
120120

@@ -140,8 +140,10 @@ Allows you to use comments to separate the members of enums into logical groups.
140140
'perfectionist/sort-enums': [
141141
'error',
142142
{
143-
type: 'natural',
143+
type: 'alphabetical',
144144
order: 'asc',
145+
ignoreCase: true,
146+
partitionByComment: false,
145147
},
146148
],
147149
},
@@ -162,8 +164,10 @@ Allows you to use comments to separate the members of enums into logical groups.
162164
'perfectionist/sort-enums': [
163165
'error',
164166
{
165-
type: 'natural',
167+
type: 'alphabetical',
166168
order: 'asc',
169+
ignoreCase: true,
170+
partitionByComment: false,
167171
},
168172
],
169173
},

docs/content/rules/sort-exports.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ This rule accepts an options object with the following properties:
8080

8181
### type
8282

83-
<sub>(default: `'alphabetical'`)</sub>
83+
<sub>default: `'alphabetical'`</sub>
8484

8585
Specifies the sorting method.
8686

@@ -90,7 +90,7 @@ Specifies the sorting method.
9090

9191
### order
9292

93-
<sub>(default: `'asc'`)</sub>
93+
<sub>default: `'asc'`</sub>
9494

9595
Determines whether the sorted items should be in ascending or descending order.
9696

@@ -99,7 +99,7 @@ Determines whether the sorted items should be in ascending or descending order.
9999

100100
### ignoreCase
101101

102-
<sub>(default: `true`)</sub>
102+
<sub>default: `true`</sub>
103103

104104
Controls whether sorting should be case-sensitive or not.
105105

@@ -124,8 +124,9 @@ Controls whether sorting should be case-sensitive or not.
124124
'perfectionist/sort-exports': [
125125
'error',
126126
{
127-
type: 'natural',
127+
type: 'alphabetical',
128128
order: 'asc',
129+
ignoreCase: true,
129130
},
130131
],
131132
},
@@ -146,8 +147,9 @@ Controls whether sorting should be case-sensitive or not.
146147
'perfectionist/sort-exports': [
147148
'error',
148149
{
149-
type: 'natural',
150+
type: 'alphabetical',
150151
order: 'asc',
152+
ignoreCase: true,
151153
},
152154
],
153155
},

0 commit comments

Comments
 (0)