worsier 2.2.0 → 2.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.
- package/README.md +4 -6
- package/configuration_schema.json +39 -0
- package/dist/types.d.ts +6 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Worsier
|
|
2
2
|
|
|
3
3
|
A focused JavaScript, TypeScript, JSX, and TSX formatter powered by Rust. It formats static imports,
|
|
4
|
-
trailing commas, and the boundaries around runtime variable
|
|
5
|
-
text outside the enabled rules.
|
|
4
|
+
statement and member semicolons, trailing commas, and the boundaries around runtime variable
|
|
5
|
+
declarations while preserving source text outside the enabled rules.
|
|
6
6
|
Node.js 24.0.0 or newer is required.
|
|
7
7
|
Prebuilt Windows x64 binaries are temporarily unavailable while
|
|
8
8
|
[npm package publication is restored](https://github.com/Perdolique/worsier/issues/11).
|
|
@@ -30,7 +30,5 @@ programmatic API does not discover configuration files.
|
|
|
30
30
|
[Prettier](https://prettier.io/docs/) is a mature opinionated formatter that prints the complete
|
|
31
31
|
source, while [Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) is a fast,
|
|
32
32
|
Prettier-compatible formatter with broader language and formatting coverage. Both provide selected
|
|
33
|
-
configuration options, including
|
|
34
|
-
|
|
35
|
-
trailing-comma modes. Worsier instead focuses on independently configurable source-rewrite rules
|
|
36
|
-
and preserves text outside the selected rules.
|
|
33
|
+
configuration options, including semicolon and trailing-comma modes. Worsier instead focuses on
|
|
34
|
+
independently configurable source-rewrite rules and preserves text outside the selected rules.
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"$ref": "#/$defs/RulesConfig",
|
|
27
27
|
"default": {
|
|
28
28
|
"importLayout": true,
|
|
29
|
+
"semicolons": {
|
|
30
|
+
"classMembers": "asNeeded",
|
|
31
|
+
"statements": "asNeeded",
|
|
32
|
+
"typeMembers": "asNeeded"
|
|
33
|
+
},
|
|
29
34
|
"statementSpacing": {
|
|
30
35
|
"imports": "separate",
|
|
31
36
|
"variableDeclarations": "separate"
|
|
@@ -47,6 +52,14 @@
|
|
|
47
52
|
"type": "boolean",
|
|
48
53
|
"default": true
|
|
49
54
|
},
|
|
55
|
+
"semicolons": {
|
|
56
|
+
"$ref": "#/$defs/SemicolonConfig",
|
|
57
|
+
"default": {
|
|
58
|
+
"classMembers": "asNeeded",
|
|
59
|
+
"statements": "asNeeded",
|
|
60
|
+
"typeMembers": "asNeeded"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
50
63
|
"statementSpacing": {
|
|
51
64
|
"$ref": "#/$defs/StatementSpacingConfig",
|
|
52
65
|
"default": {
|
|
@@ -61,6 +74,32 @@
|
|
|
61
74
|
},
|
|
62
75
|
"additionalProperties": false
|
|
63
76
|
},
|
|
77
|
+
"SemicolonConfig": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": {
|
|
80
|
+
"classMembers": {
|
|
81
|
+
"$ref": "#/$defs/SemicolonMode",
|
|
82
|
+
"default": "asNeeded"
|
|
83
|
+
},
|
|
84
|
+
"statements": {
|
|
85
|
+
"$ref": "#/$defs/SemicolonMode",
|
|
86
|
+
"default": "asNeeded"
|
|
87
|
+
},
|
|
88
|
+
"typeMembers": {
|
|
89
|
+
"$ref": "#/$defs/SemicolonMode",
|
|
90
|
+
"default": "asNeeded"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"additionalProperties": false
|
|
94
|
+
},
|
|
95
|
+
"SemicolonMode": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"enum": [
|
|
98
|
+
"always",
|
|
99
|
+
"asNeeded",
|
|
100
|
+
"off"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
64
103
|
"StatementSpacingConfig": {
|
|
65
104
|
"type": "object",
|
|
66
105
|
"properties": {
|
package/dist/types.d.ts
CHANGED
|
@@ -7,9 +7,15 @@ export interface FormatConfig {
|
|
|
7
7
|
}
|
|
8
8
|
export interface RulesConfig {
|
|
9
9
|
importLayout?: boolean;
|
|
10
|
+
semicolons?: SemicolonConfig;
|
|
10
11
|
statementSpacing?: StatementSpacingConfig;
|
|
11
12
|
trailingCommas?: 'always' | 'never' | 'off';
|
|
12
13
|
}
|
|
14
|
+
export interface SemicolonConfig {
|
|
15
|
+
classMembers?: 'always' | 'asNeeded' | 'off';
|
|
16
|
+
statements?: 'always' | 'asNeeded' | 'off';
|
|
17
|
+
typeMembers?: 'always' | 'asNeeded' | 'off';
|
|
18
|
+
}
|
|
13
19
|
export interface StatementSpacingConfig {
|
|
14
20
|
imports?: 'separate' | 'compact' | 'off';
|
|
15
21
|
variableDeclarations?: 'separate' | 'compact' | 'off';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worsier",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A focused JavaScript and TypeScript import, trailing-comma, and statement-boundary formatter powered by Rust",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
]
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"worsier-darwin-arm64": "2.
|
|
52
|
-
"worsier-win32-arm64-msvc": "2.
|
|
53
|
-
"worsier-linux-arm64-gnu": "2.
|
|
54
|
-
"worsier-linux-arm64-musl": "2.
|
|
55
|
-
"worsier-darwin-x64": "2.
|
|
56
|
-
"worsier-linux-x64-gnu": "2.
|
|
57
|
-
"worsier-linux-x64-musl": "2.
|
|
51
|
+
"worsier-darwin-arm64": "2.3.0",
|
|
52
|
+
"worsier-win32-arm64-msvc": "2.3.0",
|
|
53
|
+
"worsier-linux-arm64-gnu": "2.3.0",
|
|
54
|
+
"worsier-linux-arm64-musl": "2.3.0",
|
|
55
|
+
"worsier-darwin-x64": "2.3.0",
|
|
56
|
+
"worsier-linux-x64-gnu": "2.3.0",
|
|
57
|
+
"worsier-linux-x64-musl": "2.3.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "26.2.0",
|