@shivaedev/quality 0.17.0 → 0.19.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.
Files changed (267) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +151 -508
  3. package/biome/declarations.json +0 -45
  4. package/biome/plugins/constant-names.grit +1 -1
  5. package/biome/plugins/effect-fn-functions.grit +1 -1
  6. package/biome/preset.json +16 -9
  7. package/dist/baseline/compare.d.ts.map +1 -1
  8. package/dist/baseline/format.d.ts.map +1 -1
  9. package/dist/baseline/legacy.d.ts.map +1 -1
  10. package/dist/baseline/rewrite.d.ts.map +1 -1
  11. package/dist/baseline/update.d.ts.map +1 -1
  12. package/dist/baseline/update.js.map +1 -1
  13. package/dist/biome/nativeEffectCall.d.ts +4 -0
  14. package/dist/biome/nativeEffectCall.d.ts.map +1 -0
  15. package/dist/biome/nativeEffectCall.js +34 -0
  16. package/dist/biome/nativeEffectCall.js.map +1 -0
  17. package/dist/biome/recognizeDiagnostics.d.ts +3 -0
  18. package/dist/biome/recognizeDiagnostics.d.ts.map +1 -0
  19. package/dist/biome/recognizeDiagnostics.js +58 -0
  20. package/dist/biome/recognizeDiagnostics.js.map +1 -0
  21. package/dist/biome/report.d.ts +10 -0
  22. package/dist/biome/report.d.ts.map +1 -1
  23. package/dist/biome/report.js +23 -5
  24. package/dist/biome/report.js.map +1 -1
  25. package/dist/biome/run.js.map +1 -1
  26. package/dist/biome/syntax.d.ts +12 -0
  27. package/dist/biome/syntax.d.ts.map +1 -0
  28. package/dist/biome/syntax.js +29 -0
  29. package/dist/biome/syntax.js.map +1 -0
  30. package/dist/cli/args.d.ts +10 -1
  31. package/dist/cli/args.d.ts.map +1 -1
  32. package/dist/cli/args.js +25 -3
  33. package/dist/cli/args.js.map +1 -1
  34. package/dist/cli/baseline.d.ts +1 -1
  35. package/dist/cli/baseline.d.ts.map +1 -1
  36. package/dist/cli/baseline.js.map +1 -1
  37. package/dist/cli/fix.d.ts +6 -6
  38. package/dist/cli/fix.d.ts.map +1 -1
  39. package/dist/cli/fix.js +1 -1
  40. package/dist/cli/fix.js.map +1 -1
  41. package/dist/cli/lint.d.ts.map +1 -1
  42. package/dist/cli/migrate.d.ts.map +1 -1
  43. package/dist/cli/run-main.d.ts +1 -1
  44. package/dist/cli/run-main.d.ts.map +1 -1
  45. package/dist/cli/run-main.js.map +1 -1
  46. package/dist/cli/shrink.d.ts.map +1 -1
  47. package/dist/cli.js +14 -0
  48. package/dist/cli.js.map +1 -1
  49. package/dist/config/decode.d.ts +3 -3
  50. package/dist/config/decode.d.ts.map +1 -1
  51. package/dist/config/decode.js +5 -2
  52. package/dist/config/decode.js.map +1 -1
  53. package/dist/config/load.d.ts.map +1 -1
  54. package/dist/config/load.js +11 -6
  55. package/dist/config/load.js.map +1 -1
  56. package/dist/config/resolve.d.ts.map +1 -1
  57. package/dist/config/resolve.js +8 -12
  58. package/dist/config/resolve.js.map +1 -1
  59. package/dist/config.d.ts +10 -11
  60. package/dist/config.d.ts.map +1 -1
  61. package/dist/config.js.map +1 -1
  62. package/dist/decoded.d.ts +4 -4
  63. package/dist/decoded.d.ts.map +1 -1
  64. package/dist/decoded.js.map +1 -1
  65. package/dist/engine/baseline-file.d.ts.map +1 -1
  66. package/dist/engine/evaluate.d.ts.map +1 -1
  67. package/dist/engine/run-rules.d.ts.map +1 -1
  68. package/dist/engine/session.d.ts.map +1 -1
  69. package/dist/engine/session.js.map +1 -1
  70. package/dist/engine/violation.d.ts +1 -1
  71. package/dist/engine/violation.d.ts.map +1 -1
  72. package/dist/engine/violation.js.map +1 -1
  73. package/dist/exceptions/registry.d.ts.map +1 -1
  74. package/dist/git/base.d.ts.map +1 -1
  75. package/dist/git/command.d.ts.map +1 -1
  76. package/dist/git/history.d.ts.map +1 -1
  77. package/dist/hooks/command.d.ts +13 -0
  78. package/dist/hooks/command.d.ts.map +1 -0
  79. package/dist/hooks/command.js +20 -0
  80. package/dist/hooks/command.js.map +1 -0
  81. package/dist/hooks/install.d.ts +11 -0
  82. package/dist/hooks/install.d.ts.map +1 -0
  83. package/dist/hooks/install.js +52 -0
  84. package/dist/hooks/install.js.map +1 -0
  85. package/dist/hooks/location.d.ts +9 -0
  86. package/dist/hooks/location.d.ts.map +1 -0
  87. package/dist/hooks/location.js +22 -0
  88. package/dist/hooks/location.js.map +1 -0
  89. package/dist/hooks/preCommit.d.ts +5 -0
  90. package/dist/hooks/preCommit.d.ts.map +1 -0
  91. package/dist/hooks/preCommit.js +50 -0
  92. package/dist/hooks/preCommit.js.map +1 -0
  93. package/dist/hooks/shim.d.ts +4 -0
  94. package/dist/hooks/shim.d.ts.map +1 -0
  95. package/dist/hooks/shim.js +26 -0
  96. package/dist/hooks/shim.js.map +1 -0
  97. package/dist/hooks/uninstall.d.ts +4 -0
  98. package/dist/hooks/uninstall.d.ts.map +1 -0
  99. package/dist/hooks/uninstall.js +19 -0
  100. package/dist/hooks/uninstall.js.map +1 -0
  101. package/dist/imports/browserGlobals.d.ts +3 -0
  102. package/dist/imports/browserGlobals.d.ts.map +1 -0
  103. package/dist/imports/browserGlobals.js +125 -0
  104. package/dist/imports/browserGlobals.js.map +1 -0
  105. package/dist/imports/browserNames.d.ts +2 -0
  106. package/dist/imports/browserNames.d.ts.map +1 -0
  107. package/dist/imports/browserNames.js +78 -0
  108. package/dist/imports/browserNames.js.map +1 -0
  109. package/dist/imports/fences/check.d.ts +4 -0
  110. package/dist/imports/fences/check.d.ts.map +1 -0
  111. package/dist/imports/fences/check.js +10 -0
  112. package/dist/imports/fences/check.js.map +1 -0
  113. package/dist/imports/fences/declarations.d.ts +5 -0
  114. package/dist/imports/fences/declarations.d.ts.map +1 -0
  115. package/dist/imports/fences/declarations.js +29 -0
  116. package/dist/imports/fences/declarations.js.map +1 -0
  117. package/dist/imports/fences/discover.d.ts +5 -0
  118. package/dist/imports/fences/discover.d.ts.map +1 -0
  119. package/dist/imports/fences/discover.js +41 -0
  120. package/dist/imports/fences/discover.js.map +1 -0
  121. package/dist/imports/fences/match.js.map +1 -1
  122. package/dist/imports/graph.js +2 -2
  123. package/dist/imports/graph.js.map +1 -1
  124. package/dist/imports/projects.js.map +1 -1
  125. package/dist/imports/runtime.d.ts +5 -0
  126. package/dist/imports/runtime.d.ts.map +1 -0
  127. package/dist/imports/runtime.js +32 -0
  128. package/dist/imports/runtime.js.map +1 -0
  129. package/dist/imports/workspace.d.ts +1 -1
  130. package/dist/imports/workspace.d.ts.map +1 -1
  131. package/dist/imports/workspace.js +5 -1
  132. package/dist/imports/workspace.js.map +1 -1
  133. package/dist/inventory/collect.d.ts.map +1 -1
  134. package/dist/inventory/collect.js +8 -1
  135. package/dist/inventory/collect.js.map +1 -1
  136. package/dist/inventory/filesystem.d.ts.map +1 -1
  137. package/dist/inventory/ignore-scope.d.ts.map +1 -1
  138. package/dist/inventory/trackedPaths.d.ts +3 -0
  139. package/dist/inventory/trackedPaths.d.ts.map +1 -0
  140. package/dist/inventory/trackedPaths.js +26 -0
  141. package/dist/inventory/trackedPaths.js.map +1 -0
  142. package/dist/inventory/walk.d.ts +4 -4
  143. package/dist/inventory/walk.d.ts.map +1 -1
  144. package/dist/inventory/walk.js +32 -12
  145. package/dist/inventory/walk.js.map +1 -1
  146. package/dist/naming/testName.d.ts.map +1 -1
  147. package/dist/report/plural.d.ts.map +1 -1
  148. package/dist/report/render.d.ts.map +1 -1
  149. package/dist/report/stale.d.ts.map +1 -1
  150. package/dist/rules/built-in.d.ts +2 -3
  151. package/dist/rules/built-in.d.ts.map +1 -1
  152. package/dist/rules/built-in.js +6 -0
  153. package/dist/rules/built-in.js.map +1 -1
  154. package/dist/rules/comments/kinds.d.ts.map +1 -1
  155. package/dist/rules/comments/max-per-file.js +1 -1
  156. package/dist/rules/comments/max-per-file.js.map +1 -1
  157. package/dist/rules/comments/pattern-rule.d.ts.map +1 -1
  158. package/dist/rules/comments/scan.d.ts.map +1 -1
  159. package/dist/rules/files/folderNames.js +1 -1
  160. package/dist/rules/files/folderNames.js.map +1 -1
  161. package/dist/rules/files/otherNames.d.ts.map +1 -1
  162. package/dist/rules/files/otherNames.js +1 -10
  163. package/dist/rules/files/otherNames.js.map +1 -1
  164. package/dist/rules/imports/bundleInputs.d.ts +7 -0
  165. package/dist/rules/imports/bundleInputs.d.ts.map +1 -0
  166. package/dist/rules/imports/bundleInputs.js +77 -0
  167. package/dist/rules/imports/bundleInputs.js.map +1 -0
  168. package/dist/rules/imports/fences.d.ts +1 -2
  169. package/dist/rules/imports/fences.d.ts.map +1 -1
  170. package/dist/rules/imports/fences.js +4 -14
  171. package/dist/rules/imports/fences.js.map +1 -1
  172. package/dist/rules/imports/manifest.d.ts +2 -0
  173. package/dist/rules/imports/manifest.d.ts.map +1 -0
  174. package/dist/rules/imports/manifest.js +98 -0
  175. package/dist/rules/imports/manifest.js.map +1 -0
  176. package/dist/rules/imports/noTestCode.d.ts +2 -0
  177. package/dist/rules/imports/noTestCode.d.ts.map +1 -0
  178. package/dist/rules/imports/noTestCode.js +17 -0
  179. package/dist/rules/imports/noTestCode.js.map +1 -0
  180. package/dist/rules/imports/runtime.d.ts +2 -0
  181. package/dist/rules/imports/runtime.d.ts.map +1 -0
  182. package/dist/rules/imports/runtime.js +41 -0
  183. package/dist/rules/imports/runtime.js.map +1 -0
  184. package/dist/rules/max-lines.d.ts +0 -1
  185. package/dist/rules/max-lines.d.ts.map +1 -1
  186. package/dist/rules/max-lines.js +3 -10
  187. package/dist/rules/max-lines.js.map +1 -1
  188. package/dist/rules/suppressions/biome/configs.d.ts.map +1 -1
  189. package/dist/rules/suppressions/biome/declarations.d.ts.map +1 -1
  190. package/dist/rules/suppressions/biome/json.d.ts.map +1 -1
  191. package/dist/rules/suppressions/biome/resolve.d.ts.map +1 -1
  192. package/dist/rules/suppressions/biome/weakenings.d.ts.map +1 -1
  193. package/dist/rules/suppressions/biome-overrides.d.ts.map +1 -1
  194. package/dist/rules/suppressions/biome-overrides.js +21 -4
  195. package/dist/rules/suppressions/biome-overrides.js.map +1 -1
  196. package/dist/rules/suppressions/biomeRecommended.js +2 -2
  197. package/dist/rules/suppressions/biomeRecommended.js.map +1 -1
  198. package/dist/rules/suppressions/directives.d.ts.map +1 -1
  199. package/dist/rules/suppressions/no-inline.js +1 -1
  200. package/dist/rules/suppressions/no-inline.js.map +1 -1
  201. package/dist/rules/suppressions/stylesheet-comments.d.ts.map +1 -1
  202. package/dist/rules/syntax.d.ts.map +1 -1
  203. package/dist/standard-schema.d.ts +1 -1
  204. package/dist/standard-schema.d.ts.map +1 -1
  205. package/dist/standard-schema.js +10 -2
  206. package/dist/standard-schema.js.map +1 -1
  207. package/dist/vitest.d.ts +1 -3
  208. package/dist/vitest.d.ts.map +1 -1
  209. package/dist/vitest.js +11 -6
  210. package/dist/vitest.js.map +1 -1
  211. package/docs/debt-and-hooks.md +90 -0
  212. package/docs/modules.md +253 -0
  213. package/docs/naming.md +126 -0
  214. package/docs/north-star.md +61 -0
  215. package/docs/roadmap.md +37 -0
  216. package/docs/rules.md +308 -0
  217. package/docs/tooling.md +120 -0
  218. package/package.json +8 -6
  219. package/src/biome/nativeEffectCall.ts +45 -0
  220. package/src/biome/recognizeDiagnostics.ts +67 -0
  221. package/src/biome/report.ts +24 -6
  222. package/src/biome/syntax.ts +36 -0
  223. package/src/cli/args.ts +29 -3
  224. package/src/cli/baseline.ts +3 -3
  225. package/src/cli/fix.ts +13 -13
  226. package/src/cli/run-main.ts +1 -1
  227. package/src/cli.ts +14 -0
  228. package/src/config/decode.ts +7 -2
  229. package/src/config/load.ts +15 -6
  230. package/src/config/resolve.ts +10 -15
  231. package/src/config.ts +8 -9
  232. package/src/decoded.ts +3 -3
  233. package/src/engine/session.ts +3 -3
  234. package/src/engine/violation.ts +2 -2
  235. package/src/hooks/command.ts +34 -0
  236. package/src/hooks/install.ts +69 -0
  237. package/src/hooks/location.ts +28 -0
  238. package/src/hooks/preCommit.ts +68 -0
  239. package/src/hooks/shim.ts +28 -0
  240. package/src/hooks/uninstall.ts +19 -0
  241. package/src/imports/browserGlobals.ts +142 -0
  242. package/src/imports/browserNames.ts +80 -0
  243. package/src/imports/fences/check.ts +12 -0
  244. package/src/imports/fences/declarations.ts +38 -0
  245. package/src/imports/fences/discover.ts +37 -0
  246. package/src/imports/graph.ts +2 -2
  247. package/src/imports/projects.ts +2 -2
  248. package/src/imports/runtime.ts +37 -0
  249. package/src/imports/workspace.ts +7 -2
  250. package/src/inventory/collect.ts +8 -1
  251. package/src/inventory/trackedPaths.ts +28 -0
  252. package/src/inventory/walk.ts +65 -36
  253. package/src/rules/built-in.ts +6 -0
  254. package/src/rules/comments/max-per-file.ts +1 -1
  255. package/src/rules/files/folderNames.ts +1 -1
  256. package/src/rules/files/otherNames.ts +1 -10
  257. package/src/rules/imports/bundleInputs.ts +94 -0
  258. package/src/rules/imports/fences.ts +4 -16
  259. package/src/rules/imports/manifest.ts +116 -0
  260. package/src/rules/imports/noTestCode.ts +18 -0
  261. package/src/rules/imports/runtime.ts +43 -0
  262. package/src/rules/max-lines.ts +4 -10
  263. package/src/rules/suppressions/biome-overrides.ts +31 -4
  264. package/src/rules/suppressions/biomeRecommended.ts +2 -2
  265. package/src/rules/suppressions/no-inline.ts +1 -1
  266. package/src/standard-schema.ts +11 -3
  267. package/src/vitest.ts +11 -6
@@ -0,0 +1,253 @@
1
+ # Module reference
2
+
3
+ The `./*.ts` export pattern maps each module below to its emitted JavaScript and declarations, with source selected under the `source` condition. Import a symbol from its defining module. The [README](../README.md#api) explains the config and extension APIs; this table also makes the implementation modules exposed by that pattern findable.
4
+
5
+ A module link opens its source. Type and value declarations with the same name appear once. `cli.ts` is the executable entry and has no exported symbols.
6
+
7
+ ## Top-level modules
8
+
9
+ | Module | Exported names |
10
+ | --- | --- |
11
+ | [cli.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli.ts) | None; executable entry. |
12
+ | [config.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/config.ts) | `Level`, `RuleSetting`, `RuleSettings`, `BuiltInRules`, `QualityConfig`, `defineConfig` |
13
+ | [decoded.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/decoded.ts) | `Decoded`, `decodeWith`, `validOrFail` |
14
+ | [failure.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/failure.ts) | `SetupFailure`, `GateFailed` |
15
+ | [rule.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rule.ts) | `Finding`, `Findings`, `SourceFile`, `RuleInputs`, `RuleContext`, `Configured`, `Rule`, `defineRule` |
16
+ | [standard-schema.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/standard-schema.ts) | `StandardSchemaV1`, `StandardResult`, `StandardIssue`, `describeIssue` |
17
+ | [vitest.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/vitest.ts) | `testProjects`, `inheritTags` |
18
+
19
+ ## baseline
20
+
21
+ | Module | Exported names |
22
+ | --- | --- |
23
+ | [baseline/compare.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/baseline/compare.ts) | `Regression`, `StaleBaselineEntry`, `BaselineCheck`, `countOf`, `applyBaseline` |
24
+ | [baseline/format.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/baseline/format.ts) | `BaselineEntry`, `byPathAndRule`, `linesOf`, `decodeBaseline`, `encodeEntry`, `encodeBaseline` |
25
+ | [baseline/legacy.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/baseline/legacy.ts) | `LEGACY_BASELINE`, `LegacyEntry`, `decodeLegacyBaseline`, `convertLegacy` |
26
+ | [baseline/rewrite.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/baseline/rewrite.ts) | `rewriteBaseline` |
27
+ | [baseline/update.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/baseline/update.ts) | `Adoption`, `Pruned`, `adopt`, `Scope`, `prune` |
28
+
29
+ ## biome
30
+
31
+ | Module | Exported names |
32
+ | --- | --- |
33
+ | [biome/recommendedRules.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/biome/recommendedRules.ts) | `recommendedRules` |
34
+ | [biome/report.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/biome/report.ts) | `Diagnostic`, `Report`, `biomeReport` |
35
+ | [biome/run.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/biome/run.ts) | `BiomeRun`, `runBiome` |
36
+
37
+ ## cli
38
+
39
+ | Module | Exported names |
40
+ | --- | --- |
41
+ | [cli/args.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/args.ts) | `Command`, `Parsed`, `USAGE`, `parseCommand` |
42
+ | [cli/baseline.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/baseline.ts) | `writeBaseline`, `shrinkBaseline` |
43
+ | [cli/fix.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/fix.ts) | `MAX_FIX_ROUNDS`, `snapshotOf`, `Pass`, `Settling`, `settle`, `fix` |
44
+ | [cli/lint.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/lint.ts) | `lint` |
45
+ | [cli/migrate.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/migrate.ts) | `migrateBaseline` |
46
+ | [cli/run-main.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/run-main.ts) | `quietOnClosedPipe`, `runMain` |
47
+ | [cli/shrink.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/shrink.ts) | `pruneBaseline`, `tightenBaseline` |
48
+
49
+ ## config
50
+
51
+ | Module | Exported names |
52
+ | --- | --- |
53
+ | [config/decode.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/config/decode.ts) | `ConfigInput`, `decodeConfig` |
54
+ | [config/file.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/config/file.ts) | `CONFIG_FILE` |
55
+ | [config/load.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/config/load.ts) | `ResolvedConfig`, `loadConfig` |
56
+ | [config/resolve.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/config/resolve.ts) | `ResolvedRules`, `resolveRules` |
57
+
58
+ ## engine
59
+
60
+ | Module | Exported names |
61
+ | --- | --- |
62
+ | [engine/baseline-file.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/baseline-file.ts) | `BaselineFile`, `readInput`, `readBaseline` |
63
+ | [engine/evaluate.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/evaluate.ts) | `Outcome`, `evaluate`, `passes` |
64
+ | [engine/run-rules.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/run-rules.ts) | `ActiveRule`, `runRules` |
65
+ | [engine/session.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/session.ts) | `Session`, `scan`, `openSession` |
66
+ | [engine/violation.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/violation.ts) | `ActiveLevel`, `Violation`, `keyOf`, `byLocation`, `groupBy`, `RuleIndex`, `covers`, `levelOf`, `registrable`, `unusedEntryProblem` |
67
+
68
+ ## exceptions
69
+
70
+ | Module | Exported names |
71
+ | --- | --- |
72
+ | [exceptions/registry.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/exceptions/registry.ts) | `RegistryEntry`, `decodeRegistry`, `StaleRegistryEntry`, `RegistryCheck`, `applyRegistry` |
73
+
74
+ ## git
75
+
76
+ | Module | Exported names |
77
+ | --- | --- |
78
+ | [git/base.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/git/base.ts) | `Base`, `resolveBase` |
79
+ | [git/command.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/git/command.ts) | `GitResult`, `Git`, `git`, `gitOrFail` |
80
+ | [git/history.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/git/history.ts) | `Changes`, `changesSince` |
81
+
82
+ ## hooks
83
+
84
+ | Module | Exported names |
85
+ | --- | --- |
86
+ | [hooks/command.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/hooks/command.ts) | `Launch`, `HookCommand`, `hookCommand`, `commandWords`, `shellWords` |
87
+ | [hooks/install.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/hooks/install.ts) | `HookInstall`, `installHook` |
88
+ | [hooks/location.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/hooks/location.ts) | `HookLocation`, `hookLocation` |
89
+ | [hooks/preCommit.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/hooks/preCommit.ts) | `preCommitHook` |
90
+ | [hooks/shim.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/hooks/shim.ts) | `isHookShim`, `hookShim` |
91
+ | [hooks/uninstall.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/hooks/uninstall.ts) | `uninstallHook` |
92
+
93
+ ## imports
94
+
95
+ | Module | Exported names |
96
+ | --- | --- |
97
+ | [imports/ambient.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/ambient.ts) | `Ambient`, `ambientModules` |
98
+ | [imports/components.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/components.ts) | `cyclicComponents` |
99
+ | [imports/departures.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/departures.ts) | `Departure`, `departures` |
100
+ | [imports/extract.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/extract.ts) | `ImportKind`, `ImportRequest`, `importsOf` |
101
+ | [imports/generated.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/generated.ts) | `withoutGenerated` |
102
+ | [imports/glob.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/glob.ts) | `globMatcher` |
103
+ | [imports/graph.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/graph.ts) | `ImportEdge`, `UnresolvedImport`, `ImportGraph`, `importGraph` |
104
+ | [imports/paths.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/paths.ts) | `shortestPath` |
105
+ | [imports/pnpm-workspace.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/pnpm-workspace.ts) | `pnpmWorkspacePatterns` |
106
+ | [imports/projects.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/projects.ts) | `Project`, `projectsFor` |
107
+ | [imports/resolve.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/resolve.ts) | `Endpoint`, `builtinName`, `packageNameOf`, `isDeclarationFile`, `presumedTarget`, `resolveImport` |
108
+ | [imports/specifiers.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/specifiers.ts) | `SpecifierSite`, `specifierSites` |
109
+ | [imports/workspace.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/workspace.ts) | `WorkspacePackage`, `workspacePackages`, `packageOf` |
110
+
111
+ ## imports/fences
112
+
113
+ | Module | Exported names |
114
+ | --- | --- |
115
+ | [imports/fences/check.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/check.ts) | `checkFences` |
116
+ | [imports/fences/declarations.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/declarations.ts) | `Declarations`, `decodeDeclarations` |
117
+ | [imports/fences/discover.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/discover.ts) | `discoverFences` |
118
+ | [imports/fences/dsl.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/dsl.ts) | `fence` |
119
+ | [imports/fences/evaluate.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/evaluate.ts) | `FenceGraph`, `Evaluate`, `CompiledFence`, `compileFence` |
120
+ | [imports/fences/match.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/match.ts) | `PolicyScope`, `Matcher`, `Compiler`, `trimmed`, `holdsFiles`, `packageNamed`, `compile` |
121
+ | [imports/fences/model.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/model.ts) | `Selector`, `Target`, `External`, `ExampleStep`, `Chain`, `Examples`, `Prohibition`, `Fence` |
122
+ | [imports/fences/policy.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/policy.ts) | `compilePolicy` |
123
+ | [imports/fences/reach.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/reach.ts) | `Reached`, `labelOf`, `outgoing`, `reachedFrom` |
124
+ | [imports/fences/selectors.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/selectors.ts) | `packages`, `folders`, `files`, `modules`, `scopes`, `anyOf`, `workspace`, `anything`, `external` |
125
+ | [imports/fences/vocabulary.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/fences/vocabulary.ts) | `Vocabulary`, `compileVocabulary` |
126
+
127
+ ## inventory
128
+
129
+ | Module | Exported names |
130
+ | --- | --- |
131
+ | [inventory/collect.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/collect.ts) | `InventoryScope`, `Inventory`, `linesOf`, `collectInventory` |
132
+ | [inventory/filesystem.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/filesystem.ts) | `FilesystemFailure`, `orWhenAbsent`, `readOptionalText`, `readRequiredText`, `writeText` |
133
+ | [inventory/ignore-scope.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/ignore-scope.ts) | `Verdict`, `IgnoreScope`, `emptyScope`, `posix`, `withIgnoreFile`, `insideKept`, `verdictFor` |
134
+ | [inventory/trackedPaths.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/trackedPaths.ts) | `trackedPaths`, `ignoredTrackedPaths` |
135
+ | [inventory/walk.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/walk.ts) | `ignoreScopeAt`, `scopeAbove`, `walk` |
136
+
137
+ ## manifests
138
+
139
+ | Module | Exported names |
140
+ | --- | --- |
141
+ | [manifests/sorted.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/manifests/sorted.ts) | `Sorting`, `manifestsIn`, `sortingOf`, `sortManifests` |
142
+
143
+ ## naming
144
+
145
+ | Module | Exported names |
146
+ | --- | --- |
147
+ | [naming/exportFits.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/naming/exportFits.ts) | `exportFits` |
148
+ | [naming/mainExport.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/naming/mainExport.ts) | `mainExport` |
149
+ | [naming/ownExports.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/naming/ownExports.ts) | `OwnExport`, `ownExports` |
150
+ | [naming/packageLayout.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/naming/packageLayout.ts) | `PackageLayout`, `packageLayout` |
151
+ | [naming/testName.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/naming/testName.ts) | `ENVIRONMENTS`, `Environment`, `TestName`, `testName`, `isTestSupport`, `isTestCode` |
152
+ | [naming/words.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/naming/words.ts) | `KEBAB`, `CAMEL`, `PASCAL`, `wordsOf`, `singular`, `sameWord`, `isUpper` |
153
+
154
+ ## report
155
+
156
+ | Module | Exported names |
157
+ | --- | --- |
158
+ | [report/plural.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/plural.ts) | `plural` |
159
+ | [report/render.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/render.ts) | `WarningDetail`, `ReportContext`, `render` |
160
+ | [report/stale.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/stale.ts) | `staleSections` |
161
+
162
+ ## rules
163
+
164
+ | Module | Exported names |
165
+ | --- | --- |
166
+ | [rules/biome.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/biome.ts) | `PRESET`, `rootConfig`, `biome` |
167
+ | [rules/built-in.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/built-in.ts) | `builtInRules` |
168
+ | [rules/manifests-sorted.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/manifests-sorted.ts) | `manifestsSorted` |
169
+ | [rules/max-lines.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/max-lines.ts) | `maxLines` |
170
+ | [rules/syntax.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/syntax.ts) | `parse` |
171
+
172
+ ## rules/comments
173
+
174
+ | Module | Exported names |
175
+ | --- | --- |
176
+ | [rules/comments/kinds.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/kinds.ts) | `Pragmas`, `textOf`, `isJsdoc`, `isPragma`, `isDirective` |
177
+ | [rules/comments/max-per-file.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/max-per-file.ts) | `maxPerFile` |
178
+ | [rules/comments/no-banner.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-banner.ts) | `noBanner` |
179
+ | [rules/comments/no-environment-pragma.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-environment-pragma.ts) | `noEnvironmentPragma` |
180
+ | [rules/comments/no-jsdoc.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-jsdoc.ts) | `noJsdoc` |
181
+ | [rules/comments/no-line-reference.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-line-reference.ts) | `noLineReference` |
182
+ | [rules/comments/no-pr-reference.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-pr-reference.ts) | `noPrReference` |
183
+ | [rules/comments/no-todo.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-todo.ts) | `noTodo` |
184
+ | [rules/comments/pattern-rule.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/pattern-rule.ts) | `definePatternRule` |
185
+ | [rules/comments/scan.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/scan.ts) | `SourceComment`, `bodyOf`, `scanComments`, `commentsOf` |
186
+
187
+ ## rules/files
188
+
189
+ | Module | Exported names |
190
+ | --- | --- |
191
+ | [rules/files/folderNames.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/files/folderNames.ts) | `folderNames` |
192
+ | [rules/files/namedAfterExport.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/files/namedAfterExport.ts) | `namedAfterExport` |
193
+ | [rules/files/otherNames.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/files/otherNames.ts) | `otherNames` |
194
+ | [rules/files/packageImports.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/files/packageImports.ts) | `PackageImports`, `packageImports` |
195
+ | [rules/files/stylesheetImporters.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/files/stylesheetImporters.ts) | `stylesheetImporters` |
196
+
197
+ ## rules/imports
198
+
199
+ | Module | Exported names |
200
+ | --- | --- |
201
+ | [rules/imports/aliased.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/imports/aliased.ts) | `importsAliased` |
202
+ | [rules/imports/cycles.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/imports/cycles.ts) | `importCycles` |
203
+ | [rules/imports/fences.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/imports/fences.ts) | `importFences` |
204
+ | [rules/imports/noTestCode.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/imports/noTestCode.ts) | `noTestCode` |
205
+ | [rules/imports/resolvable.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/imports/resolvable.ts) | `importsResolvable` |
206
+
207
+ ## rules/stories
208
+
209
+ | Module | Exported names |
210
+ | --- | --- |
211
+ | [rules/stories/fixtureWrites.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/stories/fixtureWrites.ts) | `FixtureWrite`, `fixtureWrites` |
212
+ | [rules/stories/setup.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/stories/setup.ts) | `storySetup` |
213
+
214
+ ## rules/suppressions
215
+
216
+ | Module | Exported names |
217
+ | --- | --- |
218
+ | [rules/suppressions/biome-overrides.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome-overrides.ts) | `biomeOverrides` |
219
+ | [rules/suppressions/biomeRecommended.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biomeRecommended.ts) | `biomeRecommendedFrom`, `biomeRecommended` |
220
+ | [rules/suppressions/directives.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/directives.ts) | `SUPPRESSIONS`, `suppressionIn` |
221
+ | [rules/suppressions/no-double-cast.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/no-double-cast.ts) | `noDoubleCast` |
222
+ | [rules/suppressions/no-inline.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/no-inline.ts) | `noInline` |
223
+ | [rules/suppressions/noIgnoreDeprecations.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/noIgnoreDeprecations.ts) | `noIgnoreDeprecations` |
224
+ | [rules/suppressions/stylesheet-comments.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/stylesheet-comments.ts) | `STYLESHEET`, `stylesheetComments` |
225
+
226
+ ## rules/suppressions/biome
227
+
228
+ | Module | Exported names |
229
+ | --- | --- |
230
+ | [rules/suppressions/biome/configs.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome/configs.ts) | `Preset`, `Layer`, `Chain`, `BiomeConfigs`, `biomeConfigs` |
231
+ | [rules/suppressions/biome/declarations.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome/declarations.ts) | `Declaration`, `PRESET_DECLARATIONS`, `decodeShipped`, `Scoped`, `matches`, `scoped`, `scopeText` |
232
+ | [rules/suppressions/biome/json.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome/json.ts) | `Json`, `Parsed`, `parseJsonc`, `member`, `entriesOf`, `itemsOf`, `textOf`, `isFalse` |
233
+ | [rules/suppressions/biome/resolve.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome/resolve.ts) | `resolvePackage` |
234
+ | [rules/suppressions/biome/weakenings.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome/weakenings.ts) | `Weakening`, `weakeningsOf` |
235
+
236
+ ## rules/test-names
237
+
238
+ | Module | Exported names |
239
+ | --- | --- |
240
+ | [rules/test-names/colocated.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/test-names/colocated.ts) | `testsColocated` |
241
+ | [rules/test-names/follow.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/test-names/follow.ts) | `testsFollow` |
242
+ | [rules/test-names/usesDom.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/test-names/usesDom.ts) | `usesDom` |
243
+
244
+ ## Preset assets
245
+
246
+ | Package path | File |
247
+ | --- | --- |
248
+ | `@shivaedev/quality/biome` | `biome/preset.json` |
249
+ | `@shivaedev/quality/tsconfig/base.json` | `tsconfig/base.json` |
250
+ | `@shivaedev/quality/tsconfig/package.json` | `tsconfig/package.json` |
251
+ | `@shivaedev/quality/package.json` | Package metadata |
252
+
253
+ The [shared tooling guide](./tooling.md) explains how to use the presets.
package/docs/naming.md ADDED
@@ -0,0 +1,126 @@
1
+ # Naming and test layout
2
+
3
+ A name says what a thing is. The rules below give identifiers, files, folders and tests a common shape, so a reader can find the defining module and recognize test code. For the gate's workflow, see the [README](../README.md).
4
+
5
+ A name says what a thing is, and the same kind of thing is named the same way everywhere. Every naming rule is an error without an autofix: nothing renames code or adds a `_` prefix. The message says what is wrong and which shapes are valid, and the author picks the name. Unused variables and parameters stay TypeScript errors; remove them instead of prefixing them.
6
+
7
+ ### Identifiers
8
+
9
+ | What | Valid shape | Checked by |
10
+ | --- | --- | --- |
11
+ | Variables, functions and parameters | camelCase: `itemCount`, `loadItem`. A component or a class is PascalCase. | `useNamingConvention` |
12
+ | Acronyms | Spelled as a word: `HttpClient`, `userId`, `parseUrl`. Never `HTTPClient`, `userID` or `parseURL`. | `useNamingConvention` with `strictCase` |
13
+ | Types, interfaces, classes and enums | PascalCase, without an `I` prefix: `Item`, not `IItem`. | `useNamingConvention` |
14
+ | Type parameters | `T`, or `T` followed by a PascalCase name: `TItem`, `TResult`. Effect's positional `A`, `E` and `R` are valid as they are. | `useNamingConvention` |
15
+ | Module-level constants | A string or number literal at module level is CONSTANT_CASE: `const MAX_ITEMS = 50`. A constant inside a function is camelCase. | `constant-names` plugin, `useNamingConvention` |
16
+ | Object keys and type properties | camelCase or PascalCase, after any leading `_` or `$` (`_tag`, `$transaction`), also in a `Record`. A quoted key is a [foreign name](./naming.md#foreign-names) and is not checked. | `key-names` plugin |
17
+ | Schemas | PascalCase and named like their type: `const Item = Schema.Struct(...)` with `type Item = typeof Item.Type`. | `schema-names` plugin |
18
+ | `Schema.Struct` fields | camelCase, also when quoted. Outside data keeps its keys only at the edge: `Schema.Struct({ createdAt: Schema.String }).pipe(Schema.encodeKeys({ createdAt: "created_at" }))`. | `schema-struct-keys` plugin, `key-names` plugin |
19
+ | `Effect.fn` spans | `"Owner.operation"`, where the owner is the service or module and the operation is the name the function is bound to: `const loadItem = Effect.fn("ItemStore.loadItem")`, and `loadItem: Effect.fn("ItemStore.loadItem")` in an object. | `effect-fn-spans` plugin |
20
+ | `Effect.gen` functions | A top-level function whose whole body is `Effect.gen` is an `Effect.fn`: `const loadItem = Effect.fn("ItemStore.loadItem")(function* (id: string) { … })`, or `Effect.fnUntraced` when it needs no span. | `effect-fn-functions` plugin |
21
+ | Effect test bodies | In test code, a test takes the generator itself: `it.effect("loads the item", function* () { … })`, never `() => Effect.gen(function* () { … })`. The test helper runs it with `Effect.gen`. | `effect-test-bodies` plugin |
22
+ | Service Layers | A static `layer` on the service, read as `ItemStore.layer`. No exported `ItemStoreLive` or `ItemStoreLayer` constant. A Layer that wires an application together stays unexported. | `service-layers` plugin |
23
+ | Private members | A `#field`. No `private`, `protected` or `public` modifier. | `useConsistentMemberAccessibility` |
24
+ | React | A function passed to an `onX` prop is `handleX`, an `onX` prop forwarded as it is, or a state setter passed as it is: `onOpenChange={setOpen}`. A context is `ThemeContext`, a ref `inputRef`, an id `fieldId`. A module that exports a component exports only components; a test may define the components it renders. | `handler-names` plugin, `useReactNamingConvention`, `useComponentExportOnlyModules` |
25
+ | Booleans | A question: `isOpen`, `hasSave`, `canRetry`, `shouldFlush`. A name the DOM or React gives, such as `open` or `disabled`, stays. This is a convention only; no rule checks it. | Review |
26
+
27
+ ### Foreign names
28
+
29
+ Some names are not ours to choose: a query parameter an outside API reads, an environment variable, an operator a query builder takes. Write such a name as a quoted key, and the naming rules skip it:
30
+
31
+ ```ts
32
+ const query = { "per_page": 50, "sort_by": "created" };
33
+ const env = { "DATABASE_URL": url };
34
+ const where = { "OR": [{ id }, { slug }] };
35
+ ```
36
+
37
+ An unquoted key is our own name and is camelCase or PascalCase. The formatter keeps the quotes as written, so a quoted key stays quoted. A `Schema.Struct` field is the exception: the struct is our model of the data, so the `schema-struct-keys` plugin reports a snake_case field even when it is quoted, and points to `Schema.encodeKeys`, which maps camelCase fields to the outside names at the edge.
38
+
39
+ ### Re-exports
40
+
41
+ No file re-exports, package entry files included: every module is imported from the file that defines it. `noBarrelFile` reports `export { … } from`, `noReExportAll` reports `export *`, the `type-re-exports` plugin reports `export type … from`, and `noExportedImports` reports an import that is exported again. Its message suggests `export … from`, which is a re-export as well: import the name where it is used instead.
42
+
43
+ The plugins report under the one Biome category `plugin`, so their findings share the baseline rule `biome/plugin`.
44
+
45
+ ### Files
46
+
47
+ `files/named-after-export` names a code file after its main export, and the folders above it are the prefix. The export takes the words of the file name, in order, and may add words of its folders around them, in any order and in singular or plural. Folders count from the package root, without a leading `src`; the package name does not count. The file's first letter follows the export's case.
48
+
49
+ | File | Exports | Valid |
50
+ | --- | --- | --- |
51
+ | `routers/items/list.ts` | `listItems` or `itemList` | Yes |
52
+ | `routers/items/Create.ts` | `CreateItemRouter` | Yes |
53
+ | `item/Panel.tsx` or `ItemPanel.tsx` | `ItemPanel`, with `ItemPanelProps` beside it | Yes |
54
+ | `Panel/Panel.tsx` | `Panel`: the main file of a module folder repeats the folder | Yes |
55
+ | `limits.ts` | `MAX_ITEMS` and `MAX_DEPTH`: a topic file of several exports is camelCase | Yes |
56
+ | `ItemPanel.tsx` | `export default memo(ItemPanel)`: a default export counts under the name it resolves to | Yes |
57
+ | `setupTests.ts` | Nothing, so it is camelCase | Yes |
58
+ | `script/build-docs.ts` | Run by a `package.json` script or `bin`, or starts with `#!`, so it is kebab-case | Yes |
59
+ | `order.ts` | `type Order` | No: the file's case follows the export, so it is `Order.ts` |
60
+ | `maxItems.ts` | `MAX_ITEMS` alone | No: constants live in a topic file with related constants |
61
+ | `items/listItems.ts` | `listItems` | No: the folder is the prefix, so it is `items/list.ts` |
62
+
63
+ Test files are left to the test rules. The `toolOwned` option lists `.gitignore` patterns of files whose names a tool fixes, `*.config.*` and declaration files by default.
64
+
65
+ ### Folders
66
+
67
+ `files/folder-names` checks every folder above a checked file.
68
+
69
+ - A module folder takes the name of its main file, inside it or beside it: `Panel/` with `Panel/Panel.tsx`, or `Dialog/` beside `Dialog.tsx`. A PascalCase folder without that file is a finding.
70
+ - A package folder is its package name without the scope, so `@acme/ui-kit` lives in `ui-kit/`.
71
+ - A folder that only groups files is kebab-case: `test-support/`, `.github/`.
72
+ - A folder the `content` option lists is snake_case: `forest_path/`.
73
+
74
+ The `toolOwned` option lists folders a tool names, `migrations/` by default. Authored files under `generated/` follow the same naming checks as other source; ignored, untracked output stays outside discovery.
75
+
76
+ ### Other files
77
+
78
+ `files/other-names` names the files that are not code.
79
+
80
+ - Markdown, JSON, GritQL, images, fonts and SVG are kebab-case, with optional dotted parts: `release-notes.md`, `icons.sprite.svg`. Conventional upper-case names stay: `README.md`, `CHANGELOG.md`, `LICENSE`, `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `SECURITY.md` and `SKILL.md`.
81
+ - A stylesheet that one component imports is named after it: `ItemPanel.css` beside `ItemPanel.tsx`. A shared stylesheet is kebab-case: `form-controls.css`. An import is a static `import` in a code file, relative or through a `#` alias from the `imports` of its `package.json`, or an `@import` in a stylesheet; a stylesheet that another stylesheet imports is shared. A path in a string, such as a test that reads the file, is not an import.
82
+ - A Prisma schema is camelCase: `schema.prisma`.
83
+ - A file the `content` option lists is snake_case: `forest_path.json`. A double underscore separates the parts of an id: `forest_path__clearing.json`.
84
+
85
+ The `toolOwned` option lists files a tool names: dotfiles, `package.json`, `tsconfig*.json`, `biome.json`, `*.config.*` and `migrations/` by default.
86
+
87
+ ### Tests
88
+
89
+ A test sits beside the code it covers, and its name says what it covers and where it runs.
90
+
91
+ | File | Covers | Valid |
92
+ | --- | --- | --- |
93
+ | `cart/cart.test.ts` | `cart/cart.ts` | Yes |
94
+ | `cart/cart.typecheck.test.ts` | The types of `cart/cart.ts`, checked by the compiler | Yes |
95
+ | `cart/Basket.dom.test.tsx` | `cart/Basket.tsx`, in a DOM | Yes |
96
+ | `cart/checkoutFlow.spec.ts` | A behaviour of the `cart/` folder as a whole, such as a flow across several files | Yes |
97
+ | `cart/checkoutFlow.dom.spec.tsx` | The same, in a DOM | Yes |
98
+ | `cart/checkoutFlow.typecheck.spec.ts` | The types of that behaviour, checked by the compiler | Yes |
99
+ | `cart/totals.test.ts` | No `cart/totals.ts` beside it | No: a `.test` follows a file, and a test of the folder is a `.spec` |
100
+ | `cart/cart.spec.ts` | | No: a `.spec` names a behaviour, so it may not share a stem with a file beside it |
101
+ | `cart/cart.hydration.test.ts` | | No: an aspect gets its own file in the module's folder, or a `.spec` |
102
+ | `cart/cart.postgres.test.ts` | | No: a database or a running app comes from the app's test fixture, not a file name |
103
+ | `test/cart.test.ts` | | No: a test folder mirrors the source tree; the test sits beside `cart.ts` |
104
+
105
+ `tests/follow` checks the name: `<file>[.<environment>].test.ts` beside its file, or `<behaviour>[.<environment>].spec.ts` in camelCase in the folder it covers. The environment is at most one of `dom`, `slow` and `typecheck`; [Vitest projects](./tooling.md#vitest-projects) run the runtime tests, and the compiler checks `.typecheck` files. For runtime tests, the rule requires `.dom` when it sees a static `@testing-library/*` import or dotted `document`/`window` member access. It does not track aliases, destructuring or computed access.
106
+
107
+ `tests/colocated` checks the place: a test in a `test`, `tests`, `__tests__` or `spec` folder is a finding.
108
+
109
+ Both rules take a `suites` option, `.gitignore` patterns of folders that hold tests with their own layout, such as tests across several packages or a Playwright suite, whose `.spec.ts` files mean something else. The rules skip those folders.
110
+
111
+ ### Test code
112
+
113
+ Test code is a test file (`*.test.ts` or `*.spec.ts`, with any environment), or any file under a folder named `test-support/`. `test-support/` is the folder for fixtures, harnesses and generated clients that tests share. `imports/fences` never holds test code, and `structure/max-lines` gives it the test limit. `imports/no-test-code` prevents production modules from importing test code; put code they share in a production module.
114
+
115
+ Name shared helpers without a `.test` or `.spec` suffix. `tests/follow` and `tests/colocated` use those suffixes to identify test files; the folder name alone does not make them skip a test-named file. `tests/story-setup` skips every file under `test-support/`, including a test-named file there.
116
+
117
+ ### Story tests
118
+
119
+ Keep recurring setup in a domain kit under `test-support/`; the [test-story README](https://github.com/ShivaeDev/platform/tree/main/packages/test-story#readme) explains traits, verbs and a kit's `it`. Quality checks the setup patterns below; it does not establish which engine a test runs.
120
+
121
+ `tests/story-setup` reports, in a test file:
122
+
123
+ - A top-level function whose name starts with the word `seed`, `make`, `build` or `setup`, declared as a function or a variable holding an arrow function or function expression. The prefix is a whole word, so `builder` and `settings` pass. Nested helpers and declarations without a body are outside this check.
124
+ - A call that writes fixture files through Node's `fs` or `fs/promises`: `writeFile`, `appendFile`, `mkdir`, `mkdtemp`, `copyFile`, `cp` and `symlink`, including their sync forms. Named, renamed, namespace, default and `promises` imports are checked.
125
+
126
+ Each finding names its line and uses the helper or called function as its subject. The message asks for setup as traits of the kit and links to the README's story-test guidance. The rule reports without rewriting a test. Record existing findings with `quality baseline write --rule tests/story-setup` when adopting it.
@@ -0,0 +1,61 @@
1
+ # North star
2
+
3
+ ## The problem
4
+
5
+ Repositories repeat the same quality decisions: which lint rules to enable, which findings to leave as warnings, how to configure formatting and compiler checks, and what an agent should do when a command fails. Copied configs drift. Inline suppressions hide exceptions. A long list of warnings gives an agent no clear obligation to repair the code, and asking every repository to assemble a policy makes adoption another maintenance job.
6
+
7
+ Quality exists to make that decision once. A repository adopts Quality's opinionated policy and shared tooling, then spends its effort on the code. Quality owns check selection and sensible defaults, including the checks it deliberately leaves off internally. An enabled check requires a repair for uncovered findings. The benefit is the same one an opinionated formatter offers: fewer settings to debate, one consistent result and less configuration to maintain.
8
+
9
+ ## The ideal
10
+
11
+ A consuming repository gets the whole policy. It does not select a preset of standards, turn a Quality rule off or demote it to a warning. Quality decides which checks belong together and explains their repairs. Internal exceptions belong to the package and have reasons; they are part of its judgement, not a template of switches for consumers to copy.
12
+
13
+ The repository supplies facts Quality cannot infer: where the source and generated files live, which architectural boundaries its imports must respect, and which additional commands a commit must run. Shared Biome and TypeScript configuration and Vitest helpers carry the package's conventions into those tools. The usual setup should stay small, with defaults that make sense together.
14
+
15
+ Adopting the whole policy does not require fixing all old debt in one change. The baseline records existing findings by rule and file while the checks stay strict. An uncovered finding asks for a repair. Fixing debt passes immediately, and lowering tools reduce its recorded counts. A permitted permanent exception lives in a registry with a reason. When that exception no longer applies, the gate asks for its removal.
16
+
17
+ Every finding should tell an agent that has never used the package what to change. It names the rule and identifies the file and line when available. Invalid input, an unreadable policy or an import boundary with contradictory examples must stop the run rather than make a check silently narrower.
18
+
19
+ ## What good looks like
20
+
21
+ - Adoption is a small setup task. A repository uses the shared defaults instead of maintaining its own catalogue of rules and levels.
22
+ - Quality's rules, tool configuration and internal exceptions express one policy. A new shared convention belongs here, with a reason and accepted and rejected examples.
23
+ - Repository-specific inputs describe code and architecture. A generated path or import fence does not become permission to choose a weaker standard.
24
+ - The config, inventory, rule evaluation, registry, baseline and report form one path. Checks use that path instead of inventing their own debt handling.
25
+ - A rule defines exactly what it checks. CLI and git promises have real-command tests; package promises have installed-consumer tests. Messages never imply stronger guarantees than those tests prove.
26
+ - Debt diffs are reviewable. Lowering one entry preserves unrelated lines, and a tracked move can carry the debt it already had.
27
+ - The author retains choices the checker cannot make, including symbol names, semantic code order and whether a newly recorded finding is acceptable debt.
28
+
29
+ ## Trade-offs
30
+
31
+ ### Shared defaults and repository facts
32
+
33
+ A new setting creates a decision every consuming repository must make and maintain. Prefer improving the shared default. Add an input when the check needs a fact about the repository, not merely because another repository prefers a different rule or threshold. Quality can disable a tool rule internally when another tool owns the check or the rule cannot make a reliable judgement. That reason belongs with the shared configuration.
34
+
35
+ The public configuration surface and its gaps are recorded in the [roadmap](./roadmap.md). Usage documentation must describe what the code actually accepts without turning an implementation gap into recommended policy.
36
+
37
+ ### Strictness and adoption
38
+
39
+ Adopt the policy as a whole; record old debt instead of weakening it. The baseline exposes uncovered findings without demanding an immediate clean-up of every file. It is a record to review, not proof that retained debt is harmless. Explicit recording can raise counts, and a reviewer owns whether that growth is justified. A registry entry is for an enduring, explained exception a rule permits, not a substitute for following that rule.
40
+
41
+ ### Automation and judgement
42
+
43
+ A useful fix removes mechanical work. It must not take ownership of a choice the author needs to make. Selected fixes are disabled internally, and naming checks report without renaming. Biome also has enabled unsafe fixes, so `quality fix` requires review and must never promise to preserve every behavior.
44
+
45
+ ### One policy and specialized tools
46
+
47
+ Quality coordinates Biome, TypeScript, Vitest and git instead of replacing their compilers, parsers or runners. These tool entry points share the policy; they are not separate menus of standards to adopt. Their native behavior remains visible enough to diagnose a mismatch. A pre-commit hook uses the committing worktree's config and dependencies.
48
+
49
+ ### Static evidence and runtime evidence
50
+
51
+ A rule can require a test's name or report a fixture-writing call. It cannot establish that the test reaches the real engine. A fence's legal and illegal chains show that an import policy means what its author intended; they do not establish an application's deployment behavior. Runtime proof belongs in the application and the packages that execute it.
52
+
53
+ ## What it deliberately leaves out
54
+
55
+ - A consumer warning mode, rule-selection menu or set of competing opt-in quality policies as the adoption model.
56
+ - A requirement for every repository to build its own rules or copy a complicated config before it can use Quality.
57
+ - Application services, persistence, transactions, request identity, client state and other runtime framework jobs. Their owning packages implement them.
58
+ - A replacement for TypeScript, Biome, Vitest or git.
59
+ - Automatic approval of baseline growth or a registry reason. Review owns whether retained debt is justified.
60
+ - A promise that static imports reproduce every runtime loader or that syntax rules prove business behavior.
61
+ - Renaming public symbols or changing APIs to satisfy a rule whose maintainer decision remains open.
@@ -0,0 +1,37 @@
1
+ # Roadmap
2
+
3
+ This page owns Quality's shared policy, tooling, CLI and hook implementation status and the policy questions below. The [framework roadmap](https://github.com/ShivaeDev/platform/blob/main/docs/framework/roadmap.md) owns adoption across packages and hosts, integration and deployment validation; it links here for quality implementation work.
4
+
5
+ ## Built
6
+
7
+ - [x] Optional typed and runtime-validated config with config-free defaults; built-in and local rules enforced at `error`; local-rule and Standard Schema option APIs; one checked inventory and one report grouped by rule.
8
+ - [x] The public config rejects `warn`, `off`, raised thresholds, inventory exclusions and custom test-file patterns. Vitest projects reject suite exclusions. Reasoned Biome declarations cover individual rules on explicit files and named directory exclusions.
9
+ - [x] A JSON Lines baseline with counted debt, explicit named-rule recording, lowering and pruning, tracked-move handling and preservation of unrelated lines.
10
+ - [x] A registry of reasoned exceptions with optional subjects, detection of stale entries and rules that refuse exceptions.
11
+ - [x] File-size and comment rules; inline-suppression, double-cast, deprecation-setting and declared-Biome-override checks.
12
+ - [x] A shared Biome preset and bridge whose error findings use the gate's baseline; enforcement of the installed Biome's recommended rules; bounded fix rounds and selected fixes left to the author.
13
+ - [x] Static import resolution, rejection of production imports of test code, runtime-cycle checks, same-folder relative imports and direct, transitive and vocabulary fences with validated examples.
14
+ - [x] Manifest sorting and identifier, file, folder, content, test-layout and story-setup conventions.
15
+ - [x] Shared type-check and package-build TypeScript presets; Vitest unit, DOM and opt-in slow projects, excluded type tests and inherited project tags.
16
+ - [x] Opt-in pre-commit hooks with per-worktree config and dependencies, conventional `typecheck` and `quality:commit` scripts, and explicit installation.
17
+ - [x] Seeded-repository and real-command tests for the gate, import policies, Biome, baseline and git hooks, plus packed consumer checks for the CLI and presets.
18
+ - [x] Separate shipped Biome declarations from consumer exceptions; reject whole-check, group and blanket-scope consumer declarations.
19
+
20
+ ## Next
21
+
22
+ - [ ] Remove obsolete CLI warning-report controls; config levels are already enforced at `error`. Keep old-debt adoption in the baseline.
23
+ - [ ] Reduce policy-tuning inputs to the ones checks need about a repository. Thresholds can only be lowered; local-rule APIs remain exposed. Review the remaining extension boundary.
24
+ - [ ] Port reusable checks still in `script/lint/rules/` into the shared policy, so consumers do not copy Platform's scripts.
25
+ - [ ] Split Grit implementation modules by the checks they own, without making consumers select competing presets; route Platform's remaining static checks through Quality.
26
+ - [ ] Define the Effect-boundary rule's source and test scope before porting the repository's `try`/`async` restrictions.
27
+ - [ ] Define the service-parameter policy before enforcing it against public helpers that accept services or `Context`.
28
+
29
+ ## Open questions
30
+
31
+ The whole-policy direction is settled: Quality selects which checks run, and enabled checks should fail on uncovered findings; repositories adopt its defaults. The questions below concern how to implement that policy and where checks apply.
32
+
33
+ - **Extension policy.** Which repository-specific local-rule APIs and Biome declarations should remain public? Consumer rule switches, raised limits and exclusions are rejected immediately with a migration fragment.
34
+ - **Effect boundaries in tests.** Should tests follow the same Effect-only boundaries as shipped code, use a test-specific adapter scope, or remain exempt? The repository rule and test fixture patterns do not settle this policy.
35
+ - **Services as parameters.** Should a rule cover only service implementation methods, allow explicit integration helpers, or require public APIs that accept services or `Context` to change? The maintainer owns those API decisions before a reusable rule can enforce them.
36
+ - **Strict boolean expressions.** Should the preset enable Biome's nursery `useStrictBooleanExpressions`? It reports truthiness checks whose falsy cases differ, such as `if (value)` on `string | undefined`, where an empty string reads as missing. It has 63 findings across this repository, mostly in `work-fleet` and `work-board`, and some of them rely on `||` treating `""` as absent on purpose. The open choice is whether to adopt it with the existing findings in the baseline or fix them first, and whether to wait until Biome's reworked type inference behind the rule settles.
37
+ - **Module exports.** The `./*.ts` export pattern makes implementation modules accessible alongside config, rules, fences and Vitest helpers. Which of those modules should consumers treat as extension APIs? Documentation lists the current exports; changing their public boundary requires a maintainer decision.