@shivaedev/quality 0.6.0 → 0.7.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.
- package/CHANGELOG.md +22 -0
- package/README.md +19 -39
- package/biome/declarations.json +55 -0
- package/biome/preset.json +35 -29
- package/dist/baseline/legacy.d.ts +0 -1
- package/dist/baseline/legacy.d.ts.map +1 -1
- package/dist/baseline/legacy.js +0 -1
- package/dist/baseline/legacy.js.map +1 -1
- package/dist/cli/args.d.ts +1 -6
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +7 -14
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/fix.d.ts +8 -2
- package/dist/cli/fix.d.ts.map +1 -1
- package/dist/cli/fix.js +61 -9
- package/dist/cli/fix.js.map +1 -1
- package/dist/cli.js +1 -4
- package/dist/cli.js.map +1 -1
- package/dist/config/decode.d.ts +0 -1
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +0 -1
- package/dist/config/decode.js.map +1 -1
- package/dist/config/load.d.ts +0 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +0 -1
- package/dist/config/load.js.map +1 -1
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +0 -3
- package/dist/config/resolve.js.map +1 -1
- package/dist/config.d.ts +0 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/git/base.d.ts.map +1 -1
- package/dist/git/base.js +4 -27
- package/dist/git/base.js.map +1 -1
- package/dist/git/command.d.ts +1 -1
- package/dist/git/command.d.ts.map +1 -1
- package/dist/git/command.js +2 -2
- package/dist/git/command.js.map +1 -1
- package/dist/git/history.d.ts +0 -1
- package/dist/git/history.d.ts.map +1 -1
- package/dist/git/history.js +1 -6
- package/dist/git/history.js.map +1 -1
- package/dist/report/render.d.ts.map +1 -1
- package/dist/report/render.js +11 -0
- package/dist/report/render.js.map +1 -1
- package/dist/rule.d.ts +2 -1
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js.map +1 -1
- package/dist/rules/biome.js +1 -1
- package/dist/rules/biome.js.map +1 -1
- package/package.json +3 -2
- package/src/baseline/legacy.ts +0 -2
- package/src/cli/args.ts +8 -16
- package/src/cli/fix.ts +78 -10
- package/src/cli.ts +1 -4
- package/src/config/decode.ts +0 -1
- package/src/config/load.ts +0 -2
- package/src/config/resolve.ts +1 -3
- package/src/config.ts +0 -3
- package/src/git/base.ts +4 -31
- package/src/git/command.ts +2 -2
- package/src/git/history.ts +1 -8
- package/src/report/render.ts +12 -0
- package/src/rule.ts +3 -2
- package/src/rules/biome.ts +1 -1
- package/dist/baseline/guard.d.ts +0 -23
- package/dist/baseline/guard.d.ts.map +0 -1
- package/dist/baseline/guard.js +0 -32
- package/dist/baseline/guard.js.map +0 -1
- package/dist/cli/check.d.ts +0 -5
- package/dist/cli/check.d.ts.map +0 -1
- package/dist/cli/check.js +0 -39
- package/dist/cli/check.js.map +0 -1
- package/dist/report/guard.d.ts +0 -9
- package/dist/report/guard.d.ts.map +0 -1
- package/dist/report/guard.js +0 -34
- package/dist/report/guard.js.map +0 -1
- package/src/baseline/guard.ts +0 -48
- package/src/cli/check.ts +0 -51
- package/src/report/guard.ts +0 -46
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.1 - 2026-10-04
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Autofixes that can change behavior or delete something written on purpose now report only, for 20 lint rules and one assist, and the author decides the fix: an autofix added the `u` flag to a regex later compiled by Go's regexp, and another dropped the sign of a computed index. The preset keeps `noAccessKey`, `noAriaHiddenOnFocusable`, `noAutofocus`, `noInteractiveElementToNoninteractiveRole`, `noNoninteractiveElementToInteractiveRole`, `noNoninteractiveTabindex`, `noRedundantRoles`, `useValidAriaProps`, `useValidAriaRole`, `noImportantStyles`, `noConstAssign`, `useExhaustiveDependencies`, `noFloatingPromises`, `useRegexpTest`, `useUnicodeRegex`, `noNonNullAssertion`, `useAtIndex` and `noParametersOnlyUsedInRecursion` at `error` with their fixes off, as `noUnusedPrivateClassMembers` already was, and `quality fix` skips `noDuplicateObjectKeys` and the `useSortedKeys` assist, whose fixes Biome's config cannot turn off. `quality lint` reports them all as before.
|
|
8
|
+
|
|
9
|
+
## 0.7.0 - 2026-10-04
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Breaking:** `quality baseline check` is gone, and so is the `adopt` config option. A config that sets `adopt` fails to load until the key is removed, and a script that runs `quality baseline check` must drop it. A finding the baseline does not cover still fails `quality lint`; a baseline that grows is no longer a failed check but a change a reviewer sees in the diff. When the failing findings are debt the baseline should keep, such as a renamed file's, the report ends with the `quality baseline write --rule …` command that records their rules again, and the pull request calls out the growth.
|
|
14
|
+
- `quality baseline prune` no longer fetches the full history of a shallow clone to find the merge base. With `--against`, a merge base out of reach exits 2 and asks for `git fetch --unshallow`; without it, `prune` drops fixed debt without following moves.
|
|
15
|
+
- `quality fix` applies Biome's lint fixes, unsafe ones included, together with its assist actions and formatting, then runs Biome's formatter once more, because a lint fix can leave code unformatted. An unsafe fix can change behavior, such as `==` becoming `===`, so review what it changed.
|
|
16
|
+
- `quality fix` repeats Biome's fixes and its format pass until a round rewrites nothing, because one fix can make room for another, such as a `u` flag and an `await` in one file. It stops after 5 rounds, names the files that still changed and exits 2.
|
|
17
|
+
- The Biome preset turns off `noProcessGlobal`, `useJsonImportAttributes`, `noMisusedPromises`, `useExhaustiveSwitchCases`, `useSortedClasses`, `noDelete`, `useConsistentArrayType`, `useConsistentCurlyBraces`, `noEqualsToNull` and `noSkippedTests`, because their autofixes changed behavior or did not terminate on real code. Its `declarations.json` declares them.
|
|
18
|
+
- The Biome preset sets `useConsistentMethodSignatures` to the property style explicitly, and `quality fix` applies its fix. A function member written as a property is checked strictly; where a member must stay bivariant, such as a list of rules with different options, wrap its type in `Bivariant` from `@shivaedev/types`. `Rule.configure` does, so a list of rules with different options still type-checks; the package now depends on `@shivaedev/types`.
|
|
19
|
+
- The Biome preset keeps `noUnusedPrivateClassMembers` at `error` but turns off its fix, so `quality fix` no longer deletes an unused private member. Whether the member is still needed or should be used is a decision for a person; `quality lint` still reports it.
|
|
20
|
+
|
|
21
|
+
### Removed
|
|
22
|
+
|
|
23
|
+
- `quality fix --lint`. `quality fix` applies the lint fixes itself.
|
|
24
|
+
|
|
3
25
|
## 0.6.0 - 2026-10-04
|
|
4
26
|
|
|
5
27
|
### Added
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @shivaedev/quality
|
|
2
2
|
|
|
3
|
-
One quality gate for a repository: typed rules, one report, a baseline
|
|
3
|
+
One quality gate for a repository: typed rules, one report, a baseline of existing debt and a registry of permanent exceptions, each with its reason.
|
|
4
4
|
|
|
5
|
-
Every rule is an error by default. A repository adopts the gate at once: it records its existing violations in the baseline, and from then on a
|
|
5
|
+
Every rule is an error by default. A repository adopts the gate at once: it records its existing violations in the baseline, and from then on a finding the baseline does not cover fails, and fixed debt leaves the baseline as files change. A baseline that grows shows in the diff, where a reviewer judges it.
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
@@ -42,8 +42,7 @@ export default defineConfig({
|
|
|
42
42
|
| `exclude` | `[]` | Paths never checked, in `.gitignore` syntax. Files ignored by git, `.git` and `node_modules` are always skipped. |
|
|
43
43
|
| `extensions` | TypeScript and JavaScript modules | Which files rules read as sources. |
|
|
44
44
|
| `registry` | `quality/registry.json` | Permanent exceptions. |
|
|
45
|
-
| `baseline` | `quality/baseline.jsonl` | Existing violations that
|
|
46
|
-
| `adopt` | `[]` | Rules the baseline takes in for the first time; see [Adopting a rule](#adopting-a-rule). |
|
|
45
|
+
| `baseline` | `quality/baseline.jsonl` | Existing violations that the gate lets through. |
|
|
47
46
|
| `local` | `[]` | The repository's own rules, made with `defineRule`. |
|
|
48
47
|
| `rules` | every rule at `error` | A level per rule id, or `{ level, options }`. |
|
|
49
48
|
|
|
@@ -102,7 +101,7 @@ A repository with existing comments adopts the rules through the baseline, for e
|
|
|
102
101
|
|
|
103
102
|
### Suppressions
|
|
104
103
|
|
|
105
|
-
A check that is silenced at one site hides the problem instead of fixing it. Three rules close the escape hatches, and none of them takes registry exceptions: a registry entry that names one fails the gate as stale. A repository with existing suppressions adopts the rules through the baseline
|
|
104
|
+
A check that is silenced at one site hides the problem instead of fixing it. Three rules close the escape hatches, and none of them takes registry exceptions: a registry entry that names one fails the gate as stale. A repository with existing suppressions adopts the rules through the baseline.
|
|
106
105
|
|
|
107
106
|
| Rule | Reports | Options |
|
|
108
107
|
| --- | --- | --- |
|
|
@@ -324,39 +323,19 @@ Lowering entries in the commit that fixes them keeps the baseline current withou
|
|
|
324
323
|
```sh
|
|
325
324
|
quality baseline tighten --staged && git add quality/baseline.jsonl
|
|
326
325
|
quality lint
|
|
327
|
-
quality baseline check
|
|
328
326
|
```
|
|
329
327
|
|
|
330
328
|
`tighten` counts the files as they are on disk. When a commit stages only part of a file, stash the rest first (as lint-staged does), or the entry may be lowered below what the commit holds.
|
|
331
329
|
|
|
332
|
-
### Baseline
|
|
330
|
+
### Baseline growth
|
|
333
331
|
|
|
334
|
-
`quality lint
|
|
332
|
+
A finding that the baseline does not cover always fails `quality lint`, locally and in CI; that is how new debt gets noticed. The baseline itself may grow: a reviewer sees each new or raised entry in the diff and judges it. When the failing findings are debt the baseline should keep, such as the debt of a file that moved or was renamed, record the rule again with `quality baseline write --rule <id>`. The report ends with that command for the rules that failed. Then call out the baseline growth in the pull request description.
|
|
335
333
|
|
|
336
|
-
|
|
337
|
-
- an entry's `count` is higher than at the base;
|
|
338
|
-
- a rule is baselined for the first time without `adopt` naming it;
|
|
339
|
-
- `adopt` names a rule with nothing baselined.
|
|
340
|
-
|
|
341
|
-
It compares with the merge base, never the tip of the target branch, so a branch that is behind never fails for debt the target branch paid off since. An entry whose file git sees as moved since the merge base is compared with the entry at the old path. When the base holds the earlier JSON format at `quality/baseline.json`, the check converts it the way `migrate` does, so the change that migrates the baseline passes.
|
|
342
|
-
|
|
343
|
-
The check reads git, not the sources, so it is cheap enough for every commit; only a base in the earlier format makes it run the rules. The target is `--against <ref>`, or else `origin/HEAD`, `origin/main` and then `origin/master`, whichever exists first. In a shallow clone that does not reach the merge base, it runs `git fetch --unshallow`, which never stops to ask for a password, and looks again. It exits 2 when there is no git work tree, no target or no merge base, including when that fetch fails; then check out with `fetch-depth: 0` in GitHub Actions, or fetch enough history for `git merge-base HEAD <target>` to succeed.
|
|
344
|
-
|
|
345
|
-
### Adopting a rule
|
|
346
|
-
|
|
347
|
-
A rule enters the baseline for the first time only while the config names it under `adopt`, so the adoption shows in the config's diff, not only in the baseline's:
|
|
348
|
-
|
|
349
|
-
```ts
|
|
350
|
-
export default defineConfig({
|
|
351
|
-
adopt: ["comments/no-jsdoc"],
|
|
352
|
-
});
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
Run `quality baseline write --rule comments/no-jsdoc` with the rule at `error`, and commit both. `adopt` lets in only rules that the base baseline does not cover: once the adoption is merged, the rule's entries only shrink like any other. Leave the rule in `adopt` while it has debt; when its last entry is gone, the check fails until it is removed, so `adopt` cannot let the rule back in later. The first baseline of a repository adopts each of its rules the same way.
|
|
334
|
+
A rule enters the baseline the same way: set it to `error`, run `quality baseline write --rule <id>` and commit both.
|
|
356
335
|
|
|
357
336
|
### Changing a limit
|
|
358
337
|
|
|
359
|
-
A count depends on the configured limit, so changing a limit shifts every count of the rule. A looser limit leaves entries that allow more than is left: they pass, and `tighten` and `prune` lower them. A stricter limit makes the rule's files fail `quality lint`, since each is now further over the limit. Run `quality baseline write --rule <id>` to record the rule again under the new limit, and commit it with the config change.
|
|
338
|
+
A count depends on the configured limit, so changing a limit shifts every count of the rule. A looser limit leaves entries that allow more than is left: they pass, and `tighten` and `prune` lower them. A stricter limit makes the rule's files fail `quality lint`, since each is now further over the limit. Run `quality baseline write --rule <id>` to record the rule again under the new limit, and commit it with the config change. The raised entries show in the diff, and the pull request calls them out.
|
|
360
339
|
|
|
361
340
|
## Registry
|
|
362
341
|
|
|
@@ -376,21 +355,20 @@ An entry covers a rule's violations in one file, for good, and must say why. Wit
|
|
|
376
355
|
|
|
377
356
|
```text
|
|
378
357
|
quality lint [--config <file>] [--warnings summary|all]
|
|
379
|
-
quality fix [--config <file>]
|
|
358
|
+
quality fix [--config <file>]
|
|
380
359
|
quality baseline write [--config <file>] [--rule <id>]...
|
|
381
360
|
quality baseline prune [--config <file>] [--against <ref>]
|
|
382
361
|
quality baseline tighten [--config <file>] [--staged]
|
|
383
|
-
quality baseline check [--config <file>] [--against <ref>]
|
|
384
362
|
quality baseline migrate [--config <file>] [--from <file>]
|
|
385
363
|
```
|
|
386
364
|
|
|
387
|
-
`quality` alone runs `lint`. `--against <ref>` names the branch the work merges into. The report groups violations by rule and states each rule's description once; warnings are summarized per rule with the files that have the most, and `--warnings all` lists each one.
|
|
365
|
+
`quality` alone runs `lint`. `--against <ref>` names the branch the work merges into; `prune` follows the moves since its merge base. Without it, `prune` takes `origin/HEAD`, `origin/main` or `origin/master`, whichever exists first, and prunes without following moves when it finds no merge base. With `--against`, a missing merge base exits 2; in a shallow clone, run `git fetch --unshallow` first. The report groups violations by rule and states each rule's description once; warnings are summarized per rule with the files that have the most, and `--warnings all` lists each one.
|
|
388
366
|
|
|
389
367
|
| Exit code | Meaning |
|
|
390
368
|
| --- | --- |
|
|
391
369
|
| 0 | Passed. Warnings may remain. |
|
|
392
|
-
| 1 | Failed: an uncovered error-level violation, a baselined file that got worse, a stale registry entry, a baseline entry for a rule that is off or unknown
|
|
393
|
-
| 2 | Could not run: no or invalid config, an invalid baseline or registry, a baseline left in the earlier format, a missing source, a rule that threw, git history
|
|
370
|
+
| 1 | Failed: an uncovered error-level violation, a baselined file that got worse, a stale registry entry, or a baseline entry for a rule that is off or unknown. |
|
|
371
|
+
| 2 | Could not run: no or invalid config, an invalid baseline or registry, a baseline left in the earlier format, a missing source, a rule that threw, git history `prune --against` cannot read, a `quality fix` that does not settle in 5 rounds, or a usage error. |
|
|
394
372
|
|
|
395
373
|
## Biome preset
|
|
396
374
|
|
|
@@ -406,17 +384,19 @@ quality baseline migrate [--config <file>] [--from <file>]
|
|
|
406
384
|
The preset sets:
|
|
407
385
|
|
|
408
386
|
- **Formatting:** tabs, a line width of 150, double quotes, semicolons, trailing commas and operators at the start of a wrapped line.
|
|
409
|
-
- **Lint:** every rule Biome recommends, at `error`, and a list of stricter rules on top, among them `noUnsafeTypeAssertion`, `useBlockStatements`, `
|
|
387
|
+
- **Lint:** every rule Biome recommends, at `error`, and a list of stricter rules on top, among them `noUnsafeTypeAssertion`, `useBlockStatements`, `useNumericSeparators`, `useUnicodeRegex`, `useLiteralKeys`, `noFloatingPromises`, `useExhaustiveDependencies`, `it` for every test, function declarations over function expressions, interfaces for object types, a cognitive complexity limit of 15, no nested ternaries, no barrel files and no `export *`.
|
|
410
388
|
- **Imports:** organized in five groups: Node and Bun builtins, packages, `@shivaedev/*` packages, aliases and relative paths. Biome counts as an alias a specifier that starts with `#`, `@/`, `~`, `$` or `%`; a tsconfig path such as `@app/*` sorts with the packages, and Biome's `noUndeclaredDependencies` takes it for one, so name aliases in a form Biome recognizes.
|
|
411
|
-
- **Assist:** organized imports and sorted keys, attributes, enum members, interface members and properties. Keys are sorted in JSON and in object literals alike
|
|
389
|
+
- **Assist:** organized imports and sorted keys, attributes, enum members, interface members and properties. Keys are sorted in JSON and in object literals alike, but only reported: `quality fix` leaves the order to the author. `package.json` is left out, because `manifests/sorted` gives it the order npm users expect.
|
|
412
390
|
- **Plugins:** GritQL rules that ban ambient time, randomness, `console` and `process.env` for Effect's services, and that ask `Effect.fn` for a literal span name shaped `Owner.operation`. They load from `./node_modules/@shivaedev/quality/biome/plugins`, so the package must be installed at the repository root.
|
|
413
391
|
- Files ignored by git are skipped.
|
|
414
392
|
|
|
415
|
-
The preset turns off `noUnusedVariables` and `noUnusedFunctionParameters`, because the tsconfig presets report them through TypeScript, and allows default exports in `*.config.*` files, which tools load through the default export. It declares these weakenings in its `declarations.json`, so `suppressions/biome-overrides` takes them as declared. Every other weakening a repository adds is an override it declares with a reason.
|
|
393
|
+
The preset turns off `noUnusedVariables` and `noUnusedFunctionParameters`, because the tsconfig presets report them through TypeScript, and allows default exports in `*.config.*` files, which tools load through the default export. It also turns off `noProcessGlobal`, `useJsonImportAttributes`, `noMisusedPromises`, `useExhaustiveSwitchCases`, `useSortedClasses`, `noDelete`, `useConsistentArrayType`, `useConsistentCurlyBraces`, `noEqualsToNull` and `noSkippedTests`, because `quality fix` applies every lint fix and their fixes changed behavior or did not terminate on real code. It declares these weakenings in its `declarations.json`, so `suppressions/biome-overrides` takes them as declared. Every other weakening a repository adds is an override it declares with a reason.
|
|
394
|
+
|
|
395
|
+
An autofix applies only a change that removes no decision; a fix that can change behavior or delete something written on purpose reports only, and the author decides. The preset keeps `noAccessKey`, `noAriaHiddenOnFocusable`, `noAutofocus`, `noInteractiveElementToNoninteractiveRole`, `noNoninteractiveElementToInteractiveRole`, `noNoninteractiveTabindex`, `noRedundantRoles`, `useValidAriaProps`, `useValidAriaRole`, `noImportantStyles`, `noConstAssign`, `noUnusedPrivateClassMembers`, `useExhaustiveDependencies`, `noFloatingPromises`, `useRegexpTest`, `useUnicodeRegex`, `noNonNullAssertion`, `useAtIndex` and `noParametersOnlyUsedInRecursion` at `error` with their fixes off, and `quality fix` skips `noDuplicateObjectKeys` and `useSortedKeys`, whose fixes Biome's config cannot turn off.
|
|
416
396
|
|
|
417
|
-
The `biome` rule runs `biome check` with the repository's config and reports each finding as `biome/<category>`, such as `biome/lint/style/useBlockStatements`, `biome/assist/source/useSortedKeys`, `biome/format` or `biome/plugin`, so Biome's findings go through the baseline like any other rule's. `
|
|
397
|
+
The `biome` rule runs `biome check` with the repository's config and reports each finding as `biome/<category>`, such as `biome/lint/style/useBlockStatements`, `biome/assist/source/useSortedKeys`, `biome/format` or `biome/plugin`, so Biome's findings go through the baseline like any other rule's. `quality baseline write --rule biome` takes in every Biome category at once. A finding below `error`, such as a rule a repository declared at `warn`, is not reported. The rule also asks for a root `biome.json` or `biome.jsonc` that extends the preset, and it takes no registry exceptions. A Biome config that Biome cannot load stops the run with Biome's message.
|
|
418
398
|
|
|
419
|
-
`quality fix` sorts every `package.json`, then applies Biome's
|
|
399
|
+
`quality fix` sorts every `package.json`, then runs `biome check --write --unsafe`, which applies Biome's lint fixes, unsafe ones included, its assist actions, such as organized imports, and its formatting, except the fixes that report only. It then runs Biome's formatter once more, because a lint fix can leave code unformatted. One fix can make room for another, so it repeats both passes until a round rewrites nothing, at most 5 rounds; when files still change in the fifth round, it names them and exits 2. An unsafe fix can change behavior, such as `==` becoming `===`, so review what it changed. An editor that runs Biome on save uses the same version when it resolves Biome from the root `node_modules`, so a repository that wants that installs `@biomejs/biome` at the version this package pins.
|
|
420
400
|
|
|
421
401
|
## Vitest projects
|
|
422
402
|
|
package/biome/declarations.json
CHANGED
|
@@ -13,5 +13,60 @@
|
|
|
13
13
|
"includes": ["**/*.config.*"],
|
|
14
14
|
"reason": "Tools load their config files through the default export.",
|
|
15
15
|
"rule": "lint/style/noDefaultExport"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"includes": ["**"],
|
|
19
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
20
|
+
"rule": "lint/correctness/noProcessGlobal"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"includes": ["**"],
|
|
24
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
25
|
+
"rule": "lint/correctness/useJsonImportAttributes"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"includes": ["**"],
|
|
29
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
30
|
+
"rule": "lint/nursery/noMisusedPromises"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"includes": ["**"],
|
|
34
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
35
|
+
"rule": "lint/nursery/useExhaustiveSwitchCases"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"includes": ["**"],
|
|
39
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
40
|
+
"rule": "lint/nursery/useSortedClasses"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"includes": ["**"],
|
|
44
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
45
|
+
"rule": "lint/performance/noDelete"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"includes": ["**"],
|
|
49
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
50
|
+
"rule": "lint/style/useConsistentArrayType"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"includes": ["**"],
|
|
54
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
55
|
+
"rule": "lint/style/useConsistentCurlyBraces"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"includes": ["**"],
|
|
59
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
60
|
+
"rule": "lint/suspicious/noEqualsToNull"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"includes": ["**"],
|
|
64
|
+
"reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
|
|
65
|
+
"rule": "lint/suspicious/noSkippedTests"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"includes": ["**"],
|
|
69
|
+
"reason": "An unused private member asks whether it is still needed or should be used; deleting it automatically skips that decision.",
|
|
70
|
+
"rule": "lint/correctness/noUnusedPrivateClassMembers"
|
|
16
71
|
}
|
|
17
72
|
]
|
package/biome/preset.json
CHANGED
|
@@ -97,21 +97,21 @@
|
|
|
97
97
|
"enabled": true,
|
|
98
98
|
"rules": {
|
|
99
99
|
"a11y": {
|
|
100
|
-
"noAccessKey": "error",
|
|
100
|
+
"noAccessKey": { "fix": "none", "level": "error" },
|
|
101
101
|
"noAmbiguousAnchorText": "error",
|
|
102
|
-
"noAriaHiddenOnFocusable": "error",
|
|
102
|
+
"noAriaHiddenOnFocusable": { "fix": "none", "level": "error" },
|
|
103
103
|
"noAriaUnsupportedElements": "error",
|
|
104
|
-
"noAutofocus": "error",
|
|
104
|
+
"noAutofocus": { "fix": "none", "level": "error" },
|
|
105
105
|
"noDistractingElements": "error",
|
|
106
106
|
"noHeaderScope": "error",
|
|
107
|
-
"noInteractiveElementToNoninteractiveRole": "error",
|
|
107
|
+
"noInteractiveElementToNoninteractiveRole": { "fix": "none", "level": "error" },
|
|
108
108
|
"noLabelWithoutControl": "error",
|
|
109
109
|
"noNoninteractiveElementInteractions": "error",
|
|
110
|
-
"noNoninteractiveElementToInteractiveRole": "error",
|
|
111
|
-
"noNoninteractiveTabindex": "error",
|
|
110
|
+
"noNoninteractiveElementToInteractiveRole": { "fix": "none", "level": "error" },
|
|
111
|
+
"noNoninteractiveTabindex": { "fix": "none", "level": "error" },
|
|
112
112
|
"noPositiveTabindex": "error",
|
|
113
113
|
"noRedundantAlt": "error",
|
|
114
|
-
"noRedundantRoles": "error",
|
|
114
|
+
"noRedundantRoles": { "fix": "none", "level": "error" },
|
|
115
115
|
"noStaticElementInteractions": "error",
|
|
116
116
|
"noSvgWithoutTitle": "error",
|
|
117
117
|
"useAltText": "error",
|
|
@@ -130,8 +130,8 @@
|
|
|
130
130
|
"useMediaCaption": "error",
|
|
131
131
|
"useSemanticElements": "error",
|
|
132
132
|
"useValidAnchor": "error",
|
|
133
|
-
"useValidAriaProps": "error",
|
|
134
|
-
"useValidAriaRole": "error",
|
|
133
|
+
"useValidAriaProps": { "fix": "none", "level": "error" },
|
|
134
|
+
"useValidAriaRole": { "fix": "none", "level": "error" },
|
|
135
135
|
"useValidAriaValues": "error",
|
|
136
136
|
"useValidAutocomplete": "error",
|
|
137
137
|
"useValidLang": "error"
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"noFlatMapIdentity": "error",
|
|
155
155
|
"noForEach": "error",
|
|
156
156
|
"noImplicitCoercions": "error",
|
|
157
|
-
"noImportantStyles": "error",
|
|
157
|
+
"noImportantStyles": { "fix": "none", "level": "error" },
|
|
158
158
|
"noRedundantDefaultExport": "error",
|
|
159
159
|
"noStaticOnlyClass": "error",
|
|
160
160
|
"noThisInStatic": "error",
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"correctness": {
|
|
193
193
|
"noBeforeInteractiveScriptOutsideDocument": "error",
|
|
194
194
|
"noChildrenProp": "error",
|
|
195
|
-
"noConstAssign": "error",
|
|
195
|
+
"noConstAssign": { "fix": "none", "level": "error" },
|
|
196
196
|
"noConstantCondition": "error",
|
|
197
197
|
"noConstantMathMinMaxClamp": "error",
|
|
198
198
|
"noConstructorReturn": "error",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"noNonoctalDecimalEscape": "error",
|
|
219
219
|
"noPrecisionLoss": "error",
|
|
220
220
|
"noPrivateImports": "error",
|
|
221
|
-
"noProcessGlobal": "
|
|
221
|
+
"noProcessGlobal": "off",
|
|
222
222
|
"noReactPropAssignments": "error",
|
|
223
223
|
"noRenderReturnValue": "error",
|
|
224
224
|
"noSelfAssign": "error",
|
|
@@ -242,11 +242,12 @@
|
|
|
242
242
|
"noUnusedImports": "error",
|
|
243
243
|
"noUnusedInstantiation": "error",
|
|
244
244
|
"noUnusedLabels": "error",
|
|
245
|
-
"noUnusedPrivateClassMembers": "error",
|
|
245
|
+
"noUnusedPrivateClassMembers": { "fix": "none", "level": "error" },
|
|
246
246
|
"noUnusedVariables": "off",
|
|
247
247
|
"noVoidElementsWithChildren": "error",
|
|
248
248
|
"noVoidTypeReturn": "error",
|
|
249
249
|
"useExhaustiveDependencies": {
|
|
250
|
+
"fix": "none",
|
|
250
251
|
"level": "error",
|
|
251
252
|
"options": {
|
|
252
253
|
"reportMissingDependenciesArray": true
|
|
@@ -256,7 +257,7 @@
|
|
|
256
257
|
"useHookAtTopLevel": "error",
|
|
257
258
|
"useInlineScriptId": "error",
|
|
258
259
|
"useIsNan": "error",
|
|
259
|
-
"useJsonImportAttributes": "
|
|
260
|
+
"useJsonImportAttributes": "off",
|
|
260
261
|
"useJsxKeyInIterable": {
|
|
261
262
|
"level": "error",
|
|
262
263
|
"options": {
|
|
@@ -284,7 +285,7 @@
|
|
|
284
285
|
}
|
|
285
286
|
},
|
|
286
287
|
"noExtendNative": "error",
|
|
287
|
-
"noFloatingPromises": "error",
|
|
288
|
+
"noFloatingPromises": { "fix": "none", "level": "error" },
|
|
288
289
|
"noIdenticalTestTitle": "error",
|
|
289
290
|
"noInvalidFileInputAccept": "error",
|
|
290
291
|
"noInvalidPropertyInitValue": "error",
|
|
@@ -292,7 +293,7 @@
|
|
|
292
293
|
"noJsxLeakedDollar": "error",
|
|
293
294
|
"noJsxNamespace": "error",
|
|
294
295
|
"noLoopFunc": "error",
|
|
295
|
-
"noMisusedPromises": "
|
|
296
|
+
"noMisusedPromises": "off",
|
|
296
297
|
"noNegationInEqualityCheck": "error",
|
|
297
298
|
"noObsoleteTags": "error",
|
|
298
299
|
"noPlaywrightElementHandle": "error",
|
|
@@ -340,7 +341,7 @@
|
|
|
340
341
|
"useControlLabel": "error",
|
|
341
342
|
"useDisposables": "error",
|
|
342
343
|
"useExhaustiveSwitchCases": {
|
|
343
|
-
"level": "
|
|
344
|
+
"level": "off",
|
|
344
345
|
"options": {
|
|
345
346
|
"requireExplicitCase": true
|
|
346
347
|
}
|
|
@@ -352,9 +353,9 @@
|
|
|
352
353
|
"useReactAsyncServerFunction": "error",
|
|
353
354
|
"useReduceTypeParameter": "error",
|
|
354
355
|
"useRegexpExec": "error",
|
|
355
|
-
"useRegexpTest": "error",
|
|
356
|
+
"useRegexpTest": { "fix": "none", "level": "error" },
|
|
356
357
|
"useSortedClasses": {
|
|
357
|
-
"level": "
|
|
358
|
+
"level": "off",
|
|
358
359
|
"options": {
|
|
359
360
|
"functions": ["cn", "clsx", "cva"]
|
|
360
361
|
}
|
|
@@ -363,13 +364,13 @@
|
|
|
363
364
|
"useTailwindShorthandClasses": "error",
|
|
364
365
|
"useTestHooksInOrder": "error",
|
|
365
366
|
"useTestHooksOnTop": "error",
|
|
366
|
-
"useUnicodeRegex": "error",
|
|
367
|
+
"useUnicodeRegex": { "fix": "none", "level": "error" },
|
|
367
368
|
"useValidTestTitle": "error"
|
|
368
369
|
},
|
|
369
370
|
"performance": {
|
|
370
371
|
"noAccumulatingSpread": "error",
|
|
371
372
|
"noBarrelFile": "error",
|
|
372
|
-
"noDelete": "
|
|
373
|
+
"noDelete": "off",
|
|
373
374
|
"noDynamicNamespaceImportAccess": "error",
|
|
374
375
|
"noReExportAll": "error",
|
|
375
376
|
"noSyncScripts": "error",
|
|
@@ -394,7 +395,7 @@
|
|
|
394
395
|
"noMultilineString": "error",
|
|
395
396
|
"noNegationElse": "error",
|
|
396
397
|
"noNestedTernary": "error",
|
|
397
|
-
"noNonNullAssertion": "error",
|
|
398
|
+
"noNonNullAssertion": { "fix": "none", "level": "error" },
|
|
398
399
|
"noParameterAssign": "error",
|
|
399
400
|
"noShoutyConstants": "error",
|
|
400
401
|
"noSubstr": "error",
|
|
@@ -404,22 +405,27 @@
|
|
|
404
405
|
"noYodaExpression": "error",
|
|
405
406
|
"useArrayLiterals": "error",
|
|
406
407
|
"useAsConstAssertion": "error",
|
|
407
|
-
"useAtIndex": "error",
|
|
408
|
+
"useAtIndex": { "fix": "none", "level": "error" },
|
|
408
409
|
"useBlockStatements": "error",
|
|
409
410
|
"useCollapsedElseIf": "error",
|
|
410
411
|
"useCollapsedIf": "error",
|
|
411
412
|
"useConsistentArrayType": {
|
|
412
|
-
"level": "
|
|
413
|
+
"level": "off",
|
|
413
414
|
"options": {
|
|
414
415
|
"syntax": "shorthand"
|
|
415
416
|
}
|
|
416
417
|
},
|
|
417
418
|
"useConsistentArrowReturn": "error",
|
|
418
419
|
"useConsistentBuiltinInstantiation": "error",
|
|
419
|
-
"useConsistentCurlyBraces": "
|
|
420
|
+
"useConsistentCurlyBraces": "off",
|
|
420
421
|
"useConsistentEnumValueType": "error",
|
|
421
422
|
"useConsistentMemberAccessibility": "error",
|
|
422
|
-
"useConsistentMethodSignatures":
|
|
423
|
+
"useConsistentMethodSignatures": {
|
|
424
|
+
"level": "error",
|
|
425
|
+
"options": {
|
|
426
|
+
"style": "property"
|
|
427
|
+
}
|
|
428
|
+
},
|
|
423
429
|
"useConsistentObjectDefinitions": "error",
|
|
424
430
|
"useConsistentTypeDefinitions": {
|
|
425
431
|
"level": "error",
|
|
@@ -501,7 +507,7 @@
|
|
|
501
507
|
"noEmptyBlockStatements": "error",
|
|
502
508
|
"noEmptyInterface": "error",
|
|
503
509
|
"noEmptySource": "error",
|
|
504
|
-
"noEqualsToNull": "
|
|
510
|
+
"noEqualsToNull": "off",
|
|
505
511
|
"noEvolvingTypes": "error",
|
|
506
512
|
"noExplicitAny": "error",
|
|
507
513
|
"noExportsInTest": "error",
|
|
@@ -526,7 +532,7 @@
|
|
|
526
532
|
"noNestedPromises": "error",
|
|
527
533
|
"noNonNullAssertedOptionalChain": "error",
|
|
528
534
|
"noOctalEscape": "error",
|
|
529
|
-
"noParametersOnlyUsedInRecursion": "error",
|
|
535
|
+
"noParametersOnlyUsedInRecursion": { "fix": "none", "level": "error" },
|
|
530
536
|
"noProto": "error",
|
|
531
537
|
"noPrototypeBuiltins": "error",
|
|
532
538
|
"noQuickfixBiome": "error",
|
|
@@ -538,7 +544,7 @@
|
|
|
538
544
|
"noShadow": "error",
|
|
539
545
|
"noShadowRestrictedNames": "error",
|
|
540
546
|
"noShorthandPropertyOverrides": "error",
|
|
541
|
-
"noSkippedTests": "
|
|
547
|
+
"noSkippedTests": "off",
|
|
542
548
|
"noSparseArray": "error",
|
|
543
549
|
"noSuspiciousSemicolonInJsx": "error",
|
|
544
550
|
"noTemplateCurlyInString": "error",
|
|
@@ -6,6 +6,5 @@ export interface LegacyEntry extends BaselineEntry {
|
|
|
6
6
|
readonly measure?: number | undefined;
|
|
7
7
|
}
|
|
8
8
|
export declare const decodeLegacyBaseline: (raw: string) => Promise<Decoded<readonly LegacyEntry[]>>;
|
|
9
|
-
export declare const measured: (legacy: readonly LegacyEntry[]) => boolean;
|
|
10
9
|
export declare const convertLegacy: (legacy: readonly LegacyEntry[], violations: readonly Violation[]) => readonly BaselineEntry[];
|
|
11
10
|
//# sourceMappingURL=legacy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../src/baseline/legacy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,eAAe,CAAC;AACzD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAWvD,MAAM,WAAW,WAAY,SAAQ,aAAa;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,eAAO,MAAM,oBAAoB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAS/F,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../src/baseline/legacy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,eAAe,CAAC;AACzD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAWvD,MAAM,WAAW,WAAY,SAAQ,aAAa;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,eAAO,MAAM,oBAAoB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAS/F,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,WAAW,EAAE,EAAE,YAAY,SAAS,SAAS,EAAE,KAAG,SAAS,aAAa,EAWtH,CAAC"}
|
package/dist/baseline/legacy.js
CHANGED
|
@@ -17,7 +17,6 @@ export const decodeLegacyBaseline = async (raw) => {
|
|
|
17
17
|
const entries = Object.entries(decoded.value).flatMap(([rule, files]) => Object.entries(files).map(([file, stored]) => ({ ...stored, file, rule })));
|
|
18
18
|
return { _tag: "Valid", value: entries };
|
|
19
19
|
};
|
|
20
|
-
export const measured = (legacy) => legacy.some((entry) => entry.measure !== undefined);
|
|
21
20
|
export const convertLegacy = (legacy, violations) => {
|
|
22
21
|
const current = groupBy(violations, (violation) => keyOf(violation.rule, violation.file));
|
|
23
22
|
return legacy.flatMap(({ count, file, measure, rule }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy.js","sourceRoot":"","sources":["../../src/baseline/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAgB,UAAU,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAkB,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CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;QAC5F,OAAO,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export type Command = {
|
|
|
6
6
|
} | {
|
|
7
7
|
readonly _tag: "Fix";
|
|
8
8
|
readonly config: string | undefined;
|
|
9
|
-
readonly lint: boolean;
|
|
10
9
|
} | {
|
|
11
10
|
readonly _tag: "BaselineWrite";
|
|
12
11
|
readonly config: string | undefined;
|
|
@@ -15,10 +14,6 @@ export type Command = {
|
|
|
15
14
|
readonly _tag: "BaselinePrune";
|
|
16
15
|
readonly config: string | undefined;
|
|
17
16
|
readonly against: string | undefined;
|
|
18
|
-
} | {
|
|
19
|
-
readonly _tag: "BaselineCheck";
|
|
20
|
-
readonly config: string | undefined;
|
|
21
|
-
readonly against: string | undefined;
|
|
22
17
|
} | {
|
|
23
18
|
readonly _tag: "BaselineTighten";
|
|
24
19
|
readonly config: string | undefined;
|
|
@@ -37,6 +32,6 @@ export type Parsed = {
|
|
|
37
32
|
readonly _tag: "Usage";
|
|
38
33
|
readonly problem: string;
|
|
39
34
|
};
|
|
40
|
-
export declare const USAGE = "Usage:\n quality lint [--config <file>] [--warnings summary|all]\n quality fix [--config <file>]
|
|
35
|
+
export declare const USAGE = "Usage:\n quality lint [--config <file>] [--warnings summary|all]\n quality fix [--config <file>]\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for a rule that is off or unknown.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a baseline from the earlier JSON format (--from, quality/baseline.json by default) to the configured file.\n\n--config <file> Config file; its directory is the repository root. Defaults to ./quality.config.ts.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
41
36
|
export declare const parseCommand: (args: readonly string[]) => Parsed;
|
|
42
37
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,GAChG;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC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package/dist/cli/args.js
CHANGED
|
@@ -2,46 +2,41 @@ import { parseArgs } from "node:util";
|
|
|
2
2
|
import { Result } from "effect";
|
|
3
3
|
export const USAGE = `Usage:
|
|
4
4
|
quality lint [--config <file>] [--warnings summary|all]
|
|
5
|
-
quality fix [--config <file>]
|
|
5
|
+
quality fix [--config <file>]
|
|
6
6
|
quality baseline write [--config <file>] [--rule <id>]...
|
|
7
7
|
quality baseline prune [--config <file>] [--against <ref>]
|
|
8
8
|
quality baseline tighten [--config <file>] [--staged]
|
|
9
|
-
quality baseline check [--config <file>] [--against <ref>]
|
|
10
9
|
quality baseline migrate [--config <file>] [--from <file>]
|
|
11
10
|
|
|
12
11
|
lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
|
|
13
12
|
or a baseline entry for a rule that is off or unknown.
|
|
14
|
-
fix Sort every package.json
|
|
15
|
-
With --lint, also apply Biome's safe lint fixes, which can change behavior.
|
|
13
|
+
fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
|
|
16
14
|
baseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.
|
|
17
15
|
baseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.
|
|
18
16
|
baseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.
|
|
19
|
-
baseline check Compare the baseline with its version at the merge base. Exits 1 when it gained an entry or a higher count.
|
|
20
17
|
baseline migrate Move a baseline from the earlier JSON format (--from, quality/baseline.json by default) to the configured file.
|
|
21
18
|
|
|
22
19
|
--config <file> Config file; its directory is the repository root. Defaults to ./quality.config.ts.
|
|
23
|
-
--against <ref> The branch the work merges into. Defaults to origin/HEAD, then origin/main, then origin/master.
|
|
20
|
+
--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.
|
|
24
21
|
Exit codes: 0 passed, 1 failed the gate, 2 could not run.`;
|
|
25
22
|
const OPTIONS = {
|
|
26
23
|
against: { type: "string" },
|
|
27
24
|
config: { type: "string" },
|
|
28
25
|
from: { type: "string" },
|
|
29
26
|
help: { short: "h", type: "boolean" },
|
|
30
|
-
lint: { type: "boolean" },
|
|
31
27
|
rule: { multiple: true, type: "string" },
|
|
32
28
|
staged: { type: "boolean" },
|
|
33
29
|
warnings: { type: "string" },
|
|
34
30
|
};
|
|
35
31
|
const usage = (problem) => ({ _tag: "Usage", problem });
|
|
36
32
|
const parsed = (command) => ({ _tag: "Parsed", command });
|
|
37
|
-
const COMMAND_OPTIONS = ["against", "from", "
|
|
33
|
+
const COMMAND_OPTIONS = ["against", "from", "rule", "staged", "warnings"];
|
|
38
34
|
const ACCEPTS = {
|
|
39
|
-
"baseline check": ["against"],
|
|
40
35
|
"baseline migrate": ["from"],
|
|
41
36
|
"baseline prune": ["against"],
|
|
42
37
|
"baseline tighten": ["staged"],
|
|
43
38
|
"baseline write": ["rule"],
|
|
44
|
-
fix: [
|
|
39
|
+
fix: [],
|
|
45
40
|
lint: ["warnings"],
|
|
46
41
|
};
|
|
47
42
|
const misplaced = (name, values) => {
|
|
@@ -60,13 +55,11 @@ const commandFor = (name, values) => {
|
|
|
60
55
|
: usage(`--warnings takes summary or all, not "${warnings}".`);
|
|
61
56
|
}
|
|
62
57
|
case "fix":
|
|
63
|
-
return parsed({ _tag: "Fix", config
|
|
58
|
+
return parsed({ _tag: "Fix", config });
|
|
64
59
|
case "baseline write":
|
|
65
60
|
return parsed({ _tag: "BaselineWrite", config, rules: values.rule ?? [] });
|
|
66
61
|
case "baseline prune":
|
|
67
62
|
return ref(values.against, { _tag: "BaselinePrune", against: values.against, config });
|
|
68
|
-
case "baseline check":
|
|
69
|
-
return ref(values.against, { _tag: "BaselineCheck", against: values.against, config });
|
|
70
63
|
case "baseline tighten":
|
|
71
64
|
return parsed({ _tag: "BaselineTighten", config, staged: values.staged === true });
|
|
72
65
|
default:
|
|
@@ -88,7 +81,7 @@ export const parseCommand = (args) => {
|
|
|
88
81
|
}
|
|
89
82
|
const name = [command, ...rest].join(" ");
|
|
90
83
|
if (ACCEPTS[name] === undefined) {
|
|
91
|
-
return usage(command === "baseline" && rest.length < 2 ? "baseline takes write, prune, tighten
|
|
84
|
+
return usage(command === "baseline" && rest.length < 2 ? "baseline takes write, prune, tighten or migrate." : `unknown command: ${name}`);
|
|
92
85
|
}
|
|
93
86
|
const problem = misplaced(name, values);
|
|
94
87
|
return problem === undefined ? commandFor(name, values) : usage(problem);
|