@shivaedev/quality 0.47.0 → 0.48.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.48.1 - 2026-10-30
4
+
5
+ ### Fixed
6
+
7
+ - `code/unused` treats numbered migrations in `src/server/migrations` and `src/modules/<module>/server/migrations` as entry points, because migration runners load them from their directory, so apps no longer baseline every migration as an unused file.
8
+
9
+ ## 0.48.0 - 2026-10-30
10
+
11
+ ### Added
12
+
13
+ - `quality fix --rule react/jsx-conditionals` extracts safe conditional children before their return and reports remaining findings, including baseline debt. Rule-specific fixes leave other formatting alone. Unsupported rules explain that they need a manual repair; `tests/grouped-outcomes` remains manual because grouping changes evaluation and failure order.
14
+ - Document the starter and generated apps' `pnpm baseline write --rule <id>` upgrade path.
15
+
16
+ ### Fixed
17
+
18
+ - Proxy shared RPC WebSocket upgrades on `/rpc` in `appViteConfig` so development clients receive query results and live updates without a local Vite override.
19
+
20
+ ### Breaking
21
+
22
+ - The exported CLI `Command` type's `Fix` variant now requires a `rules` array. Callers constructing that variant pass `[]` for the existing formatter or the rule ids for mechanical fixes; `parseCommand` supplies the array automatically.
23
+
3
24
  ## 0.47.0 - 2026-10-30
4
25
 
5
26
  ### Fixed
package/README.md CHANGED
@@ -87,6 +87,12 @@ For an application setup script, use `quality setup`. It installs the same hook
87
87
 
88
88
  Installing the package does not install a hook. `hooks install` writes the repository's pre-commit hook. A hook Quality did not write is kept unless `--force` replaces it. For an existing repository, `quality baseline write` records error-level findings when there is no baseline; it refuses to regenerate an existing baseline without `--rule <id>`.
89
89
 
90
+ When upgrading Quality, the starter and apps generated by create-app provide `pnpm baseline write --rule <id>`. Record each new rule’s existing findings, review the baseline diff, and land the upgrade before burning down that debt. Checks remain strict for findings above the recorded counts. After repairs, run `pnpm baseline tighten` to lower the touched files’ debt.
91
+
92
+ Use `pnpm format --rule react/jsx-conditionals` (or `quality fix --rule react/jsx-conditionals`) for mechanical repairs. It extracts a conditional child into a variable before its return when the enclosing intrinsic elements or fragments have no attributes or other children. It preserves the conditional expression, including falsy values such as `0`, and leaves mapped children, component elements and evaluation-sensitive cases for manual repair. Remaining findings are printed and exit 1 even when the baseline covers them. The rule-specific command does not run Biome’s unsafe fixes.
93
+
94
+ `quality fix --rule tests/grouped-outcomes` explains why it cannot fix safely: `outcomes` evaluates row expressions up front and reads every outcome before asserting, whereas consecutive assertions evaluate and fail one at a time. Other unsupported rule ids also exit 2 with a manual-repair message.
95
+
90
96
  Add a config only when the repository needs to supply facts such as source locations or import boundaries:
91
97
 
92
98
  ```ts
@@ -0,0 +1,3 @@
1
+ import type { SourceFile } from "#rule.ts";
2
+ export declare function fixJsxConditionals(file: SourceFile): string;
3
+ //# sourceMappingURL=fixJsxConditionals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixJsxConditionals.d.ts","sourceRoot":"","sources":["../../src/adapters/fixJsxConditionals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsE3C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CA4C3D"}
@@ -0,0 +1,98 @@
1
+ import ts from "typescript";
2
+ import { parse } from "#rules/parse.ts";
3
+ function unwrap(node) {
4
+ return ts.isParenthesizedExpression(node) ? unwrap(node.expression) : node;
5
+ }
6
+ function conditionalChild(node) {
7
+ const value = unwrap(node);
8
+ if (!(ts.isJsxElement(value) || ts.isJsxFragment(value))) {
9
+ return undefined;
10
+ }
11
+ if (ts.isJsxElement(value)) {
12
+ const { tagName, attributes } = value.openingElement;
13
+ if (!(ts.isIdentifier(tagName) && /^[a-z]/u.test(tagName.text)) || attributes.properties.length > 0) {
14
+ return undefined;
15
+ }
16
+ }
17
+ const children = value.children.filter((item) => !ts.isJsxText(item) || item.text.trim() !== "");
18
+ if (children.length !== 1) {
19
+ return undefined;
20
+ }
21
+ const child = children[0];
22
+ if (child !== undefined && (ts.isJsxElement(child) || ts.isJsxFragment(child))) {
23
+ return conditionalChild(child);
24
+ }
25
+ if (child === undefined || !ts.isJsxExpression(child) || child.expression === undefined) {
26
+ return undefined;
27
+ }
28
+ const expression = unwrap(child.expression);
29
+ return isConditional(expression) ? child.expression : undefined;
30
+ }
31
+ function isConditional(expression) {
32
+ return (ts.isConditionalExpression(expression)
33
+ || (ts.isBinaryExpression(expression) && expression.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken));
34
+ }
35
+ function returnedExpression(node) {
36
+ if (ts.isReturnStatement(node)) {
37
+ return node.expression;
38
+ }
39
+ return ts.isArrowFunction(node) && !ts.isBlock(node.body) ? node.body : undefined;
40
+ }
41
+ function mapped(node) {
42
+ return ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && node.expression.name.text === "map";
43
+ }
44
+ function manualDecision(node) {
45
+ return ((ts.isIdentifier(node) && node.text === "eval") || mapped(node) || ts.forEachChild(node, (child) => manualDecision(child) || undefined) === true);
46
+ }
47
+ function returnText(source, node, expression, rendered) {
48
+ if (ts.isReturnStatement(node)) {
49
+ return source.text.slice(node.getStart(source), expression.getStart(source)) + rendered + source.text.slice(expression.end, node.end);
50
+ }
51
+ return `return ${rendered};`;
52
+ }
53
+ export function fixJsxConditionals(file) {
54
+ const parsed = parse(file);
55
+ if (parsed === undefined) {
56
+ return file.text;
57
+ }
58
+ const source = parsed;
59
+ const names = new Set();
60
+ function namesIn(node) {
61
+ if (ts.isIdentifier(node)) {
62
+ names.add(node.text);
63
+ }
64
+ ts.forEachChild(node, namesIn);
65
+ }
66
+ namesIn(source);
67
+ let name = "qualityContent";
68
+ for (let suffix = 1; names.has(name); suffix += 1) {
69
+ name = `qualityContent${suffix}`;
70
+ }
71
+ const edits = [];
72
+ function visit(node) {
73
+ if (mapped(node)) {
74
+ return;
75
+ }
76
+ const expression = returnedExpression(node);
77
+ const child = expression === undefined ? undefined : conditionalChild(expression);
78
+ if (expression !== undefined && child !== undefined && !manualDecision(expression)) {
79
+ const rendered = file.text.slice(expression.getStart(source), child.getStart(source)) + name + file.text.slice(child.end, expression.end);
80
+ const start = ts.isReturnStatement(node) ? node.getStart(source) : expression.getStart(source);
81
+ const returned = returnText(source, node, expression, rendered);
82
+ edits.push({
83
+ end: ts.isReturnStatement(node) ? node.end : expression.end,
84
+ start,
85
+ text: `{ const ${name} = ${child.getText(source)}; ${returned} }`,
86
+ });
87
+ return;
88
+ }
89
+ ts.forEachChild(node, visit);
90
+ }
91
+ visit(source);
92
+ let text = file.text;
93
+ for (const edit of edits.toSorted((left, right) => right.start - left.start)) {
94
+ text = text.slice(0, edit.start) + edit.text + text.slice(edit.end);
95
+ }
96
+ return text;
97
+ }
98
+ //# sourceMappingURL=fixJsxConditionals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixJsxConditionals.js","sourceRoot":"","sources":["../../src/adapters/fixJsxConditionals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAQxC,SAAS,MAAM,CAAC,IAAmB;IAClC,OAAO,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAmB;IAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,EAAE,OAAO,EAAE,U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AAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9E,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAe3C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CzD"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAe3C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDzD"}
@@ -2,6 +2,7 @@ import { posix } from "node:path";
2
2
  import { readPackageManifest } from "#adapters/manifestInventory.ts";
3
3
  import { exportedModule, exportTargets } from "#imports/packageExports.ts";
4
4
  import { packageOf, workspacePackages } from "#imports/workspace.ts";
5
+ import { isMigrationFile } from "#naming/migrationFile.ts";
5
6
  import { KNIP_ISSUES } from "./findings.js";
6
7
  const ENTRIES = ["**/*.{test,spec,stories,story}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}", "src/test-support/**", "*.config.{ts,mts,cts,js,mjs,cjs}"];
7
8
  function importPaths(imports) {
@@ -26,9 +27,15 @@ export async function knipConfiguration(inputs) {
26
27
  const bins = exportTargets(manifest.bin).map((target) => target.replace(/^\.\//u, ""));
27
28
  const binaries = sources.filter((path) => bins.includes(path) || bins.includes(path.replace(/^src\//u, "dist/").replace(/\.(?<mode>[cm]?)tsx?$/u, ".$<mode>js")));
28
29
  const publicFiles = sources.filter((path) => exportedModule(manifest.exports, path));
30
+ // Migration runners load these files from their directory, so no import reaches them.
31
+ const migrations = sources.filter((path) => isMigrationFile(posix.join(directory, path)));
29
32
  return [
30
33
  directory,
31
- { entry: [...ENTRIES, ...publicFiles, ...bins, ...binaries, ...scriptEntries], paths: importPaths(manifest.imports ?? {}), project: sources },
34
+ {
35
+ entry: [...ENTRIES, ...publicFiles, ...migrations, ...bins, ...binaries, ...scriptEntries],
36
+ paths: importPaths(manifest.imports ?? {}),
37
+ project: sources,
38
+ },
32
39
  ];
33
40
  });
34
41
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/adapters/knip/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,GAAG,CAAC,gEAAgE,EAAE,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;AAE9I,SAAS,WAAW,CAAC,OAA0C;IAC9D,OAAO,MAAM,CAAC,WAAW,CACxB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE;QAClD,MAAM,QAAQ,GAAG,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9G,MA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AI,EAAE,OAAO,CAAC,CAAC,CAAC;QACrE,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;KAC1C,CAAC;AACH,CAAC"}
@@ -11,6 +11,7 @@ export declare function appViteConfig<TPlugin>(plugins: TPlugin[], conditions?:
11
11
  [k: string]: {
12
12
  changeOrigin: boolean;
13
13
  target: string;
14
+ ws: boolean;
14
15
  };
15
16
  };
16
17
  strictPort: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"appViteConfig.d.ts","sourceRoot":"","sources":["../src/appViteConfig.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAE,MAAM,EAAO,EAAE,UAAU,GAAE,MAAM,EAAO;;;;;;;QAK5G,IAAI;QACJ,IAAI;QACJ,KAAK;;;;;;QACL,UAAU;;EAGZ"}
1
+ {"version":3,"file":"appViteConfig.d.ts","sourceRoot":"","sources":["../src/appViteConfig.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAE,MAAM,EAAO,EAAE,UAAU,GAAE,MAAM,EAAO;;;;;;;QAK5G,IAAI;QACJ,IAAI;QACJ,KAAK;;;;;;;QAGL,UAAU;;EAGZ"}
@@ -5,7 +5,7 @@ export function appViteConfig(plugins, conditions = [], proxyPaths = []) {
5
5
  server: {
6
6
  host: "127.0.0.1",
7
7
  port: 5173,
8
- proxy: Object.fromEntries(["/api/auth", "/rpc", ...proxyPaths].map((path) => [path, { changeOrigin: false, target: "http://127.0.0.1:3000" }])),
8
+ proxy: Object.fromEntries(["/api/auth", "/rpc", ...proxyPaths].map((path) => [path, { changeOrigin: false, target: "http://127.0.0.1:3000", ws: path === "/rpc" }])),
9
9
  strictPort: true,
10
10
  },
11
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"appViteConfig.js","sourceRoot":"","sources":["../src/appViteConfig.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAU,OAAkB,EAAE,UAAU,GAAa,EAAE,EAAE,UAAU,GAAa,EAAE;IAC9G,OAAO;QACN,OAAO;QACP,OAAO,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE;QAC5C,MAAM,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC;YAC/I,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"appViteConfig.js","sourceRoot":"","sources":["../src/appViteConfig.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAU,OAAkB,EAAE,UAAU,GAAa,EAAE,EAAE,UAAU,GAAa,EAAE;IAC9G,OAAO;QACN,OAAO;QACP,OAAO,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE;QAC5C,MAAM,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,MAAM,CAAC,WAAW,CACxB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,EAAE,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC,CACzI;YACD,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;AACH,CAAC"}
@@ -14,6 +14,7 @@ export type Command = {
14
14
  } | {
15
15
  readonly _tag: "Fix";
16
16
  readonly config: string | undefined;
17
+ readonly rules: readonly string[];
17
18
  } | {
18
19
  readonly _tag: "BaselineMerge";
19
20
  readonly base: string;
@@ -58,6 +59,6 @@ export type Parsed = {
58
59
  readonly _tag: "Usage";
59
60
  readonly problem: string;
60
61
  };
61
- export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality ci [--coverage]\n quality setup [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\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 quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.\nsetup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.\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 an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\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 JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\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.\n--coverage Collect V8 coverage and JUnit from ci's single test run into coverage/, including failed tests.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
62
+ export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality ci [--coverage]\n quality setup [--config <file>]\n quality fix [--config <file>] [--rule <id>]...\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\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 quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.\nsetup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.\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 an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\n With --rule, apply only that rule's safe mechanical fixes and report remaining findings (exit 1), including baseline debt. Unsupported rules exit 2.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\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 JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\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.\n--coverage Collect V8 coverage and JUnit from ci's single test run into coverage/, including failed tests.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
62
63
  export declare function parseCommand(args: readonly string[]): Parsed;
63
64
  //# sourceMappingURL=args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9G;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC7D;IAAE,QAA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AM,GAAG,SAAS,CAAA;CAAE,GACxE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7B,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnI,eAAO,MAAM,KAAK,6tGAAgB,CAAC;AAwFnC,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CA0B5D"}
package/dist/cli/args.js CHANGED
@@ -27,7 +27,7 @@ const ACCEPTS = {
27
27
  "baseline write": ["rule"],
28
28
  ci: ["coverage"],
29
29
  "exceptions migrate": ["from"],
30
- fix: [],
30
+ fix: ["rule"],
31
31
  "hooks install": ["force"],
32
32
  "hooks pre-commit": [],
33
33
  "hooks status": [],
@@ -55,7 +55,7 @@ function commandFor(name, values) {
55
55
  case "exceptions migrate":
56
56
  return parsed({ _tag: "ExceptionsMigrate", config, from: values.from });
57
57
  case "fix":
58
- return parsed({ _tag: "Fix", config });
58
+ return parsed({ _tag: "Fix", config, rules: values.rule ?? [] });
59
59
  case "baseline install-driver":
60
60
  return parsed({ _tag: "BaselineInstallDriver" });
61
61
  case "baseline write":
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAsBpE,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC;AAEnC,MAAM,OAAO,GAAG;IACf,OAAO,EAA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C,GAAG,IAAI,CAAC;QACpC,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;YAC3F,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YACvD,CAAC,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IACvG,CAAC;IACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { GateFailed, SetupFailure } from "#failure.ts";
3
+ import type { RuleServices } from "#rule.ts";
4
+ export declare const fixRule: (cwd: string, configPath: string | undefined, rules: readonly string[]) => Effect.Effect<void, GateFailed | SetupFailure, RuleServices>;
5
+ //# sourceMappingURL=fixRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixRule.d.ts","sourceRoot":"","sources":["../../src/cli/fixRule.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAc,MAAM,QAAQ,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK7C,eAAO,MAAM,OAAO,yIAmClB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { join } from "node:path";
2
+ import { Console, Effect, FileSystem } from "effect";
3
+ import { fixJsxConditionals } from "#adapters/fixJsxConditionals.ts";
4
+ import { loadConfig } from "#config/load.ts";
5
+ import { scan } from "#engine/session.ts";
6
+ import { GateFailed, SetupFailure } from "#failure.ts";
7
+ import { collectInventory } from "#inventory/collect.ts";
8
+ import { plural } from "#report/plural.ts";
9
+ const GROUPED = "Consecutive assertions stop on the first failure; outcomes evaluates row expressions up front and reads every outcome before asserting. Rewrite these stories by hand to review that change in evaluation and failure order.";
10
+ export const fixRule = Effect.fn("Cli.fixRule")(function* (cwd, configPath, rules) {
11
+ const config = yield* loadConfig(cwd, configPath);
12
+ for (const rule of rules) {
13
+ if (rule !== "react/jsx-conditionals") {
14
+ return yield* new SetupFailure({
15
+ message: `No safe mechanical fix for ${rule}.${rule === "tests/grouped-outcomes" ? ` ${GROUPED}` : " Repair its findings by hand."}`,
16
+ });
17
+ }
18
+ }
19
+ const fs = yield* FileSystem.FileSystem;
20
+ const inventory = yield* collectInventory(config.root, config).pipe(Effect.mapError((cause) => new SetupFailure({ cause, message: cause.message })));
21
+ let changed = 0;
22
+ for (const file of inventory.sources) {
23
+ const text = fixJsxConditionals(file);
24
+ if (text !== file.text) {
25
+ yield* fs
26
+ .writeFileString(join(config.root, file.path), text)
27
+ .pipe(Effect.mapError((cause) => new SetupFailure({ cause, message: cause.message })));
28
+ changed += 1;
29
+ }
30
+ }
31
+ yield* Console.log(`quality: react/jsx-conditionals rewrote ${plural(changed, "file")}.`);
32
+ const remaining = (yield* scan({ ...config, active: config.active.filter((rule) => rules.includes(rule.id)) })).violations;
33
+ for (const finding of remaining) {
34
+ yield* Console.log(`${finding.file}:${finding.line ?? 1} ${finding.rule}: ${finding.message}`);
35
+ }
36
+ if (remaining.length > 0) {
37
+ return yield* new GateFailed();
38
+ }
39
+ });
40
+ //# sourceMappingURL=fixRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixRule.js","sourceRoot":"","sources":["../../src/cli/fixRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,MAAM,OAAO,GACZ,8NAA8N,CAAC;AAEhO,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,EACxD,GAAW,EACX,UAA8B,EAC9B,KAAwB;IAExB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAClD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,wBAAwB,EAAE,CAAC;YACvC,OAAO,KAAK,CAAC,CAAC,IAAI,YAAY,CAAC;gBAC9B,OAAO,EAAE,8BAA8B,IAAI,IAAI,IAAI,KAAK,wBAAwB,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,+BAA+B,EAAE;aACpI,CAAC,CAAC;QACJ,CAAC;I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,CAAC,CAAC,UAAU,CAAC;IAC3H,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QACjC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;IAChC,CAAC;AACF,CAAC,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality ci [--coverage]\n quality setup [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\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 quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.\nsetup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.\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 an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\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 JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\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.\n--coverage Collect V8 coverage and JUnit from ci's single test run into coverage/, including failed tests.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
1
+ export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality ci [--coverage]\n quality setup [--config <file>]\n quality fix [--config <file>] [--rule <id>]...\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\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 quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.\nsetup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.\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 an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\n With --rule, apply only that rule's safe mechanical fixes and report remaining findings (exit 1), including baseline debt. Unsupported rules exit 2.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\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 JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\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.\n--coverage Collect V8 coverage and JUnit from ci's single test run into coverage/, including failed tests.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
2
2
  export declare const SUBCOMMANDS: Readonly<Record<string, string>>;
3
3
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,oiGAsCwC,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxD,CAAC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,6tGAuCwC,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxD,CAAC"}
@@ -2,7 +2,7 @@ export const USAGE = `Usage:
2
2
  quality lint [--config <file>]
3
3
  quality ci [--coverage]
4
4
  quality setup [--config <file>]
5
- quality fix [--config <file>]
5
+ quality fix [--config <file>] [--rule <id>]...
6
6
  quality exceptions migrate [--config <file>] [--from <registry>]
7
7
  quality baseline merge <ancestor> <current> <other>
8
8
  quality baseline install-driver
@@ -20,6 +20,7 @@ setup Install the Quality hook when the current folder owns a .git e
20
20
  lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
21
21
  or a baseline entry for an unknown rule.
22
22
  fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
23
+ With --rule, apply only that rule's safe mechanical fixes and report remaining findings (exit 1), including baseline debt. Unsupported rules exit 2.
23
24
  exceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.
24
25
  baseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.
25
26
  baseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAsCqC,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC5D,QAAQ,EAAE,yEAAyE;IACnF,UAAU,EAAE,2BAA2B;IACvC,KAAK,EAAE,uDAAuD;CAC9D,CAAC"}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAuCqC,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC5D,QAAQ,EAAE,yEAAyE;IACnF,UAAU,EAAE,2BAA2B;IACvC,KAAK,EAAE,uDAAuD;CAC9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,yMAwClB,CAAC"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAYzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,yMAwClB,CAAC"}
@@ -5,6 +5,7 @@ import { parseCommand, USAGE } from "#cli/args.ts";
5
5
  import { writeBaseline } from "#cli/baseline.ts";
6
6
  import { ci } from "#cli/ci.ts";
7
7
  import { fix } from "#cli/fix.ts";
8
+ import { fixRule } from "#cli/fixRule.ts";
8
9
  import { lint } from "#cli/lint.ts";
9
10
  import { migrateBaseline } from "#cli/migrateBaseline.ts";
10
11
  import { migrateExceptions } from "#cli/migrateExceptions.ts";
@@ -31,7 +32,7 @@ export const program = Effect.fn("Cli.program")(function* (args, { cwd, launch }
31
32
  case "Lint":
32
33
  return yield* lint(cwd, command.config);
33
34
  case "Fix":
34
- return yield* fix(cwd, command.config);
35
+ return yield* command.rules.length === 0 ? fix(cwd, command.config) : fixRule(cwd, command.config, command.rules);
35
36
  case "BaselineMerge":
36
37
  return yield* mergeBaseline(command.base, command.ours, command.theirs);
37
38
  case "BaselineInstallDriver":
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAuB,EAAE,EAAE,GAAG,EAAE,MAAM,EAAc;IAC9G,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CA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AM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACpE,KAAK,mBAAmB;YACvB,OAAO,KAAK,CAAC,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACpE,KAAK,iBAAiB;YACrB,OAAO,KAAK,CAAC,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAClE,KAAK,cAAc;YAClB,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1F,KAAK,gBAAgB;YACpB,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAClC,KAAK,aAAa;YACjB,OAAO,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC/B,KAAK,gBAAgB;YACpB,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;AACF,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/quality",
3
- "version": "0.47.0",
3
+ "version": "0.48.1",
4
4
  "description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
5
5
  "homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
6
6
  "bugs": {
@@ -62,7 +62,7 @@
62
62
  "@effect/platform-node": "4.0.6",
63
63
  "@effect/platform-node-shared": "4.0.6",
64
64
  "@effect/vitest": "4.0.6",
65
- "@shivaedev/test-story": "0.25.1",
65
+ "@shivaedev/test-story": "0.26.3",
66
66
  "@types/node": "24.19.2",
67
67
  "@typescript/native": "npm:typescript@7.0.2",
68
68
  "effect": "4.0.6",
@@ -0,0 +1,116 @@
1
+ import ts from "typescript";
2
+ import type { SourceFile } from "#rule.ts";
3
+ import { parse } from "#rules/parse.ts";
4
+
5
+ interface Edit {
6
+ readonly end: number;
7
+ readonly start: number;
8
+ readonly text: string;
9
+ }
10
+
11
+ function unwrap(node: ts.Expression): ts.Expression {
12
+ return ts.isParenthesizedExpression(node) ? unwrap(node.expression) : node;
13
+ }
14
+
15
+ function conditionalChild(node: ts.Expression): ts.Expression | undefined {
16
+ const value = unwrap(node);
17
+ if (!(ts.isJsxElement(value) || ts.isJsxFragment(value))) {
18
+ return undefined;
19
+ }
20
+ if (ts.isJsxElement(value)) {
21
+ const { tagName, attributes } = value.openingElement;
22
+ if (!(ts.isIdentifier(tagName) && /^[a-z]/u.test(tagName.text)) || attributes.properties.length > 0) {
23
+ return undefined;
24
+ }
25
+ }
26
+ const children = value.children.filter((item) => !ts.isJsxText(item) || item.text.trim() !== "");
27
+ if (children.length !== 1) {
28
+ return undefined;
29
+ }
30
+ const child = children[0];
31
+ if (child !== undefined && (ts.isJsxElement(child) || ts.isJsxFragment(child))) {
32
+ return conditionalChild(child);
33
+ }
34
+ if (child === undefined || !ts.isJsxExpression(child) || child.expression === undefined) {
35
+ return undefined;
36
+ }
37
+ const expression = unwrap(child.expression);
38
+ return isConditional(expression) ? child.expression : undefined;
39
+ }
40
+
41
+ function isConditional(expression: ts.Expression): boolean {
42
+ return (
43
+ ts.isConditionalExpression(expression)
44
+ || (ts.isBinaryExpression(expression) && expression.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken)
45
+ );
46
+ }
47
+
48
+ function returnedExpression(node: ts.Node): ts.Expression | undefined {
49
+ if (ts.isReturnStatement(node)) {
50
+ return node.expression;
51
+ }
52
+ return ts.isArrowFunction(node) && !ts.isBlock(node.body) ? node.body : undefined;
53
+ }
54
+
55
+ function mapped(node: ts.Node): boolean {
56
+ return ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && node.expression.name.text === "map";
57
+ }
58
+
59
+ function manualDecision(node: ts.Node): boolean {
60
+ return (
61
+ (ts.isIdentifier(node) && node.text === "eval") || mapped(node) || ts.forEachChild(node, (child) => manualDecision(child) || undefined) === true
62
+ );
63
+ }
64
+
65
+ function returnText(source: ts.SourceFile, node: ts.Node, expression: ts.Expression, rendered: string): string {
66
+ if (ts.isReturnStatement(node)) {
67
+ return source.text.slice(node.getStart(source), expression.getStart(source)) + rendered + source.text.slice(expression.end, node.end);
68
+ }
69
+ return `return ${rendered};`;
70
+ }
71
+
72
+ export function fixJsxConditionals(file: SourceFile): string {
73
+ const parsed = parse(file);
74
+ if (parsed === undefined) {
75
+ return file.text;
76
+ }
77
+ const source = parsed;
78
+ const names = new Set<string>();
79
+ function namesIn(node: ts.Node): void {
80
+ if (ts.isIdentifier(node)) {
81
+ names.add(node.text);
82
+ }
83
+ ts.forEachChild(node, namesIn);
84
+ }
85
+ namesIn(source);
86
+ let name = "qualityContent";
87
+ for (let suffix = 1; names.has(name); suffix += 1) {
88
+ name = `qualityContent${suffix}`;
89
+ }
90
+ const edits: Edit[] = [];
91
+ function visit(node: ts.Node): void {
92
+ if (mapped(node)) {
93
+ return;
94
+ }
95
+ const expression = returnedExpression(node);
96
+ const child = expression === undefined ? undefined : conditionalChild(expression);
97
+ if (expression !== undefined && child !== undefined && !manualDecision(expression)) {
98
+ const rendered = file.text.slice(expression.getStart(source), child.getStart(source)) + name + file.text.slice(child.end, expression.end);
99
+ const start = ts.isReturnStatement(node) ? node.getStart(source) : expression.getStart(source);
100
+ const returned = returnText(source, node, expression, rendered);
101
+ edits.push({
102
+ end: ts.isReturnStatement(node) ? node.end : expression.end,
103
+ start,
104
+ text: `{ const ${name} = ${child.getText(source)}; ${returned} }`,
105
+ });
106
+ return;
107
+ }
108
+ ts.forEachChild(node, visit);
109
+ }
110
+ visit(source);
111
+ let text = file.text;
112
+ for (const edit of edits.toSorted((left, right) => right.start - left.start)) {
113
+ text = text.slice(0, edit.start) + edit.text + text.slice(edit.end);
114
+ }
115
+ return text;
116
+ }
@@ -2,6 +2,7 @@ import { posix } from "node:path";
2
2
  import { readPackageManifest } from "#adapters/manifestInventory.ts";
3
3
  import { exportedModule, exportTargets } from "#imports/packageExports.ts";
4
4
  import { packageOf, workspacePackages } from "#imports/workspace.ts";
5
+ import { isMigrationFile } from "#naming/migrationFile.ts";
5
6
  import type { RuleInputs } from "#rule.ts";
6
7
  import { KNIP_ISSUES } from "./findings.ts";
7
8
 
@@ -40,9 +41,15 @@ export async function knipConfiguration(inputs: RuleInputs) {
40
41
  (path) => bins.includes(path) || bins.includes(path.replace(/^src\//u, "dist/").replace(/\.(?<mode>[cm]?)tsx?$/u, ".$<mode>js")),
41
42
  );
42
43
  const publicFiles = sources.filter((path) => exportedModule(manifest.exports, path));
44
+ // Migration runners load these files from their directory, so no import reaches them.
45
+ const migrations = sources.filter((path) => isMigrationFile(posix.join(directory, path)));
43
46
  return [
44
47
  directory,
45
- { entry: [...ENTRIES, ...publicFiles, ...bins, ...binaries, ...scriptEntries], paths: importPaths(manifest.imports ?? {}), project: sources },
48
+ {
49
+ entry: [...ENTRIES, ...publicFiles, ...migrations, ...bins, ...binaries, ...scriptEntries],
50
+ paths: importPaths(manifest.imports ?? {}),
51
+ project: sources,
52
+ },
46
53
  ] as const;
47
54
  });
48
55
  return {
@@ -5,7 +5,9 @@ export function appViteConfig<TPlugin>(plugins: TPlugin[], conditions: string[]
5
5
  server: {
6
6
  host: "127.0.0.1",
7
7
  port: 5173,
8
- proxy: Object.fromEntries(["/api/auth", "/rpc", ...proxyPaths].map((path) => [path, { changeOrigin: false, target: "http://127.0.0.1:3000" }])),
8
+ proxy: Object.fromEntries(
9
+ ["/api/auth", "/rpc", ...proxyPaths].map((path) => [path, { changeOrigin: false, target: "http://127.0.0.1:3000", ws: path === "/rpc" }]),
10
+ ),
9
11
  strictPort: true,
10
12
  },
11
13
  };
package/src/cli/args.ts CHANGED
@@ -7,7 +7,7 @@ export type Command =
7
7
  | { readonly _tag: "Setup"; readonly config: string | undefined }
8
8
  | { readonly _tag: "Lint"; readonly config: string | undefined }
9
9
  | { readonly _tag: "ExceptionsMigrate"; readonly config: string | undefined; readonly from: string | undefined }
10
- | { readonly _tag: "Fix"; readonly config: string | undefined }
10
+ | { readonly _tag: "Fix"; readonly config: string | undefined; readonly rules: readonly string[] }
11
11
  | { readonly _tag: "BaselineMerge"; readonly base: string; readonly ours: string; readonly theirs: string }
12
12
  | { readonly _tag: "BaselineInstallDriver" }
13
13
  | { readonly _tag: "BaselineWrite"; readonly config: string | undefined; readonly rules: readonly string[] }
@@ -57,7 +57,7 @@ const ACCEPTS: Readonly<Record<string, readonly Option[]>> = {
57
57
  "baseline write": ["rule"],
58
58
  ci: ["coverage"],
59
59
  "exceptions migrate": ["from"],
60
- fix: [],
60
+ fix: ["rule"],
61
61
  "hooks install": ["force"],
62
62
  "hooks pre-commit": [],
63
63
  "hooks status": [],
@@ -88,7 +88,7 @@ function commandFor(name: string, values: Values): Parsed {
88
88
  case "exceptions migrate":
89
89
  return parsed({ _tag: "ExceptionsMigrate", config, from: values.from });
90
90
  case "fix":
91
- return parsed({ _tag: "Fix", config });
91
+ return parsed({ _tag: "Fix", config, rules: values.rule ?? [] });
92
92
  case "baseline install-driver":
93
93
  return parsed({ _tag: "BaselineInstallDriver" });
94
94
  case "baseline write":
@@ -0,0 +1,49 @@
1
+ import { join } from "node:path";
2
+ import { Console, Effect, FileSystem } from "effect";
3
+ import { fixJsxConditionals } from "#adapters/fixJsxConditionals.ts";
4
+ import { loadConfig } from "#config/load.ts";
5
+ import { scan } from "#engine/session.ts";
6
+ import { GateFailed, SetupFailure } from "#failure.ts";
7
+ import { collectInventory } from "#inventory/collect.ts";
8
+ import { plural } from "#report/plural.ts";
9
+ import type { RuleServices } from "#rule.ts";
10
+
11
+ const GROUPED =
12
+ "Consecutive assertions stop on the first failure; outcomes evaluates row expressions up front and reads every outcome before asserting. Rewrite these stories by hand to review that change in evaluation and failure order.";
13
+
14
+ export const fixRule = Effect.fn("Cli.fixRule")(function* (
15
+ cwd: string,
16
+ configPath: string | undefined,
17
+ rules: readonly string[],
18
+ ): Effect.fn.Return<void, SetupFailure | GateFailed, RuleServices> {
19
+ const config = yield* loadConfig(cwd, configPath);
20
+ for (const rule of rules) {
21
+ if (rule !== "react/jsx-conditionals") {
22
+ return yield* new SetupFailure({
23
+ message: `No safe mechanical fix for ${rule}.${rule === "tests/grouped-outcomes" ? ` ${GROUPED}` : " Repair its findings by hand."}`,
24
+ });
25
+ }
26
+ }
27
+ const fs = yield* FileSystem.FileSystem;
28
+ const inventory = yield* collectInventory(config.root, config).pipe(
29
+ Effect.mapError((cause) => new SetupFailure({ cause, message: cause.message })),
30
+ );
31
+ let changed = 0;
32
+ for (const file of inventory.sources) {
33
+ const text = fixJsxConditionals(file);
34
+ if (text !== file.text) {
35
+ yield* fs
36
+ .writeFileString(join(config.root, file.path), text)
37
+ .pipe(Effect.mapError((cause) => new SetupFailure({ cause, message: cause.message })));
38
+ changed += 1;
39
+ }
40
+ }
41
+ yield* Console.log(`quality: react/jsx-conditionals rewrote ${plural(changed, "file")}.`);
42
+ const remaining = (yield* scan({ ...config, active: config.active.filter((rule) => rules.includes(rule.id)) })).violations;
43
+ for (const finding of remaining) {
44
+ yield* Console.log(`${finding.file}:${finding.line ?? 1} ${finding.rule}: ${finding.message}`);
45
+ }
46
+ if (remaining.length > 0) {
47
+ return yield* new GateFailed();
48
+ }
49
+ });
@@ -2,7 +2,7 @@ export const USAGE = `Usage:
2
2
  quality lint [--config <file>]
3
3
  quality ci [--coverage]
4
4
  quality setup [--config <file>]
5
- quality fix [--config <file>]
5
+ quality fix [--config <file>] [--rule <id>]...
6
6
  quality exceptions migrate [--config <file>] [--from <registry>]
7
7
  quality baseline merge <ancestor> <current> <other>
8
8
  quality baseline install-driver
@@ -20,6 +20,7 @@ setup Install the Quality hook when the current folder owns a .git e
20
20
  lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
21
21
  or a baseline entry for an unknown rule.
22
22
  fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
23
+ With --rule, apply only that rule's safe mechanical fixes and report remaining findings (exit 1), including baseline debt. Unsupported rules exit 2.
23
24
  exceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.
24
25
  baseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.
25
26
  baseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.
@@ -5,6 +5,7 @@ import { parseCommand, USAGE } from "#cli/args.ts";
5
5
  import { writeBaseline } from "#cli/baseline.ts";
6
6
  import { ci } from "#cli/ci.ts";
7
7
  import { fix } from "#cli/fix.ts";
8
+ import { fixRule } from "#cli/fixRule.ts";
8
9
  import { lint } from "#cli/lint.ts";
9
10
  import { migrateBaseline } from "#cli/migrateBaseline.ts";
10
11
  import { migrateExceptions } from "#cli/migrateExceptions.ts";
@@ -38,7 +39,7 @@ export const program = Effect.fn("Cli.program")(function* (args: readonly string
38
39
  case "Lint":
39
40
  return yield* lint(cwd, command.config);
40
41
  case "Fix":
41
- return yield* fix(cwd, command.config);
42
+ return yield* command.rules.length === 0 ? fix(cwd, command.config) : fixRule(cwd, command.config, command.rules);
42
43
  case "BaselineMerge":
43
44
  return yield* mergeBaseline(command.base, command.ours, command.theirs);
44
45
  case "BaselineInstallDriver":