File tree 3 files changed +30
-4
lines changed
3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,27 @@ export const sortTsconfig = (): Config[] => [
205
205
} ,
206
206
]
207
207
208
+ export const sortPnpmWorkspace = ( ) : Config [ ] => [
209
+ {
210
+ files : [ '**/pnpm-workspace.yaml' ] ,
211
+ name : 'sxzz/sort/pnpm-workspace' ,
212
+ rules : {
213
+ 'yml/sort-keys' : [
214
+ 'error' ,
215
+ {
216
+ order : [ 'packages' , 'catalog' , 'catalogs' ] ,
217
+ pathPattern : '^$' ,
218
+ } ,
219
+ {
220
+ allowLineSeparatedGroups : true ,
221
+ order : { type : 'asc' } ,
222
+ pathPattern : '^catalogs?' ,
223
+ } ,
224
+ ] ,
225
+ } ,
226
+ } ,
227
+ ]
228
+
208
229
export const sortImports = ( ) : Config [ ] => [
209
230
{
210
231
name : 'sxzz/sort/imports' ,
Original file line number Diff line number Diff line change @@ -4,15 +4,18 @@ import type { Rules } from '../typegen'
4
4
import type { Config } from '../types'
5
5
6
6
export const yml = ( ) : Config [ ] => [
7
+ {
8
+ name : 'sxzz/yaml/setup' ,
9
+ plugins : {
10
+ yml : pluginYml as any ,
11
+ } ,
12
+ } ,
7
13
{
8
14
files : [ GLOB_YAML ] ,
9
15
languageOptions : {
10
16
parser : parserYml ,
11
17
} ,
12
- name : 'sxzz/yaml' ,
13
- plugins : {
14
- yml : pluginYml as any ,
15
- } ,
18
+ name : 'sxzz/yaml/rules' ,
16
19
rules : {
17
20
...( pluginYml . configs . standard . rules as Rules ) ,
18
21
...( pluginYml . configs . prettier . rules as Rules ) ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
regexp ,
14
14
sortImports ,
15
15
sortPackageJson ,
16
+ sortPnpmWorkspace ,
16
17
sortTsconfig ,
17
18
specialCases ,
18
19
typescript ,
@@ -41,6 +42,7 @@ export const presetJsonc = (): Config[] => [
41
42
...jsonc ( ) ,
42
43
...sortPackageJson ( ) ,
43
44
...sortTsconfig ( ) ,
45
+ ...sortPnpmWorkspace ( ) ,
44
46
]
45
47
/** Includes markdown, yaml + `presetJsonc` support */
46
48
export const presetLangsExtensions = ( ) : Config [ ] => [
You can’t perform that action at this time.
0 commit comments