@shivaedev/quality 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +98 -38
- package/biome/declarations.json +6 -1
- package/biome/plugins/ambient-runtime.grit +3 -1
- package/biome/preset.json +62 -62
- package/dist/adapters/knip/configuration.d.ts +29 -0
- package/dist/adapters/knip/configuration.d.ts.map +1 -0
- package/dist/adapters/knip/configuration.js +56 -0
- package/dist/adapters/knip/configuration.js.map +1 -0
- package/dist/adapters/knip/entryPointFindings.d.ts +3 -0
- package/dist/adapters/knip/entryPointFindings.d.ts.map +1 -0
- package/dist/adapters/knip/entryPointFindings.js +49 -0
- package/dist/adapters/knip/entryPointFindings.js.map +1 -0
- package/dist/adapters/knip/findings.d.ts +4 -0
- package/dist/adapters/knip/findings.d.ts.map +1 -0
- package/dist/adapters/knip/findings.js +40 -0
- package/dist/adapters/knip/findings.js.map +1 -0
- package/dist/adapters/knip/run.d.ts +3 -0
- package/dist/adapters/knip/run.d.ts.map +1 -0
- package/dist/adapters/knip/run.js +46 -0
- package/dist/adapters/knip/run.js.map +1 -0
- package/dist/adapters/knip/sourceConfig.d.ts +4 -0
- package/dist/adapters/knip/sourceConfig.d.ts.map +1 -0
- package/dist/adapters/knip/sourceConfig.js +15 -0
- package/dist/adapters/knip/sourceConfig.js.map +1 -0
- package/dist/biome/recognizeDiagnostics.js +2 -2
- package/dist/biome/recognizeDiagnostics.js.map +1 -1
- package/dist/docs/documentedImports.d.ts +12 -0
- package/dist/docs/documentedImports.d.ts.map +1 -0
- package/dist/docs/documentedImports.js +80 -0
- package/dist/docs/documentedImports.js.map +1 -0
- package/dist/docs/documentedModule.d.ts +11 -0
- package/dist/docs/documentedModule.d.ts.map +1 -0
- package/dist/docs/documentedModule.js +32 -0
- package/dist/docs/documentedModule.js.map +1 -0
- package/dist/docs/exportsName.d.ts +2 -0
- package/dist/docs/exportsName.d.ts.map +1 -0
- package/dist/docs/exportsName.js +25 -0
- package/dist/docs/exportsName.js.map +1 -0
- package/dist/docs/headingAnchors.d.ts +4 -0
- package/dist/docs/headingAnchors.d.ts.map +1 -0
- package/dist/docs/headingAnchors.js +43 -0
- package/dist/docs/headingAnchors.js.map +1 -0
- package/dist/docs/importFindings.d.ts +12 -0
- package/dist/docs/importFindings.d.ts.map +1 -0
- package/dist/docs/importFindings.js +36 -0
- package/dist/docs/importFindings.js.map +1 -0
- package/dist/docs/isDocument.d.ts +2 -0
- package/dist/docs/isDocument.d.ts.map +1 -0
- package/dist/docs/isDocument.js +6 -0
- package/dist/docs/isDocument.js.map +1 -0
- package/dist/docs/linkFindings.d.ts +12 -0
- package/dist/docs/linkFindings.d.ts.map +1 -0
- package/dist/docs/linkFindings.js +59 -0
- package/dist/docs/linkFindings.js.map +1 -0
- package/dist/docs/markdownLines.d.ts +11 -0
- package/dist/docs/markdownLines.d.ts.map +1 -0
- package/dist/docs/markdownLines.js +38 -0
- package/dist/docs/markdownLines.js.map +1 -0
- package/dist/docs/markdownLinks.d.ts +7 -0
- package/dist/docs/markdownLinks.d.ts.map +1 -0
- package/dist/docs/markdownLinks.js +23 -0
- package/dist/docs/markdownLinks.js.map +1 -0
- package/dist/docs/repositoryLink.d.ts +11 -0
- package/dist/docs/repositoryLink.d.ts.map +1 -0
- package/dist/docs/repositoryLink.js +28 -0
- package/dist/docs/repositoryLink.js.map +1 -0
- package/dist/imports/fences/compilePolicy.d.ts.map +1 -1
- package/dist/imports/fences/compilePolicy.js +1 -1
- package/dist/imports/fences/compilePolicy.js.map +1 -1
- package/dist/imports/fences/match.d.ts +1 -1
- package/dist/imports/fences/match.d.ts.map +1 -1
- package/dist/imports/fences/match.js +1 -1
- package/dist/imports/fences/match.js.map +1 -1
- package/dist/imports/packageExports.d.ts +1 -0
- package/dist/imports/packageExports.d.ts.map +1 -1
- package/dist/imports/packageExports.js +7 -5
- package/dist/imports/packageExports.js.map +1 -1
- package/dist/imports/packageName.d.ts +4 -0
- package/dist/imports/packageName.d.ts.map +1 -0
- package/dist/imports/packageName.js +25 -0
- package/dist/imports/packageName.js.map +1 -0
- package/dist/imports/resolve.d.ts +0 -2
- package/dist/imports/resolve.d.ts.map +1 -1
- package/dist/imports/resolve.js +1 -24
- package/dist/imports/resolve.js.map +1 -1
- package/dist/inventory/collect.d.ts +0 -1
- package/dist/inventory/collect.d.ts.map +1 -1
- package/dist/inventory/collect.js +1 -4
- package/dist/inventory/collect.js.map +1 -1
- package/dist/inventory/linesOf.d.ts +2 -0
- package/dist/inventory/linesOf.d.ts.map +1 -0
- package/dist/inventory/linesOf.js +5 -0
- package/dist/inventory/linesOf.js.map +1 -0
- package/dist/rules/builtIn.d.ts +2 -2
- package/dist/rules/builtIn.d.ts.map +1 -1
- package/dist/rules/builtIn.js +12 -0
- package/dist/rules/builtIn.js.map +1 -1
- package/dist/rules/docs/references.d.ts +2 -0
- package/dist/rules/docs/references.d.ts.map +1 -0
- package/dist/rules/docs/references.js +66 -0
- package/dist/rules/docs/references.js.map +1 -0
- package/dist/rules/docs/unversionedInstalls.d.ts +2 -0
- package/dist/rules/docs/unversionedInstalls.d.ts.map +1 -0
- package/dist/rules/docs/unversionedInstalls.js +36 -0
- package/dist/rules/docs/unversionedInstalls.js.map +1 -0
- package/dist/rules/effect/boundary.d.ts +2 -0
- package/dist/rules/effect/boundary.d.ts.map +1 -0
- package/dist/rules/effect/boundary.js +66 -0
- package/dist/rules/effect/boundary.js.map +1 -0
- package/dist/rules/effect/layerConstructor.d.ts +3 -0
- package/dist/rules/effect/layerConstructor.d.ts.map +1 -0
- package/dist/rules/effect/layerConstructor.js +35 -0
- package/dist/rules/effect/layerConstructor.js.map +1 -0
- package/dist/rules/effect/ownsParameters.d.ts +3 -0
- package/dist/rules/effect/ownsParameters.d.ts.map +1 -0
- package/dist/rules/effect/ownsParameters.js +45 -0
- package/dist/rules/effect/ownsParameters.js.map +1 -0
- package/dist/rules/effect/program.d.ts +4 -0
- package/dist/rules/effect/program.d.ts.map +1 -0
- package/dist/rules/effect/program.js +24 -0
- package/dist/rules/effect/program.js.map +1 -0
- package/dist/rules/effect/publicFunctions.d.ts +3 -0
- package/dist/rules/effect/publicFunctions.d.ts.map +1 -0
- package/dist/rules/effect/publicFunctions.js +68 -0
- package/dist/rules/effect/publicFunctions.js.map +1 -0
- package/dist/rules/effect/serviceCatalog.d.ts +8 -0
- package/dist/rules/effect/serviceCatalog.d.ts.map +1 -0
- package/dist/rules/effect/serviceCatalog.js +56 -0
- package/dist/rules/effect/serviceCatalog.js.map +1 -0
- package/dist/rules/effect/serviceFindings.d.ts +5 -0
- package/dist/rules/effect/serviceFindings.d.ts.map +1 -0
- package/dist/rules/effect/serviceFindings.js +88 -0
- package/dist/rules/effect/serviceFindings.js.map +1 -0
- package/dist/rules/effect/serviceOrigin.d.ts +3 -0
- package/dist/rules/effect/serviceOrigin.d.ts.map +1 -0
- package/dist/rules/effect/serviceOrigin.js +85 -0
- package/dist/rules/effect/serviceOrigin.js.map +1 -0
- package/dist/rules/effect/serviceParameters.d.ts +2 -0
- package/dist/rules/effect/serviceParameters.d.ts.map +1 -0
- package/dist/rules/effect/serviceParameters.js +33 -0
- package/dist/rules/effect/serviceParameters.js.map +1 -0
- package/dist/rules/effect/serviceTypes.d.ts +8 -0
- package/dist/rules/effect/serviceTypes.d.ts.map +1 -0
- package/dist/rules/effect/serviceTypes.js +94 -0
- package/dist/rules/effect/serviceTypes.js.map +1 -0
- package/dist/rules/files/folderNames.js +2 -2
- package/dist/rules/files/folderNames.js.map +1 -1
- package/dist/rules/imports/manifest.js +1 -1
- package/dist/rules/imports/manifest.js.map +1 -1
- package/dist/rules/imports/runtime.js +1 -1
- package/dist/rules/imports/runtime.js.map +1 -1
- package/dist/rules/react/jsxConditionals.d.ts +2 -0
- package/dist/rules/react/jsxConditionals.d.ts.map +1 -0
- package/dist/rules/react/jsxConditionals.js +54 -0
- package/dist/rules/react/jsxConditionals.js.map +1 -0
- package/dist/rules/stories/engineOf.d.ts.map +1 -1
- package/dist/rules/stories/engineOf.js +2 -1
- package/dist/rules/stories/engineOf.js.map +1 -1
- package/dist/rules/stories/namedValues.js +4 -4
- package/dist/rules/stories/namedValues.js.map +1 -1
- package/dist/rules/stories/unitTests.js +1 -1
- package/dist/rules/stories/unitTests.js.map +1 -1
- package/dist/rules/unusedCode.d.ts +2 -0
- package/dist/rules/unusedCode.d.ts.map +1 -0
- package/dist/rules/unusedCode.js +9 -0
- package/dist/rules/unusedCode.js.map +1 -0
- package/docs/debt-and-hooks.md +0 -1
- package/docs/north-star.md +1 -1
- package/package.json +5 -4
- package/src/adapters/knip/configuration.ts +66 -0
- package/src/adapters/knip/entryPointFindings.ts +54 -0
- package/src/adapters/knip/findings.ts +46 -0
- package/src/adapters/knip/run.ts +60 -0
- package/src/adapters/knip/sourceConfig.ts +20 -0
- package/src/biome/recognizeDiagnostics.ts +2 -2
- package/src/docs/documentedImports.ts +104 -0
- package/src/docs/documentedModule.ts +44 -0
- package/src/docs/exportsName.ts +27 -0
- package/src/docs/headingAnchors.ts +52 -0
- package/src/docs/importFindings.ts +62 -0
- package/src/docs/isDocument.ts +6 -0
- package/src/docs/linkFindings.ts +90 -0
- package/src/docs/markdownLines.ts +56 -0
- package/src/docs/markdownLinks.ts +33 -0
- package/src/docs/repositoryLink.ts +44 -0
- package/src/imports/fences/compilePolicy.ts +2 -1
- package/src/imports/fences/match.ts +2 -1
- package/src/imports/packageExports.ts +8 -5
- package/src/imports/packageName.ts +31 -0
- package/src/imports/resolve.ts +1 -31
- package/src/inventory/collect.ts +1 -5
- package/src/inventory/linesOf.ts +4 -0
- package/src/rules/builtIn.ts +12 -0
- package/src/rules/docs/references.ts +83 -0
- package/src/rules/docs/unversionedInstalls.ts +53 -0
- package/src/rules/effect/boundary.ts +75 -0
- package/src/rules/effect/layerConstructor.ts +40 -0
- package/src/rules/effect/ownsParameters.ts +46 -0
- package/src/rules/effect/program.ts +26 -0
- package/src/rules/effect/publicFunctions.ts +70 -0
- package/src/rules/effect/serviceCatalog.ts +57 -0
- package/src/rules/effect/serviceFindings.ts +96 -0
- package/src/rules/effect/serviceOrigin.ts +94 -0
- package/src/rules/effect/serviceParameters.ts +35 -0
- package/src/rules/effect/serviceTypes.ts +101 -0
- package/src/rules/files/folderNames.ts +2 -2
- package/src/rules/imports/manifest.ts +1 -1
- package/src/rules/imports/runtime.ts +1 -1
- package/src/rules/react/jsxConditionals.ts +59 -0
- package/src/rules/stories/engineOf.ts +2 -1
- package/src/rules/stories/namedValues.ts +4 -4
- package/src/rules/stories/unitTests.ts +1 -1
- package/src/rules/unusedCode.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.44.0 - 2026-10-29
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `docs/documentedImports.ts` exports `documentedImports`, which reads the workspace modules and named imports a Markdown document references from its code blocks, inline module paths, `name` from `module` phrases and a package README's API rows, with the line of each.
|
|
8
|
+
- Report unused files, exports and package dependencies, and missing dependencies with the knip-backed `code/unused` rule. Package exports, binaries, scripts, tests, stories and test support supply entry points without a knip config. Run `quality baseline write --rule code/unused` to record existing findings, then remove debt and run `quality baseline tighten` as you repair it.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Keep the minimal generated app on the unused-code gate with its own baseline of existing template debt.
|
|
13
|
+
|
|
14
|
+
### Breaking
|
|
15
|
+
|
|
16
|
+
- Repositories get new findings from `docs/references` for Markdown links, heading anchors, links into the repository's own GitHub tree, relative links that leave a published package's README, and documented workspace modules or named imports that do not resolve. Fix the reference, or record existing findings with `quality baseline write --rule docs/references`.
|
|
17
|
+
- Repositories get new findings from `docs/unversioned-installs` for a version after a package name in a Markdown install command. Name the package alone, or record existing findings with `quality baseline write --rule docs/unversioned-installs`.
|
|
18
|
+
- `linesOf` moves from `inventory/collect.ts` to `inventory/linesOf.ts`: change the import path.
|
|
19
|
+
- `builtinName` and `packageNameOf` move from `imports/resolve.ts` to `imports/packageName.ts`: change the import path.
|
|
20
|
+
|
|
21
|
+
## 0.43.0 - 2026-10-28
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- The application host provides Effect's native Crypto service during preflight and deferred construction as well as in application handlers, so commands can generate secure invite codes without ambient randomness.
|
|
26
|
+
- Story kits provide native TestCrypto with a fresh seed of 0 for each story, making generated invite codes reproducible. The application’s @effect/platform-node peer supplies its digest implementation.
|
|
27
|
+
- Ambient-randomness findings name Effect's Crypto service for secure values and Random for non-secure values.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Keep Biome's `useIncludes` findings while disabling its automatic fix, so formatting leaves `indexOf` comparisons for developers to change by hand.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- Enforce declared query read policies at the hosted RPC handler boundary, including contracts without identity middleware, whose viewer is anonymous. Query RPC error schemas include `QueryReadDenied` so native clients receive typed refusals before handlers run.
|
|
36
|
+
- Keep collection methods and untyped schema internals from making data parameters appear to carry callable services. Direct service implementations, nested dependency fields and service arrays remain subject to `effect/service-parameters`.
|
|
37
|
+
- Pure unit tests can import `effect/http/HttpStatus` without being reported as network I/O; HTTP client imports still require a story.
|
|
38
|
+
- Recognize service implementation parameters by their declared service shape instead of incidental assignability to a discovered service. Ordinary atoms, schemas, records and tuples no longer count as services; service tags, class instances, implementation shapes and non-empty Contexts remain checked.
|
|
39
|
+
|
|
40
|
+
### Breaking
|
|
41
|
+
|
|
42
|
+
- Enforce `effect/boundary` across source, tooling and specs: async, await, new Promise, .then, try and throw belong only in `adapters/` and `test-support/` folders at any depth. Use Effect and tagged failures elsewhere. The fixed `adapters/` convention bridges outside libraries to Effect values without consumer configuration.
|
|
43
|
+
- Enforce `effect/service-parameters`: exported functions and public methods read services from Effect's environment, including aliased and wrapped implementation shapes. Effect and Stream requirements, service implementation methods and Layer constructors are accepted; only `test-support/` is exempt. Adapters still follow this rule and ambient runtime bans. Both rules refuse config exceptions and inline suppressions. Consumers adopting the upgrade record existing debt with `quality baseline write --rule effect/boundary` and `quality baseline write --rule effect/service-parameters`.
|
|
44
|
+
- Apps get new findings from `react/jsx-conditionals` for `&&` and ternaries in JSX children. Decide before the JSX with early returns or a precomputed variable, or extract a component that returns `null`; inside `.map`, extract an item component. Attribute values remain accepted. Record existing findings with `quality baseline write --rule react/jsx-conditionals`. The shared Biome preset turns off `noLeakedRender`, whose ternary repair is also reported by the new rule.
|
|
45
|
+
- Move key imports from `@shivaedev/contract/keys.ts` to `@shivaedev/changes/keys.ts`. Declare bucket fields with `collection(name, idSchema, fields)` and publish affected buckets alongside record keys.
|
|
46
|
+
- Replace collection policy maps, `mergeReadPolicies`, `ReadPolicy` and `ReadPolicyMemoWindow` with each query's `readPolicy(payload, viewer)`. Declare the same query's live scope with `reads(payload, viewer)`. Bound query atoms and subscriptions refuse missing policies with a declaration error; one-off query `run` calls remain available. Denied queries refuse the entire subscription. Server adapters replace `QueryReads` and `ChangesReads` with `QueryDefinition` and `ChangesQueries`. Custom middleware calls `authorizeReads(effect, request, viewer)` and declares `MissingReadPolicy` and `QueryReadDenied` errors.
|
|
47
|
+
- Custom subscription adapters yield `ChangesQueries.resolve(references)`, call `querySubscription(requests, viewer)` and pass the authorized result to `makeLiveServer.subscribe(subscription, context)`. Metadata values expose `QueryDefinition.definition` and `CommandInvalidation.invalidates` instead of bare definitions and callbacks. Yield the Effect returned by `queryKeys(queries, references)` when projecting keys for a custom stream. `resolveChanges` supplies the authorized subscription in hosted applications. Changed hints can carry query positions so bindings can rerun session-scoped reads without deriving session scopes in the browser.
|
|
48
|
+
- Remove `appHost`'s `readPolicy` option and module policy registration. Session and permission middleware apply query policies using the current session viewer. Handle the new typed policy errors in native clients, including `QueryReadDenied` on query RPCs without identity middleware; widen explicit query error annotations accordingly.
|
|
49
|
+
- Replace `sessionCommandChanges` with `commandChanges` for custom session middleware. Command invalidation callbacks can receive the session viewer as their third argument. Announce viewer buckets there; background writers must explicitly publish those bucket keys after commit.
|
|
50
|
+
- Built-in admin queries declare their permission policies alongside their schemas and read scopes. Consumers keep supplying the existing session and permission middleware layers.
|
|
51
|
+
- Local Work Board and Fleet queries declare their existing loopback read access explicitly so their generated live subscriptions remain available.
|
|
52
|
+
- Bare HTTP status literals in tests are now reported by `tests/named-values`. Import `HttpStatus` from `effect/http/HttpStatus` and write `HttpStatus.fromLiteral("NotFound")` instead of `404`. Subjects named `status` or `code` no longer exempt numeric assertions; process `exitCode` literals remain accepted.
|
|
53
|
+
|
|
3
54
|
## 0.42.0 - 2026-10-27
|
|
4
55
|
|
|
5
56
|
### Added
|
package/README.md
CHANGED
|
@@ -21,7 +21,6 @@ Adopt Quality's policy as a whole. Quality owns the shared rules, their defaults
|
|
|
21
21
|
A **rule** checks a repository and returns **findings**, each naming a file and what to change. Built-in and local rules always run at `error`. A finding normally counts once; a limit rule counts how far the file exceeds its limit. Use the defaults and keep checks strict. The config rejects warning levels, disabled rules, raised thresholds and inventory exclusions.
|
|
22
22
|
|
|
23
23
|
Two records explain findings the repository deliberately keeps:
|
|
24
|
-
|
|
25
24
|
- The **baseline** records existing debt by rule and file, as a maximum count. It makes strict checks usable before every file is cleaned up. `tighten` and `prune` lower the counts as debt disappears; explicitly writing a named rule again can raise them, and that diff needs review.
|
|
26
25
|
- The config's **exceptions** list records permanent exceptions once, each with files, rules, a reason and optionally a Quality finding's `subject`. One declaration covers both Quality and Biome rules. A rule may refuse exceptions. An entry that no longer applies fails the gate instead of silently excusing future code.
|
|
27
26
|
|
|
@@ -29,6 +28,16 @@ Exceptions apply first, then the baseline. With the default rule settings, remai
|
|
|
29
28
|
|
|
30
29
|
The work has three parts: connect the repository to the shared tools once; describe an import boundary when its architecture needs one; run the gate and repair findings every day. Writing local rules is not an adoption requirement.
|
|
31
30
|
|
|
31
|
+
### Effect boundaries and services
|
|
32
|
+
|
|
33
|
+
`effect/boundary` checks every TypeScript or JavaScript source in Quality's inventory, including shipped code, tooling and specs. It reports async functions, methods and arrows, await (including `for await`), `new Promise(...)`, `.then(...)`, try statements and throw statements. Model the work with Effect, fail with a tagged error, and use `Effect.die` for defects. Effect's resource and finalizer primitives model cleanup.
|
|
34
|
+
|
|
35
|
+
Only folders named `adapters/` or `test-support/`, at any depth, are exempt from this boundary rule. An `adapters/` folder bridges an outside library and hands the rest of the application Effect values. The name is fixed by convention, with no config or copied Biome plugin globs. Code that cannot be Effect belongs in that bridge or calls for a better Effect primitive. Adapter code still follows `effect/service-parameters` and the ambient time, randomness, console and environment bans.
|
|
36
|
+
|
|
37
|
+
`effect/service-parameters` reports parameters carrying a service in exported functions and public methods, including returned factories. It follows service classes and tags, non-empty Contexts and service implementation shapes through aliases, interfaces, generic constraints, inferred parameters and destructuring. Read services from Effect's environment instead. An Effect or Stream requiring a service is a computation and is accepted. Methods implementing a service and functions constructing Layers may take services as parameters. Only `test-support/` folders are exempt from this rule; `adapters/` folders are checked.
|
|
38
|
+
|
|
39
|
+
Both rules refuse config exceptions and inline suppressions. Record existing debt with `quality baseline write --rule effect/boundary` and `quality baseline write --rule effect/service-parameters`; the normal report and baseline burn-down apply.
|
|
40
|
+
|
|
32
41
|
### 1. Once per repository: connect the shared policy
|
|
33
42
|
|
|
34
43
|
A new repository needs no `quality.config.ts`. Quality checks sources from the current directory with every built-in rule at its default error level. Baseline entries for `packages/<package>/...` live in `packages/<package>/quality-baseline.jsonl`; entries outside packages live in the root `quality-baseline.jsonl`. A package with no entries has no shard file. Permanent exceptions belong in `quality.config.ts`.
|
|
@@ -104,7 +113,7 @@ An app says where its code runs through folder names. A package adopts the runti
|
|
|
104
113
|
|
|
105
114
|
A package whose code all runs in one runtime declares it in its manifest instead of nesting everything in one folder: `"quality": { "runtime": "server" }` makes every source file server code, and `"client"` makes every file browser code. Package-root tooling stays server code. A declaration beside `src/client/` or `src/server/` is reported on the manifest, as is any value other than `"client"` or `"server"`; choose one convention per package.
|
|
106
115
|
|
|
107
|
-
A package with a nonempty `bin` entry and no runtime folders is server code throughout. Runtime folders take precedence when a package also ships browser code. A Node library without a CLI declares `"runtime": "server"` or uses `src/server/`; `engines.node` alone does not say that a package is Node-only.
|
|
116
|
+
A package with a nonempty `bin` entry and no runtime folders is server code throughout. Runtime folders take precedence when a package also ships browser code. A Node library without a CLI declares `"runtime": "server"` or uses `src/server/`; `engines.node` alone does not say that a package is Node-only. A package with no runtime folders, runtime declaration or `bin` entry has no runtime policy beyond its tooling. Explicit fences run in every package. Runtime folders are detected independently of `sources`, including empty folders; `sources` still selects the code that is checked.
|
|
108
117
|
|
|
109
118
|
Tooling is server code in every package, including the workspace root: files under its top-level `script/`, `scripts/` and `tooling/` folders, and top-level JavaScript or TypeScript config files such as `vitest.config.ts`. A tooling folder or config file nested under `src/` follows the source runtime policy. Browser and shared code cannot import package-root tooling.
|
|
110
119
|
|
|
@@ -112,7 +121,7 @@ The manifest owns ordinary workspace dependencies. An **application** is a packa
|
|
|
112
121
|
|
|
113
122
|
When a package promises more, put `quality.fences.config.ts` beside its `package.json`, exporting an array of fences as the default. Quality discovers this file at the repository root and in workspace packages, even when `sources` includes only their source folders. The root config does not list boundary files.
|
|
114
123
|
|
|
115
|
-
A **fence** is a prohibition on imports, with a reason and one illegal and one legal example. Quality validates all discovered fences together, so duplicate names or contradictory examples stop the run. An unreadable file or invalid default export also stops the run.
|
|
124
|
+
A **fence** is a prohibition on imports, with a reason and one illegal and one legal example. Quality validates all discovered fences together, so duplicate names or contradictory examples stop the run. An unreadable file or invalid default export also stops the run. The `imports/fences` rule checks them with Quality's shared import graph, resolver and report.
|
|
116
125
|
|
|
117
126
|
```ts
|
|
118
127
|
import { fence } from "@shivaedev/quality/imports/fence.ts";
|
|
@@ -130,7 +139,7 @@ const uiBoundary = fence("ui-never-imports-server")
|
|
|
130
139
|
export default [uiBoundary];
|
|
131
140
|
```
|
|
132
141
|
|
|
133
|
-
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root.
|
|
142
|
+
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Use real checked files and workspace package names in these chains. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
|
|
134
143
|
|
|
135
144
|
The import rules resolve every literal specifier the way the TypeScript compiler does, with the nearest `tsconfig.json`, and stop the run when the sources hold no module at all. A relative or `#` import of a file that a generator writes before the tests run resolves only inside a folder that `imports/resolvable` lists as `generated`; the folder, or every file an import names in it, must be ignored by git:
|
|
136
145
|
|
|
@@ -158,7 +167,7 @@ Every package tests its real engine through its own story kit, so setup and acti
|
|
|
158
167
|
|
|
159
168
|
Quality's `tests/story-setup` rule reports top-level test functions named with the words `seed`, `make`, `build` or `setup`, and fixture-writing calls imported from Node's `fs` or `fs/promises`. It leaves source and `test-support/` files alone. This is a check for those syntax patterns; a passing test file still needs review of what it tests.
|
|
160
169
|
|
|
161
|
-
Specs keep expectations visible. `tests/spec-helpers` moves all module-level helper functions out of specs and into the kit; `tests/no-expect-in-support` moves `expect` calls into the spec, except in test-support files that register tests at module top level and are not imported by any module, so nested Vitest runs can execute them as test files with real assertions. `tests/named-values` rejects numeric literals passed to `toBe` or `toHaveLength` in specs, except zero and
|
|
170
|
+
Specs keep expectations visible. `tests/spec-helpers` moves all module-level helper functions out of specs and into the kit; `tests/no-expect-in-support` moves `expect` calls into the spec, except in test-support files that register tests at module top level and are not imported by any module, so nested Vitest runs can execute them as test files with real assertions. `tests/named-values` rejects numeric literals passed to `toBe` or `toHaveLength` in specs, except zero and process exit codes asserted on an `exitCode` subject: assert the observed items or use a domain name that comes from the story's inputs or the product. For HTTP statuses, import `* as HttpStatus` from `effect/http/HttpStatus` and use `HttpStatus.fromLiteral("NotFound")`; subjects named `status` or `code` do not exempt numeric assertions. A spec-local numeric const that only feeds these matchers is reported, including aliases for zero and codes. `tests/no-limit-imports` rejects importing `MAX_*` constants from a `limits` module into specs, so a story proves behavior instead of copying an implementation cap.
|
|
162
171
|
|
|
163
172
|
`boundaries/queue-sql` rejects SQL mentioning the private `pgboss.` schema. Apps use their queue definitions and let workers process jobs; there is no queue-purge API by design. `boundaries/auth-sql` rejects SQL accessing Better Auth's `user`, `account`, `session` and `verification` tables. Apps use platform's auth API; `options.owners` names platform's own auth implementation and its migrations. These rules inspect SQL templates, literal query calls and query variables, and inventoried `.sql` files. They do not evaluate arbitrary runtime SQL construction.
|
|
164
173
|
|
|
@@ -199,7 +208,7 @@ When a Quality upgrade adds a check, or a reviewed change needs to record one ru
|
|
|
199
208
|
quality baseline write --rule tests/story-setup
|
|
200
209
|
```
|
|
201
210
|
|
|
202
|
-
Keep the default error level. The command replaces that rule's entries and leaves other rules' entries alone.
|
|
211
|
+
Keep the default error level. The command replaces that rule's entries and leaves other rules' entries alone. Call out any new or raised count in the review and the pull request description. The [debt and hook guide](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md) covers the baseline format, exception subjects, limit changes, renames and commit checks.
|
|
203
212
|
|
|
204
213
|
### Baseline merges
|
|
205
214
|
|
|
@@ -210,49 +219,103 @@ Register the driver in `.gitattributes`:
|
|
|
210
219
|
/packages/*/quality-baseline.jsonl merge=quality-baseline
|
|
211
220
|
```
|
|
212
221
|
|
|
213
|
-
Run `quality baseline install-driver` from your checkout's setup script. It sets only repository-local `merge.quality-baseline.driver`; it leaves other Git settings alone.
|
|
222
|
+
Run `quality baseline install-driver` from your checkout's setup script. It sets only repository-local `merge.quality-baseline.driver`; it leaves other Git settings alone. Each checkout needs the setting because Git does not copy local configuration when cloning.
|
|
214
223
|
|
|
215
224
|
Git calls `quality baseline merge <ancestor> <current> <other>`. Entries are keyed by path and rule. Removing an ancestor entry on either side removes it from the result; retained counts take the minimum of the two sides, and entries newly added on either side survive. The command writes the result to `<current>`, so parallel reductions of neighbouring entries merge without a text conflict.
|
|
216
225
|
|
|
226
|
+
### Unused code
|
|
227
|
+
|
|
228
|
+
`code/unused` uses knip to report unused files, value and type exports, unused dependencies (including development and optional peer dependencies), and imports missing from the package manifest in every workspace. It runs through `quality lint` and the normal report and baseline. The rule accepts no options or permanent exceptions; Quality supplies knip’s entry points without a repository knip config.
|
|
229
|
+
|
|
230
|
+
Package `exports` are public API, including wildcard targets and source conditions. Package `bin` and scripts, test and story globs, tool configs and `src/test-support` provide the other entry points. Imports reachable from those entries count as used. Source-conditioned package import aliases resolve to their sources before a build. Compiler mappings from `tsconfig.json` and `tsconfig.build.json` keep imports on their source files when build output exists. An internal module can be used while one of its exports remains unused. An application’s declared dependency entry points satisfy provided imports under the same policy as `imports/manifest`.
|
|
231
|
+
|
|
232
|
+
For adoption, run `quality baseline write --rule code/unused` and review the recorded debt. Burn it down by deleting unused code, removing unused dependency declarations, declaring missing dependencies, or connecting code to a real entry point. Run `quality baseline tighten` after repairs, or `quality baseline prune` across the repository. Do not add an entry point just to hide dead code.
|
|
233
|
+
|
|
217
234
|
### What the rules check
|
|
218
235
|
|
|
219
236
|
`quality lint` prints each failing rule's guidance with its findings, so the finding is the reference for what to change. The built-in rules fall into these groups:
|
|
220
|
-
|
|
221
237
|
- **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules. The preset rejects every re-export, types included; when `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
|
|
222
238
|
- **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
|
|
239
|
+
- **Documentation:** `docs/references` checks every Markdown file in the sources except `CHANGELOG.md`, whose released history keeps the links of its release. Relative links, reference definitions and `href`/`src` attributes reach an existing file or folder inside the repository, and a heading anchor matches one GitHub forms from the target's headings. A link to the repository's own GitHub tree, named by the root `package.json` `repository` field, is checked like a relative one unless it is pinned to a commit or a release tag. A published workspace package's README is shown on npm without the repository around it, so its links that leave the package use absolute URLs. Imports in TypeScript and JavaScript code blocks, workspace module paths such as `@scope/lib/repository.ts` written as inline code, `` `name` from `module` `` phrases and a package README's API rows resolve through the owning package's `exports` to a module that is not blocked, and every named import exists in that module unless it re-exports another. A linked document such as `CLAUDE.md` beside `AGENTS.md` is checked once, through its target. `docs/unversioned-installs` rejects a version after a package name in install commands, in shell code blocks and inline code; the package's own version ranges decide what installs, and a written version goes stale with the next release. A dist-tag such as `latest` passes.
|
|
223
240
|
- **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
|
|
224
241
|
- **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
|
|
225
242
|
- **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list extends the rule's defaults, so list only repository-specific additions; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
|
|
243
|
+
- **React:** `react/jsx-conditionals` reports `&&` and ternaries in JSX children, including nested decisions. Decide before the JSX or extract a component that receives the data and returns `null` when it has nothing to show. Inside `.map`, extract an item component that makes its own decision. Conditional attributes such as `className` are accepted. This rule owns the check, so the shared Biome preset leaves `noLeakedRender` off.
|
|
226
244
|
- **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<modifier>].test.ts` or `<behaviour>[.<modifier>].spec.ts` with at most one modifier of `dom`, `slow`, `typecheck` and `unit`; a unit test runs without the DOM, so `.unit.dom` is rejected. `tests/colocated` always treats `__tests__/` as a test folder. It treats `test/`, `tests/` and `spec/` as test folders only when their directly contained checked files are all tests or test support; a product folder with source beside its specs is an ordinary source folder. Declared `suites` keep their own layout. Shared test support belongs in `test-support/`, the sanctioned test-only folder. A test covering a whole module may sit at its root or directly beside its folder. The story rules above keep setup in the kit.
|
|
227
245
|
- **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry, exact-path non-code assets such as JSON presets, `./package.json` and `null` blocks are allowed. A package without modules, such as a dependency shell, exports only exact assets and needs no wildcard. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional non-null wildcards fail. `manifests/application` keeps an application on its entry points, as described above.
|
|
228
246
|
- **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. A Biome run that fails without an error finding, such as one whose config leaves no file to check, fails lint and fix with Biome's message. The preset leaves out the `.worktrees` folder at the root, so a checkout does not lint its linked worktrees, while a worktree inside it lints all of its own files. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
|
|
229
247
|
|
|
248
|
+
### Decide before JSX
|
|
249
|
+
|
|
250
|
+
Replace a child decision such as `<section>{ready && <Content />}</section>` with an early return:
|
|
251
|
+
|
|
252
|
+
```tsx
|
|
253
|
+
function Panel({ ready }) {
|
|
254
|
+
if (!ready) return null;
|
|
255
|
+
return (
|
|
256
|
+
<section>
|
|
257
|
+
<Content />
|
|
258
|
+
</section>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Replace `<section>{ready ? <Content /> : <Loading />}</section>` with content computed above the return:
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
function Panel({ ready }) {
|
|
267
|
+
const content = ready ? <Content /> : <Loading />;
|
|
268
|
+
return <section>{content}</section>;
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Replace `<ul>{items.map(item => item.visible ? <li key={item.id}>{item.name}</li> : null)}</ul>` with an item component that receives the data and returns `null`:
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
function Item({ item }) {
|
|
276
|
+
if (!item.visible) return null;
|
|
277
|
+
return <li>{item.name}</li>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function List({ items }) {
|
|
281
|
+
return (
|
|
282
|
+
<ul>
|
|
283
|
+
{items.map((item) => (
|
|
284
|
+
<Item key={item.id} item={item} />
|
|
285
|
+
))}
|
|
286
|
+
</ul>
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
230
291
|
### API
|
|
231
292
|
|
|
232
293
|
Import names from their defining module; there is no root entry. The package's `./*.ts` export pattern also exposes the gate's implementation modules; the following table lists the config, tool and extension entry points:
|
|
233
294
|
|
|
234
|
-
| Module
|
|
235
|
-
|
|
|
236
|
-
| `config.ts`
|
|
237
|
-
| `rule.ts`
|
|
238
|
-
| `standardSchema.ts`
|
|
239
|
-
| `imports/fence.ts`
|
|
240
|
-
| `imports/fences/selectors.ts` | `packages`, `folders`, `files`, `modules`, `scopes`, `anyOf`, `workspace`, `anything`, `external`
|
|
241
|
-
| `imports/fences/model.ts`
|
|
242
|
-
| `testProjects.ts`
|
|
243
|
-
| `
|
|
295
|
+
| Module | Exports |
|
|
296
|
+
| ----------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
297
|
+
| `config.ts` | `defineConfig`, `QualityConfig`, `Level` (`"error"`), `RuleSetting`, `RuleSettings`, `BuiltInRules` |
|
|
298
|
+
| `rule.ts` | `defineRule`, `Rule`, `Configured`, `Finding`, `Findings`, `SourceFile`, `RuleInputs`, `RuleContext` |
|
|
299
|
+
| `standardSchema.ts` | `StandardSchemaV1`, `StandardResult`, `StandardIssue`, `describeIssue` |
|
|
300
|
+
| `imports/fence.ts` | `fence` |
|
|
301
|
+
| `imports/fences/selectors.ts` | `packages`, `folders`, `files`, `modules`, `scopes`, `anyOf`, `workspace`, `anything`, `external` |
|
|
302
|
+
| `imports/fences/model.ts` | `Fence`, `Target`, `Selector`, `Prohibition`, `Examples`, `Chain`, `ExampleStep`, `External` |
|
|
303
|
+
| `testProjects.ts` | `testProjects`, `TestProjectsOptions` |
|
|
304
|
+
| `appViteConfig.ts` | `appViteConfig` |
|
|
305
|
+
| `appTestConfig.ts` | `appTestConfig` |
|
|
306
|
+
| `naming/testName.ts` | `testName`, `isTestCode`, `isTestSupport`, `ENVIRONMENTS`, `Environment`, `TestName` |
|
|
244
307
|
|
|
245
308
|
#### Config
|
|
246
309
|
|
|
247
|
-
| Key
|
|
248
|
-
|
|
|
249
|
-
| `sources`
|
|
250
|
-
| `extensions` | `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, `.cjs` | Source extensions.
|
|
251
|
-
| `baseline`
|
|
252
|
-
| `exceptions` | `[]`
|
|
253
|
-
| `registry`
|
|
254
|
-
| `local`
|
|
255
|
-
| `rules`
|
|
310
|
+
| Key | Default | Meaning |
|
|
311
|
+
| ------------ | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
|
|
312
|
+
| `sources` | `["."]` | Directories or files the source rules check, relative to the repository root. |
|
|
313
|
+
| `extensions` | `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, `.cjs` | Source extensions. |
|
|
314
|
+
| `baseline` | `quality-baseline.jsonl` | Root shard for paths outside packages; package shards use `packages/<package>/quality-baseline.jsonl`. |
|
|
315
|
+
| `exceptions` | `[]` | Permanent exceptions as `{ files, rules, reason, subject? }`. |
|
|
316
|
+
| `registry` | `quality/registry.json` | Legacy input for upgrades; run `quality exceptions migrate`. |
|
|
317
|
+
| `local` | `[]` | Exposed extension API for rules made with `defineRule`; not required for adoption. |
|
|
318
|
+
| `rules` | Every rule at `error` | Options by rule id, such as import boundaries. An explicit `error` or `{ level: "error", options }` is also accepted. |
|
|
256
319
|
|
|
257
320
|
#### Local rules
|
|
258
321
|
|
|
@@ -263,9 +326,7 @@ import { defineRule } from "@shivaedev/quality/rule.ts";
|
|
|
263
326
|
|
|
264
327
|
export const noLog = defineRule({
|
|
265
328
|
check: ({ sources }) =>
|
|
266
|
-
sources
|
|
267
|
-
.filter((file) => file.text.includes("console.log"))
|
|
268
|
-
.map((file) => ({ file: file.path, message: "logs to the console." })),
|
|
329
|
+
sources.filter((file) => file.text.includes("console.log")).map((file) => ({ file: file.path, message: "logs to the console." })),
|
|
269
330
|
description: "Log through the logger.",
|
|
270
331
|
id: "local/no-console-log",
|
|
271
332
|
});
|
|
@@ -293,16 +354,16 @@ quality hooks pre-commit [--config <file>]
|
|
|
293
354
|
|
|
294
355
|
`quality` alone runs lint. The commands above use the default error-level policy. `prune --against` follows renames since the target's merge base; without a target it tries `origin/HEAD`, `origin/main`, then `origin/master`, and prunes without following moves when no merge base is available. An explicit target with unavailable history fails; fetch the needed history before rerunning. `migrate` splits a single JSON Lines baseline into shards, or converts an earlier JSON baseline into sharded JSON Lines. Use `--from quality/baseline.jsonl` for an existing single-file baseline. It removes the source after writing the shards.
|
|
295
356
|
|
|
296
|
-
| Exit code | Meaning
|
|
297
|
-
|
|
|
298
|
-
| `0`
|
|
299
|
-
| `1`
|
|
300
|
-
| `2`
|
|
357
|
+
| Exit code | Meaning |
|
|
358
|
+
| --------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
359
|
+
| `0` | Passed. Retained debt or loose baseline entries may remain. |
|
|
360
|
+
| `1` | Failed: uncovered errors, stale exceptions or baseline entries for unknown or disabled rules. |
|
|
361
|
+
| `2` | Could not run: invalid input or config, missing files or git history, a failed rule, fixes that do not settle, or invalid usage. |
|
|
301
362
|
|
|
302
363
|
### Install, shared tooling and limits
|
|
303
364
|
|
|
304
365
|
```sh
|
|
305
|
-
pnpm add --save-dev @shivaedev/quality @effect/platform-node
|
|
366
|
+
pnpm add --save-dev @shivaedev/quality @effect/platform-node @effect/platform-node-shared effect
|
|
306
367
|
```
|
|
307
368
|
|
|
308
369
|
Node 24 or later is required. The CLI loads the TypeScript config through Node's native import; use erasable syntax and `.ts` extensions for relative TypeScript imports.
|
|
@@ -409,8 +470,7 @@ export default defineConfig({
|
|
|
409
470
|
});
|
|
410
471
|
```
|
|
411
472
|
|
|
412
|
-
Quality merges the Biome settings at lint and fix time; do not add or mirror an override in `biome.json`. Files are explicit repository paths. Biome exceptions cover individual lint rules or assist actions; whole checks, rule groups and globs are rejected. `biome/files/includes` is the directory exclusion form: keep `**` and list negative patterns naming directories, such as `!**/test-support/generated`. Quality's shipped exceptions
|
|
413
|
-
|
|
473
|
+
Quality merges the Biome settings at lint and fix time; do not add or mirror an override in `biome.json`. Files are explicit repository paths. Biome exceptions cover individual lint rules or assist actions; whole checks, rule groups and globs are rejected. `biome/files/includes` is the directory exclusion form: keep `**` and list negative patterns naming directories, such as `!**/test-support/generated`. Quality's shipped exceptions are part of its internal policy. [Exceptions and upgrades](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md#exceptions) describes subjects, stale entries and the upgrade command.
|
|
414
474
|
- The source inventory and Biome have their own scopes. `quality fix` runs Biome from the config's folder; it is not restricted to the source-rule inventory.
|
|
415
475
|
- The installed hook checks files on disk, not only what is staged, and uses each committing worktree's config and dependencies. Installation sets repository-local `core.hooksPath`; the hook chains an executable global pre-commit hook without changing global configuration. Either hook's failure blocks the commit. `quality hooks status` reports when git's effective hooks path does not run Quality.
|
|
416
476
|
- Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Explicitly export-blocked bundle inputs may use them when no runtime module reaches those inputs in the scanned import graph; an executable or another public export keeps its imports in the runtime boundary.
|
package/biome/declarations.json
CHANGED
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
{
|
|
51
51
|
"includes": ["**"],
|
|
52
52
|
"reason": "An inline style is the right tool for a value computed at run time, such as a position, a transform or a drag offset.",
|
|
53
|
-
"rule": "lint/
|
|
53
|
+
"rule": "lint/style/noInlineStyles"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"includes": ["**"],
|
|
57
|
+
"reason": "react/jsx-conditionals owns conditional rendering in JSX children and asks for decisions before JSX or extracted components; noLeakedRender suggests a ternary that the Quality rule also rejects.",
|
|
58
|
+
"rule": "lint/suspicious/noLeakedRender"
|
|
54
59
|
}
|
|
55
60
|
]
|
|
@@ -6,7 +6,9 @@ or {
|
|
|
6
6
|
`Date.now()` as $match,
|
|
7
7
|
`new Date()` as $match
|
|
8
8
|
} where { register_diagnostic(span=$match, message="Ambient time is banned. Read time through Effect's Clock service.") },
|
|
9
|
-
`Math.random()` as $match where {
|
|
9
|
+
`Math.random()` as $match where {
|
|
10
|
+
register_diagnostic(span=$match, message="Ambient randomness is banned. Use Effect's Crypto service for secure values and Random for non-secure values.")
|
|
11
|
+
},
|
|
10
12
|
or {
|
|
11
13
|
`console.$method($...)` as $match,
|
|
12
14
|
`console[$method]($...)` as $match
|