worsier 3.2.0 → 3.4.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.
@@ -25,6 +25,7 @@
25
25
  "rules": {
26
26
  "$ref": "#/$defs/RulesConfig",
27
27
  "default": {
28
+ "commentSpacing": true,
28
29
  "importLayout": true,
29
30
  "interfaceLayout": 0,
30
31
  "objectPropertySpacing": true,
@@ -41,6 +42,10 @@
41
42
  "imports": "separate",
42
43
  "multilineCallStatements": "separate",
43
44
  "returnStatements": "separate",
45
+ "singleLineCallStatements": {
46
+ "betweenCalls": "compact",
47
+ "withOtherStatements": "separate"
48
+ },
44
49
  "typeAliases": "separate",
45
50
  "variableDeclarations": "separate"
46
51
  },
@@ -76,6 +81,10 @@
76
81
  "RulesConfig": {
77
82
  "type": "object",
78
83
  "properties": {
84
+ "commentSpacing": {
85
+ "type": "boolean",
86
+ "default": true
87
+ },
79
88
  "importLayout": {
80
89
  "type": "boolean",
81
90
  "default": true
@@ -106,6 +115,10 @@
106
115
  "imports": "separate",
107
116
  "multilineCallStatements": "separate",
108
117
  "returnStatements": "separate",
118
+ "singleLineCallStatements": {
119
+ "betweenCalls": "compact",
120
+ "withOtherStatements": "separate"
121
+ },
109
122
  "typeAliases": "separate",
110
123
  "variableDeclarations": "separate"
111
124
  }
@@ -146,6 +159,30 @@
146
159
  "off"
147
160
  ]
148
161
  },
162
+ "SingleLineCallStatementSpacingConfig": {
163
+ "type": "object",
164
+ "properties": {
165
+ "betweenCalls": {
166
+ "$ref": "#/$defs/StatementSpacingMode",
167
+ "default": "compact"
168
+ },
169
+ "withOtherStatements": {
170
+ "$ref": "#/$defs/StatementSpacingMode",
171
+ "default": "separate"
172
+ }
173
+ },
174
+ "additionalProperties": false
175
+ },
176
+ "SingleLineCallStatementSpacingRule": {
177
+ "anyOf": [
178
+ {
179
+ "$ref": "#/$defs/StatementSpacingMode"
180
+ },
181
+ {
182
+ "$ref": "#/$defs/SingleLineCallStatementSpacingConfig"
183
+ }
184
+ ]
185
+ },
149
186
  "StatementSpacingConfig": {
150
187
  "type": "object",
151
188
  "properties": {
@@ -165,6 +202,13 @@
165
202
  "$ref": "#/$defs/StatementSpacingMode",
166
203
  "default": "separate"
167
204
  },
205
+ "singleLineCallStatements": {
206
+ "$ref": "#/$defs/SingleLineCallStatementSpacingRule",
207
+ "default": {
208
+ "betweenCalls": "compact",
209
+ "withOtherStatements": "separate"
210
+ }
211
+ },
168
212
  "typeAliases": {
169
213
  "$ref": "#/$defs/StatementSpacingMode",
170
214
  "default": "separate"
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export type InterfaceLayoutMode = 'off';
2
2
  export type SemicolonMode = 'always' | 'asNeeded' | 'off';
3
+ export type StatementSpacingMode = 'separate' | 'compact' | 'off';
3
4
  export interface FormatConfig {
4
5
  $schema?: string | null;
5
6
  ignorePatterns?: string[];
@@ -8,6 +9,7 @@ export interface FormatConfig {
8
9
  verifyAst?: boolean;
9
10
  }
10
11
  export interface RulesConfig {
12
+ commentSpacing?: boolean;
11
13
  importLayout?: boolean;
12
14
  interfaceLayout?: number | InterfaceLayoutMode;
13
15
  objectPropertySpacing?: boolean;
@@ -29,6 +31,11 @@ export interface StatementSpacingConfig {
29
31
  imports?: 'separate' | 'compact' | 'off';
30
32
  multilineCallStatements?: 'separate' | 'compact' | 'off';
31
33
  returnStatements?: 'separate' | 'compact' | 'off';
34
+ singleLineCallStatements?: StatementSpacingMode | SingleLineCallStatementSpacingConfig;
32
35
  typeAliases?: 'separate' | 'compact' | 'off';
33
36
  variableDeclarations?: 'separate' | 'compact' | 'off';
34
37
  }
38
+ export interface SingleLineCallStatementSpacingConfig {
39
+ betweenCalls?: 'separate' | 'compact' | 'off';
40
+ withOtherStatements?: 'separate' | 'compact' | 'off';
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worsier",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "A focused JavaScript, TypeScript, and Vue SFC script formatter powered by Rust",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,14 +49,14 @@
49
49
  ]
50
50
  },
51
51
  "optionalDependencies": {
52
- "worsier-darwin-arm64": "3.2.0",
53
- "worsier-win32-arm64-msvc": "3.2.0",
54
- "worsier-linux-arm64-gnu": "3.2.0",
55
- "worsier-linux-arm64-musl": "3.2.0",
56
- "worsier-darwin-x64": "3.2.0",
57
- "worsier-win32-x64-msvc": "3.2.0",
58
- "worsier-linux-x64-gnu": "3.2.0",
59
- "worsier-linux-x64-musl": "3.2.0"
52
+ "worsier-darwin-arm64": "3.4.0",
53
+ "worsier-win32-arm64-msvc": "3.4.0",
54
+ "worsier-linux-arm64-gnu": "3.4.0",
55
+ "worsier-linux-arm64-musl": "3.4.0",
56
+ "worsier-darwin-x64": "3.4.0",
57
+ "worsier-win32-x64-msvc": "3.4.0",
58
+ "worsier-linux-x64-gnu": "3.4.0",
59
+ "worsier-linux-x64-musl": "3.4.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/node": "26.4.0",