worsier 2.7.0 → 2.8.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 +11 -26
- package/bin/worsier.js +0 -0
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
# Worsier
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
around TypeScript type aliases and runtime variable declarations while preserving source text
|
|
6
|
-
outside the enabled rules.
|
|
3
|
+
Worsier is a focused JavaScript, TypeScript, JSX, TSX, and Vue SFC script formatter powered by Rust. Each rule is independently configurable, and source outside enabled rules is preserved instead of being reprinted.
|
|
4
|
+
|
|
7
5
|
Node.js 24.0.0 or newer is required.
|
|
8
6
|
|
|
7
|
+
[Read the complete documentation](https://github.com/Perdolique/worsier#readme).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
9
11
|
```sh
|
|
10
12
|
pnpm add -D worsier
|
|
11
13
|
pnpm exec worsier --check .
|
|
12
14
|
pnpm exec worsier --write .
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
The CLI uses its
|
|
16
|
-
can override them; run `pnpm exec worsier --init` to create the complete typed configuration.
|
|
17
|
-
Run `pnpm exec worsier --update-config` to migrate a Worsier v1 configuration and expand it with
|
|
18
|
-
every current default. It updates `./worsier.jsonc`; pass `--config PATH` to select one other file.
|
|
19
|
-
Existing values and JSONC comments are preserved, and formatting never updates the file implicitly.
|
|
20
|
-
Only registered v1 keys are migrated; v0.1 configurations and unknown keys remain errors.
|
|
21
|
-
Directory discovery skips `.git`, `node_modules`, and Wrangler's generated
|
|
22
|
-
`worker-configuration.d.ts`. Pass an ignored file explicitly when you do want Worsier to process it.
|
|
17
|
+
The CLI uses its defaults when no configuration file is present. Run `pnpm exec worsier --init` to create a complete typed `worsier.jsonc`.
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
or `// @ts-expect-error` stay together so formatting does not change TypeScript diagnostics.
|
|
19
|
+
For `.vue` files, Worsier formats inline `<script>` and `<script setup>` blocks using JavaScript, JSX, TypeScript, or TSX. Templates, styles, custom blocks, external `src` scripts, and unknown languages remain byte-for-byte unchanged.
|
|
20
|
+
|
|
21
|
+
## Programmatic API
|
|
28
22
|
|
|
29
23
|
```js
|
|
30
24
|
import { format } from 'worsier'
|
|
@@ -32,13 +26,4 @@ import { format } from 'worsier'
|
|
|
32
26
|
const output = await format('example.ts', "import{answer,type Value}from'pkg'")
|
|
33
27
|
```
|
|
34
28
|
|
|
35
|
-
Pass an optional third `FormatConfig` argument to override the
|
|
36
|
-
programmatic API does not discover configuration files.
|
|
37
|
-
|
|
38
|
-
## Broader alternatives
|
|
39
|
-
|
|
40
|
-
[Prettier](https://prettier.io/docs/) is a mature opinionated formatter that prints the complete
|
|
41
|
-
source, while [Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) is a fast,
|
|
42
|
-
Prettier-compatible formatter with broader language and formatting coverage. Both provide selected
|
|
43
|
-
configuration options, including semicolon and trailing-comma modes. Worsier instead focuses on
|
|
44
|
-
independently configurable source-rewrite rules and preserves text outside the selected rules.
|
|
29
|
+
Pass an optional third `FormatConfig` argument to override the defaults. The programmatic API does not discover configuration files.
|
package/bin/worsier.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worsier",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A focused JavaScript
|
|
3
|
+
"version": "2.8.0",
|
|
4
|
+
"description": "A focused JavaScript, TypeScript, and Vue SFC script formatter powered by Rust",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"worsier-darwin-arm64": "2.
|
|
53
|
-
"worsier-win32-arm64-msvc": "2.
|
|
54
|
-
"worsier-linux-arm64-gnu": "2.
|
|
55
|
-
"worsier-linux-arm64-musl": "2.
|
|
56
|
-
"worsier-darwin-x64": "2.
|
|
57
|
-
"worsier-win32-x64-msvc": "2.
|
|
58
|
-
"worsier-linux-x64-gnu": "2.
|
|
59
|
-
"worsier-linux-x64-musl": "2.
|
|
52
|
+
"worsier-darwin-arm64": "2.8.0",
|
|
53
|
+
"worsier-win32-arm64-msvc": "2.8.0",
|
|
54
|
+
"worsier-linux-arm64-gnu": "2.8.0",
|
|
55
|
+
"worsier-linux-arm64-musl": "2.8.0",
|
|
56
|
+
"worsier-darwin-x64": "2.8.0",
|
|
57
|
+
"worsier-win32-x64-msvc": "2.8.0",
|
|
58
|
+
"worsier-linux-x64-gnu": "2.8.0",
|
|
59
|
+
"worsier-linux-x64-musl": "2.8.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/node": "26.2.0",
|