worsier 3.1.0 → 3.3.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.
@@ -31,13 +31,20 @@
31
31
  "semicolons": {
32
32
  "classMembers": "asNeeded",
33
33
  "statements": "asNeeded",
34
- "typeMembers": "always"
34
+ "typeMembers": {
35
+ "multiline": "always",
36
+ "singleLine": "asNeeded"
37
+ }
35
38
  },
36
39
  "statementSpacing": {
37
40
  "controlFlowStatements": "separate",
38
41
  "imports": "separate",
39
42
  "multilineCallStatements": "separate",
40
43
  "returnStatements": "separate",
44
+ "singleLineCallStatements": {
45
+ "betweenCalls": "compact",
46
+ "withOtherStatements": "separate"
47
+ },
41
48
  "typeAliases": "separate",
42
49
  "variableDeclarations": "separate"
43
50
  },
@@ -90,7 +97,10 @@
90
97
  "default": {
91
98
  "classMembers": "asNeeded",
92
99
  "statements": "asNeeded",
93
- "typeMembers": "always"
100
+ "typeMembers": {
101
+ "multiline": "always",
102
+ "singleLine": "asNeeded"
103
+ }
94
104
  }
95
105
  },
96
106
  "statementSpacing": {
@@ -100,6 +110,10 @@
100
110
  "imports": "separate",
101
111
  "multilineCallStatements": "separate",
102
112
  "returnStatements": "separate",
113
+ "singleLineCallStatements": {
114
+ "betweenCalls": "compact",
115
+ "withOtherStatements": "separate"
116
+ },
103
117
  "typeAliases": "separate",
104
118
  "variableDeclarations": "separate"
105
119
  }
@@ -123,8 +137,11 @@
123
137
  "default": "asNeeded"
124
138
  },
125
139
  "typeMembers": {
126
- "$ref": "#/$defs/SemicolonMode",
127
- "default": "always"
140
+ "$ref": "#/$defs/TypeMemberSemicolonRule",
141
+ "default": {
142
+ "multiline": "always",
143
+ "singleLine": "asNeeded"
144
+ }
128
145
  }
129
146
  },
130
147
  "additionalProperties": false
@@ -137,6 +154,30 @@
137
154
  "off"
138
155
  ]
139
156
  },
157
+ "SingleLineCallStatementSpacingConfig": {
158
+ "type": "object",
159
+ "properties": {
160
+ "betweenCalls": {
161
+ "$ref": "#/$defs/StatementSpacingMode",
162
+ "default": "compact"
163
+ },
164
+ "withOtherStatements": {
165
+ "$ref": "#/$defs/StatementSpacingMode",
166
+ "default": "separate"
167
+ }
168
+ },
169
+ "additionalProperties": false
170
+ },
171
+ "SingleLineCallStatementSpacingRule": {
172
+ "anyOf": [
173
+ {
174
+ "$ref": "#/$defs/StatementSpacingMode"
175
+ },
176
+ {
177
+ "$ref": "#/$defs/SingleLineCallStatementSpacingConfig"
178
+ }
179
+ ]
180
+ },
140
181
  "StatementSpacingConfig": {
141
182
  "type": "object",
142
183
  "properties": {
@@ -156,6 +197,13 @@
156
197
  "$ref": "#/$defs/StatementSpacingMode",
157
198
  "default": "separate"
158
199
  },
200
+ "singleLineCallStatements": {
201
+ "$ref": "#/$defs/SingleLineCallStatementSpacingRule",
202
+ "default": {
203
+ "betweenCalls": "compact",
204
+ "withOtherStatements": "separate"
205
+ }
206
+ },
159
207
  "typeAliases": {
160
208
  "$ref": "#/$defs/StatementSpacingMode",
161
209
  "default": "separate"
@@ -182,6 +230,30 @@
182
230
  "never",
183
231
  "off"
184
232
  ]
233
+ },
234
+ "TypeMemberSemicolonConfig": {
235
+ "type": "object",
236
+ "properties": {
237
+ "multiline": {
238
+ "$ref": "#/$defs/SemicolonMode",
239
+ "default": "always"
240
+ },
241
+ "singleLine": {
242
+ "$ref": "#/$defs/SemicolonMode",
243
+ "default": "asNeeded"
244
+ }
245
+ },
246
+ "additionalProperties": false
247
+ },
248
+ "TypeMemberSemicolonRule": {
249
+ "anyOf": [
250
+ {
251
+ "$ref": "#/$defs/SemicolonMode"
252
+ },
253
+ {
254
+ "$ref": "#/$defs/TypeMemberSemicolonConfig"
255
+ }
256
+ ]
185
257
  }
186
258
  }
187
259
  }
package/dist/types.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export type InterfaceLayoutMode = 'off';
2
+ export type SemicolonMode = 'always' | 'asNeeded' | 'off';
3
+ export type StatementSpacingMode = 'separate' | 'compact' | 'off';
2
4
  export interface FormatConfig {
3
5
  $schema?: string | null;
4
6
  ignorePatterns?: string[];
@@ -17,13 +19,22 @@ export interface RulesConfig {
17
19
  export interface SemicolonConfig {
18
20
  classMembers?: 'always' | 'asNeeded' | 'off';
19
21
  statements?: 'always' | 'asNeeded' | 'off';
20
- typeMembers?: 'always' | 'asNeeded' | 'off';
22
+ typeMembers?: SemicolonMode | TypeMemberSemicolonConfig;
23
+ }
24
+ export interface TypeMemberSemicolonConfig {
25
+ multiline?: 'always' | 'asNeeded' | 'off';
26
+ singleLine?: 'always' | 'asNeeded' | 'off';
21
27
  }
22
28
  export interface StatementSpacingConfig {
23
29
  controlFlowStatements?: 'separate' | 'compact' | 'off';
24
30
  imports?: 'separate' | 'compact' | 'off';
25
31
  multilineCallStatements?: 'separate' | 'compact' | 'off';
26
32
  returnStatements?: 'separate' | 'compact' | 'off';
33
+ singleLineCallStatements?: StatementSpacingMode | SingleLineCallStatementSpacingConfig;
27
34
  typeAliases?: 'separate' | 'compact' | 'off';
28
35
  variableDeclarations?: 'separate' | 'compact' | 'off';
29
36
  }
37
+ export interface SingleLineCallStatementSpacingConfig {
38
+ betweenCalls?: 'separate' | 'compact' | 'off';
39
+ withOtherStatements?: 'separate' | 'compact' | 'off';
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worsier",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "A focused JavaScript, TypeScript, and Vue SFC script formatter powered by Rust",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,17 +49,17 @@
49
49
  ]
50
50
  },
51
51
  "optionalDependencies": {
52
- "worsier-darwin-arm64": "3.1.0",
53
- "worsier-win32-arm64-msvc": "3.1.0",
54
- "worsier-linux-arm64-gnu": "3.1.0",
55
- "worsier-linux-arm64-musl": "3.1.0",
56
- "worsier-darwin-x64": "3.1.0",
57
- "worsier-win32-x64-msvc": "3.1.0",
58
- "worsier-linux-x64-gnu": "3.1.0",
59
- "worsier-linux-x64-musl": "3.1.0"
52
+ "worsier-darwin-arm64": "3.3.0",
53
+ "worsier-win32-arm64-msvc": "3.3.0",
54
+ "worsier-linux-arm64-gnu": "3.3.0",
55
+ "worsier-linux-arm64-musl": "3.3.0",
56
+ "worsier-darwin-x64": "3.3.0",
57
+ "worsier-win32-x64-msvc": "3.3.0",
58
+ "worsier-linux-x64-gnu": "3.3.0",
59
+ "worsier-linux-x64-musl": "3.3.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "26.2.0",
62
+ "@types/node": "26.4.0",
63
63
  "typescript": "7.0.2"
64
64
  }
65
65
  }