@utoo/lint 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +34 -0
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -41,6 +41,27 @@ Use machine-readable output:
41
41
  pnpm exec utoo-lint --format=json src
42
42
  ```
43
43
 
44
+ ## Autofix
45
+
46
+ Apply safe fixes from all enabled rules that support autofix:
47
+
48
+ ```bash
49
+ pnpm exec utoo-lint --fix src
50
+ ```
51
+
52
+ Preview the result without changing files:
53
+
54
+ ```bash
55
+ pnpm exec utoo-lint --fix-dry-run --format=json src
56
+ ```
57
+
58
+ `--fix` writes fixed source back to disk. `--fix-dry-run` never writes files;
59
+ with JSON output, changed sources are returned in the `outputs` array. Fixes run
60
+ until the source is stable, subject to a safety pass limit. Diagnostics remain
61
+ when a rule or a particular code shape cannot be fixed safely. The current
62
+ [rule status](https://github.com/fireairforce/utoo-lint/blob/main/docs/rule-status.md)
63
+ lists autofix coverage by rule.
64
+
44
65
  ## Configuration
45
66
 
46
67
  Create a `utoo.json` file:
@@ -97,6 +118,19 @@ manually.
97
118
 
98
119
  CommonJS is supported through `require("@utoo/lint")`.
99
120
 
121
+ Set `fix: true` to compute fixed output through the JavaScript API. Raw
122
+ `lintFiles()` and `lintText()` reports expose changed sources in `outputs`
123
+ without writing them. The ESLint-compatible API follows the usual two-step
124
+ flow:
125
+
126
+ ```js
127
+ import { ESLint } from "@utoo/lint";
128
+
129
+ const eslint = new ESLint({ fix: true });
130
+ const results = await eslint.lintFiles(["src"]);
131
+ await ESLint.outputFixes(results);
132
+ ```
133
+
100
134
  ## Binary Resolution
101
135
 
102
136
  `@utoo/lint` installs a platform-specific optional dependency containing the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/lint",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Experimental JavaScript and TypeScript linter powered by Yuku",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -70,11 +70,11 @@
70
70
  "use-at-your-own-risk.js"
71
71
  ],
72
72
  "optionalDependencies": {
73
- "@utoo/lint-darwin-arm64": "0.2.0",
74
- "@utoo/lint-darwin-x64": "0.2.0",
75
- "@utoo/lint-linux-arm64": "0.2.0",
76
- "@utoo/lint-linux-x64": "0.2.0",
77
- "@utoo/lint-win32-x64": "0.2.0"
73
+ "@utoo/lint-darwin-arm64": "0.2.1",
74
+ "@utoo/lint-darwin-x64": "0.2.1",
75
+ "@utoo/lint-linux-arm64": "0.2.1",
76
+ "@utoo/lint-linux-x64": "0.2.1",
77
+ "@utoo/lint-win32-x64": "0.2.1"
78
78
  },
79
79
  "publishConfig": {
80
80
  "access": "public",