@shivaedev/quality 0.56.0 → 0.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (459) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +63 -4
  3. package/biome/plugins/effect-test-bodies.grit +1 -1
  4. package/dist/{rules/suppressions → adapters}/biome/configs.d.ts +2 -2
  5. package/dist/adapters/biome/configs.d.ts.map +1 -0
  6. package/dist/{rules/suppressions → adapters}/biome/configs.js +2 -2
  7. package/dist/adapters/biome/configs.js.map +1 -0
  8. package/dist/adapters/biome/presetConfig.d.ts +21 -0
  9. package/dist/adapters/biome/presetConfig.d.ts.map +1 -0
  10. package/dist/adapters/biome/presetConfig.js +32 -0
  11. package/dist/adapters/biome/presetConfig.js.map +1 -0
  12. package/dist/adapters/biome/relocateConfig.d.ts.map +1 -0
  13. package/dist/adapters/biome/relocateConfig.js.map +1 -0
  14. package/dist/adapters/biome/resolvePackage.d.ts.map +1 -0
  15. package/dist/adapters/biome/resolvePackage.js.map +1 -0
  16. package/dist/adapters/biome/rootConfig.d.ts +9 -0
  17. package/dist/adapters/biome/rootConfig.d.ts.map +1 -0
  18. package/dist/adapters/biome/rootConfig.js +11 -0
  19. package/dist/adapters/biome/rootConfig.js.map +1 -0
  20. package/dist/adapters/biome/run.js +1 -1
  21. package/dist/adapters/biome/run.js.map +1 -1
  22. package/dist/adapters/biome/syntaxOf.d.ts +3 -0
  23. package/dist/adapters/biome/syntaxOf.d.ts.map +1 -0
  24. package/dist/adapters/biome/syntaxOf.js +11 -0
  25. package/dist/adapters/biome/syntaxOf.js.map +1 -0
  26. package/dist/adapters/biome/withExceptionConfig.d.ts +8 -0
  27. package/dist/adapters/biome/withExceptionConfig.d.ts.map +1 -0
  28. package/dist/adapters/biome/withExceptionConfig.js +38 -0
  29. package/dist/adapters/biome/withExceptionConfig.js.map +1 -0
  30. package/dist/adapters/changeKeyApi.d.ts +4 -0
  31. package/dist/adapters/changeKeyApi.d.ts.map +1 -0
  32. package/dist/adapters/changeKeyApi.js +58 -0
  33. package/dist/adapters/changeKeyApi.js.map +1 -0
  34. package/dist/adapters/changeKeyFindings.d.ts +4 -0
  35. package/dist/adapters/changeKeyFindings.d.ts.map +1 -0
  36. package/dist/adapters/changeKeyFindings.js +87 -0
  37. package/dist/adapters/changeKeyFindings.js.map +1 -0
  38. package/dist/adapters/changeKeyLiterals.d.ts +3 -0
  39. package/dist/adapters/changeKeyLiterals.d.ts.map +1 -0
  40. package/dist/adapters/changeKeyLiterals.js +56 -0
  41. package/dist/adapters/changeKeyLiterals.js.map +1 -0
  42. package/dist/adapters/executable.d.ts +3 -0
  43. package/dist/adapters/executable.d.ts.map +1 -0
  44. package/dist/adapters/executable.js +14 -0
  45. package/dist/adapters/executable.js.map +1 -0
  46. package/dist/adapters/ignore.d.ts +10 -0
  47. package/dist/adapters/ignore.d.ts.map +1 -0
  48. package/dist/adapters/ignore.js +10 -0
  49. package/dist/adapters/ignore.js.map +1 -0
  50. package/dist/adapters/imports/fakeReferences.d.ts +14 -0
  51. package/dist/adapters/imports/fakeReferences.d.ts.map +1 -0
  52. package/dist/adapters/imports/fakeReferences.js +103 -0
  53. package/dist/adapters/imports/fakeReferences.js.map +1 -0
  54. package/dist/adapters/imports/fakeTargets.d.ts +13 -0
  55. package/dist/adapters/imports/fakeTargets.d.ts.map +1 -0
  56. package/dist/adapters/imports/fakeTargets.js +14 -0
  57. package/dist/adapters/imports/fakeTargets.js.map +1 -0
  58. package/dist/adapters/outsideImportFindings.d.ts +5 -0
  59. package/dist/adapters/outsideImportFindings.d.ts.map +1 -0
  60. package/dist/adapters/outsideImportFindings.js +78 -0
  61. package/dist/adapters/outsideImportFindings.js.map +1 -0
  62. package/dist/adapters/queueReadoutFindings.d.ts +8 -0
  63. package/dist/adapters/queueReadoutFindings.d.ts.map +1 -0
  64. package/dist/adapters/queueReadoutFindings.js +30 -0
  65. package/dist/adapters/queueReadoutFindings.js.map +1 -0
  66. package/dist/adapters/queueTestingOrigin.d.ts +5 -0
  67. package/dist/adapters/queueTestingOrigin.d.ts.map +1 -0
  68. package/dist/adapters/queueTestingOrigin.js +95 -0
  69. package/dist/adapters/queueTestingOrigin.js.map +1 -0
  70. package/dist/adapters/readConfig.d.ts +7 -0
  71. package/dist/adapters/readConfig.d.ts.map +1 -0
  72. package/dist/adapters/readConfig.js +40 -0
  73. package/dist/adapters/readConfig.js.map +1 -0
  74. package/dist/adapters/serviceIdFindings.d.ts +4 -0
  75. package/dist/adapters/serviceIdFindings.d.ts.map +1 -0
  76. package/dist/adapters/serviceIdFindings.js +65 -0
  77. package/dist/adapters/serviceIdFindings.js.map +1 -0
  78. package/dist/adapters/sharedErrorFindings.d.ts +4 -0
  79. package/dist/adapters/sharedErrorFindings.d.ts.map +1 -0
  80. package/dist/adapters/sharedErrorFindings.js +71 -0
  81. package/dist/adapters/sharedErrorFindings.js.map +1 -0
  82. package/dist/adapters/sharedErrorModules.d.ts +7 -0
  83. package/dist/adapters/sharedErrorModules.d.ts.map +1 -0
  84. package/dist/adapters/sharedErrorModules.js +66 -0
  85. package/dist/adapters/sharedErrorModules.js.map +1 -0
  86. package/dist/adapters/testProjects.d.ts.map +1 -1
  87. package/dist/adapters/testProjects.js +18 -2
  88. package/dist/adapters/testProjects.js.map +1 -1
  89. package/dist/appTestConfig.d.ts +1 -1
  90. package/dist/appTestConfig.d.ts.map +1 -1
  91. package/dist/appTestConfig.js.map +1 -1
  92. package/dist/baseline/cleanupMergeFiles.d.ts.map +1 -1
  93. package/dist/baseline/cleanupMergeFiles.js +3 -2
  94. package/dist/baseline/cleanupMergeFiles.js.map +1 -1
  95. package/dist/baseline/shards.d.ts.map +1 -1
  96. package/dist/baseline/shards.js +4 -2
  97. package/dist/baseline/shards.js.map +1 -1
  98. package/dist/biome/exceptionConfig.d.ts +0 -7
  99. package/dist/biome/exceptionConfig.d.ts.map +1 -1
  100. package/dist/biome/exceptionConfig.js +0 -36
  101. package/dist/biome/exceptionConfig.js.map +1 -1
  102. package/dist/biome/recognizeDiagnostics.d.ts.map +1 -1
  103. package/dist/biome/recognizeDiagnostics.js +2 -1
  104. package/dist/biome/recognizeDiagnostics.js.map +1 -1
  105. package/dist/biome/recommendedRules.d.ts.map +1 -1
  106. package/dist/biome/recommendedRules.js +3 -2
  107. package/dist/biome/recommendedRules.js.map +1 -1
  108. package/dist/biome/report.d.ts.map +1 -1
  109. package/dist/biome/report.js +3 -2
  110. package/dist/biome/report.js.map +1 -1
  111. package/dist/biome/syntax.d.ts +0 -1
  112. package/dist/biome/syntax.d.ts.map +1 -1
  113. package/dist/biome/syntax.js +0 -9
  114. package/dist/biome/syntax.js.map +1 -1
  115. package/dist/biome/withoutEntryPointImports.d.ts +32 -2
  116. package/dist/biome/withoutEntryPointImports.d.ts.map +1 -1
  117. package/dist/biome/withoutEntryPointImports.js +12 -10
  118. package/dist/biome/withoutEntryPointImports.js.map +1 -1
  119. package/dist/cli/baseline.d.ts.map +1 -1
  120. package/dist/cli/baseline.js +3 -2
  121. package/dist/cli/baseline.js.map +1 -1
  122. package/dist/cli/fix.d.ts.map +1 -1
  123. package/dist/cli/fix.js +3 -2
  124. package/dist/cli/fix.js.map +1 -1
  125. package/dist/cli/fixRule.d.ts.map +1 -1
  126. package/dist/cli/fixRule.js +4 -3
  127. package/dist/cli/fixRule.js.map +1 -1
  128. package/dist/cli/lint.d.ts.map +1 -1
  129. package/dist/cli/lint.js +2 -2
  130. package/dist/cli/lint.js.map +1 -1
  131. package/dist/cli/migrateBaseline.d.ts.map +1 -1
  132. package/dist/cli/migrateBaseline.js +3 -2
  133. package/dist/cli/migrateBaseline.js.map +1 -1
  134. package/dist/cli/migrateExceptions.d.ts.map +1 -1
  135. package/dist/cli/migrateExceptions.js +3 -2
  136. package/dist/cli/migrateExceptions.js.map +1 -1
  137. package/dist/config/globs.d.ts.map +1 -1
  138. package/dist/config/globs.js +1 -5
  139. package/dist/config/globs.js.map +1 -1
  140. package/dist/config/load.d.ts +2 -2
  141. package/dist/config/load.d.ts.map +1 -1
  142. package/dist/config/load.js +6 -36
  143. package/dist/config/load.js.map +1 -1
  144. package/dist/domEnvironment.config.js +1 -1
  145. package/dist/domEnvironment.config.js.map +1 -1
  146. package/dist/engine/session.d.ts.map +1 -1
  147. package/dist/engine/session.js +3 -2
  148. package/dist/engine/session.js.map +1 -1
  149. package/dist/exceptions/biomeFindings.d.ts +1 -1
  150. package/dist/exceptions/biomeFindings.d.ts.map +1 -1
  151. package/dist/exceptions/biomeFindings.js +10 -6
  152. package/dist/exceptions/biomeFindings.js.map +1 -1
  153. package/dist/hooks/install.d.ts.map +1 -1
  154. package/dist/hooks/install.js +4 -2
  155. package/dist/hooks/install.js.map +1 -1
  156. package/dist/hooks/location.d.ts.map +1 -1
  157. package/dist/hooks/location.js +3 -2
  158. package/dist/hooks/location.js.map +1 -1
  159. package/dist/hooks/preCommit.d.ts.map +1 -1
  160. package/dist/hooks/preCommit.js +3 -2
  161. package/dist/hooks/preCommit.js.map +1 -1
  162. package/dist/hooks/setup.d.ts.map +1 -1
  163. package/dist/hooks/setup.js +3 -2
  164. package/dist/hooks/setup.js.map +1 -1
  165. package/dist/hooks/status.d.ts.map +1 -1
  166. package/dist/hooks/status.js +5 -15
  167. package/dist/hooks/status.js.map +1 -1
  168. package/dist/hooks/uninstall.d.ts.map +1 -1
  169. package/dist/hooks/uninstall.js +3 -2
  170. package/dist/hooks/uninstall.js.map +1 -1
  171. package/dist/inventory/collect.js +2 -2
  172. package/dist/inventory/collect.js.map +1 -1
  173. package/dist/inventory/filesystem.d.ts.map +1 -1
  174. package/dist/inventory/filesystem.js +3 -2
  175. package/dist/inventory/filesystem.js.map +1 -1
  176. package/dist/inventory/ignoreScope.d.ts +2 -2
  177. package/dist/inventory/ignoreScope.d.ts.map +1 -1
  178. package/dist/inventory/ignoreScope.js +2 -2
  179. package/dist/inventory/ignoreScope.js.map +1 -1
  180. package/dist/inventory/shadcnFolders.d.ts.map +1 -1
  181. package/dist/inventory/shadcnFolders.js +4 -2
  182. package/dist/inventory/shadcnFolders.js.map +1 -1
  183. package/dist/inventory/trackedPaths.d.ts.map +1 -1
  184. package/dist/inventory/trackedPaths.js +4 -2
  185. package/dist/inventory/trackedPaths.js.map +1 -1
  186. package/dist/naming/packageLayout.d.ts +2 -1
  187. package/dist/naming/packageLayout.d.ts.map +1 -1
  188. package/dist/naming/packageLayout.js +4 -6
  189. package/dist/naming/packageLayout.js.map +1 -1
  190. package/dist/naming/testName.d.ts +1 -1
  191. package/dist/naming/testName.d.ts.map +1 -1
  192. package/dist/naming/testName.js +1 -1
  193. package/dist/naming/testName.js.map +1 -1
  194. package/dist/rules/biome.d.ts +1 -8
  195. package/dist/rules/biome.d.ts.map +1 -1
  196. package/dist/rules/biome.js +6 -15
  197. package/dist/rules/biome.js.map +1 -1
  198. package/dist/rules/builtIn.d.ts +2 -2
  199. package/dist/rules/builtIn.d.ts.map +1 -1
  200. package/dist/rules/builtIn.js +12 -0
  201. package/dist/rules/builtIn.js.map +1 -1
  202. package/dist/rules/effect/adapterImports.d.ts +2 -0
  203. package/dist/rules/effect/adapterImports.d.ts.map +1 -0
  204. package/dist/rules/effect/adapterImports.js +9 -0
  205. package/dist/rules/effect/adapterImports.js.map +1 -0
  206. package/dist/rules/effect/program.d.ts +1 -1
  207. package/dist/rules/effect/program.d.ts.map +1 -1
  208. package/dist/rules/effect/program.js +2 -2
  209. package/dist/rules/effect/program.js.map +1 -1
  210. package/dist/rules/effect/serviceIds.d.ts +2 -0
  211. package/dist/rules/effect/serviceIds.d.ts.map +1 -0
  212. package/dist/rules/effect/serviceIds.js +9 -0
  213. package/dist/rules/effect/serviceIds.js.map +1 -0
  214. package/dist/rules/effect/sharedErrorClasses.d.ts +2 -0
  215. package/dist/rules/effect/sharedErrorClasses.d.ts.map +1 -0
  216. package/dist/rules/effect/sharedErrorClasses.js +9 -0
  217. package/dist/rules/effect/sharedErrorClasses.js.map +1 -0
  218. package/dist/rules/files/folderNames.d.ts.map +1 -1
  219. package/dist/rules/files/folderNames.js +7 -7
  220. package/dist/rules/files/folderNames.js.map +1 -1
  221. package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
  222. package/dist/rules/files/namedAfterExport.js +6 -6
  223. package/dist/rules/files/namedAfterExport.js.map +1 -1
  224. package/dist/rules/files/otherNames.d.ts.map +1 -1
  225. package/dist/rules/files/otherNames.js +7 -7
  226. package/dist/rules/files/otherNames.js.map +1 -1
  227. package/dist/rules/files/packageImports.d.ts +2 -1
  228. package/dist/rules/files/packageImports.d.ts.map +1 -1
  229. package/dist/rules/files/packageImports.js +4 -3
  230. package/dist/rules/files/packageImports.js.map +1 -1
  231. package/dist/rules/files/stylesheetImporters.d.ts +2 -1
  232. package/dist/rules/files/stylesheetImporters.d.ts.map +1 -1
  233. package/dist/rules/files/stylesheetImporters.js +5 -4
  234. package/dist/rules/files/stylesheetImporters.js.map +1 -1
  235. package/dist/rules/imports/manifest.d.ts.map +1 -1
  236. package/dist/rules/imports/manifest.js +9 -6
  237. package/dist/rules/imports/manifest.js.map +1 -1
  238. package/dist/rules/manifestsApplication.d.ts.map +1 -1
  239. package/dist/rules/manifestsApplication.js +22 -22
  240. package/dist/rules/manifestsApplication.js.map +1 -1
  241. package/dist/rules/manifestsExportsShape.d.ts.map +1 -1
  242. package/dist/rules/manifestsExportsShape.js +32 -8
  243. package/dist/rules/manifestsExportsShape.js.map +1 -1
  244. package/dist/rules/manifestsSorted.d.ts.map +1 -1
  245. package/dist/rules/manifestsSorted.js +6 -5
  246. package/dist/rules/manifestsSorted.js.map +1 -1
  247. package/dist/rules/manifestsSourceFirst.d.ts.map +1 -1
  248. package/dist/rules/manifestsSourceFirst.js +6 -5
  249. package/dist/rules/manifestsSourceFirst.js.map +1 -1
  250. package/dist/rules/stories/adapterOnlyFakes.d.ts +2 -0
  251. package/dist/rules/stories/adapterOnlyFakes.d.ts.map +1 -0
  252. package/dist/rules/stories/adapterOnlyFakes.js +63 -0
  253. package/dist/rules/stories/adapterOnlyFakes.js.map +1 -0
  254. package/dist/rules/stories/fakeImplementation.d.ts +4 -0
  255. package/dist/rules/stories/fakeImplementation.d.ts.map +1 -0
  256. package/dist/rules/stories/fakeImplementation.js +22 -0
  257. package/dist/rules/stories/fakeImplementation.js.map +1 -0
  258. package/dist/rules/stories/fakeReplacements.d.ts +4 -0
  259. package/dist/rules/stories/fakeReplacements.d.ts.map +1 -0
  260. package/dist/rules/stories/fakeReplacements.js +71 -0
  261. package/dist/rules/stories/fakeReplacements.js.map +1 -0
  262. package/dist/rules/stories/importOrigin.js +2 -2
  263. package/dist/rules/stories/importOrigin.js.map +1 -1
  264. package/dist/rules/stories/importedChangeKeys.d.ts +2 -0
  265. package/dist/rules/stories/importedChangeKeys.d.ts.map +1 -0
  266. package/dist/rules/stories/importedChangeKeys.js +9 -0
  267. package/dist/rules/stories/importedChangeKeys.js.map +1 -0
  268. package/dist/rules/stories/pureNetImport.d.ts +4 -0
  269. package/dist/rules/stories/pureNetImport.d.ts.map +1 -0
  270. package/dist/rules/stories/pureNetImport.js +23 -0
  271. package/dist/rules/stories/pureNetImport.js.map +1 -0
  272. package/dist/rules/stories/queueReadouts.d.ts +2 -0
  273. package/dist/rules/stories/queueReadouts.d.ts.map +1 -0
  274. package/dist/rules/stories/queueReadouts.js +9 -0
  275. package/dist/rules/stories/queueReadouts.js.map +1 -0
  276. package/dist/rules/stories/unitTests.d.ts.map +1 -1
  277. package/dist/rules/stories/unitTests.js +4 -3
  278. package/dist/rules/stories/unitTests.js.map +1 -1
  279. package/dist/rules/suppressions/biome/weakenings.d.ts +1 -1
  280. package/dist/rules/suppressions/biome/weakenings.d.ts.map +1 -1
  281. package/dist/rules/suppressions/biomeOverrides.d.ts.map +1 -1
  282. package/dist/rules/suppressions/biomeOverrides.js +5 -5
  283. package/dist/rules/suppressions/biomeOverrides.js.map +1 -1
  284. package/dist/rules/suppressions/biomeRecommended.d.ts +1 -1
  285. package/dist/rules/suppressions/biomeRecommended.d.ts.map +1 -1
  286. package/dist/rules/suppressions/biomeRecommended.js +12 -30
  287. package/dist/rules/suppressions/biomeRecommended.js.map +1 -1
  288. package/dist/rules/suppressions/noIgnoreDeprecations.d.ts.map +1 -1
  289. package/dist/rules/suppressions/noIgnoreDeprecations.js +3 -2
  290. package/dist/rules/suppressions/noIgnoreDeprecations.js.map +1 -1
  291. package/dist/rules/test-names/colocated.js +2 -2
  292. package/dist/rules/test-names/colocated.js.map +1 -1
  293. package/dist/rules/test-names/follow.js +4 -4
  294. package/dist/rules/test-names/follow.js.map +1 -1
  295. package/dist/testing/adapters/assertThat.d.ts +5 -0
  296. package/dist/testing/adapters/assertThat.d.ts.map +1 -0
  297. package/dist/testing/adapters/assertThat.js +9 -0
  298. package/dist/testing/adapters/assertThat.js.map +1 -0
  299. package/dist/testing/adapters/cli.d.ts +21 -0
  300. package/dist/testing/adapters/cli.d.ts.map +1 -0
  301. package/dist/testing/adapters/cli.js +85 -0
  302. package/dist/testing/adapters/cli.js.map +1 -0
  303. package/dist/testing/adapters/git.d.ts +14 -0
  304. package/dist/testing/adapters/git.d.ts.map +1 -0
  305. package/dist/testing/adapters/git.js +52 -0
  306. package/dist/testing/adapters/git.js.map +1 -0
  307. package/dist/testing/adapters/hookPath.d.ts +2 -0
  308. package/dist/testing/adapters/hookPath.d.ts.map +1 -0
  309. package/dist/testing/adapters/hookPath.js +6 -0
  310. package/dist/testing/adapters/hookPath.js.map +1 -0
  311. package/dist/testing/adapters/hookRepository.d.ts +25 -0
  312. package/dist/testing/adapters/hookRepository.d.ts.map +1 -0
  313. package/dist/testing/adapters/hookRepository.js +96 -0
  314. package/dist/testing/adapters/hookRepository.js.map +1 -0
  315. package/dist/testing/adapters/imports.d.ts +5 -0
  316. package/dist/testing/adapters/imports.d.ts.map +1 -0
  317. package/dist/testing/adapters/imports.js +29 -0
  318. package/dist/testing/adapters/imports.js.map +1 -0
  319. package/dist/testing/adapters/packageExports.d.ts +15 -0
  320. package/dist/testing/adapters/packageExports.d.ts.map +1 -0
  321. package/dist/testing/adapters/packageExports.js +29 -0
  322. package/dist/testing/adapters/packageExports.js.map +1 -0
  323. package/dist/testing/adapters/qualityTree.d.ts +4 -0
  324. package/dist/testing/adapters/qualityTree.d.ts.map +1 -0
  325. package/dist/testing/adapters/qualityTree.js +21 -0
  326. package/dist/testing/adapters/qualityTree.js.map +1 -0
  327. package/dist/testing/adapters/run.d.ts +4 -0
  328. package/dist/testing/adapters/run.d.ts.map +1 -0
  329. package/dist/testing/adapters/run.js +6 -0
  330. package/dist/testing/adapters/run.js.map +1 -0
  331. package/dist/testing/adapters/storySpecFiles.d.ts +7 -0
  332. package/dist/testing/adapters/storySpecFiles.d.ts.map +1 -0
  333. package/dist/testing/adapters/storySpecFiles.js +48 -0
  334. package/dist/testing/adapters/storySpecFiles.js.map +1 -0
  335. package/dist/testing/adapters/tree.d.ts +13 -0
  336. package/dist/testing/adapters/tree.d.ts.map +1 -0
  337. package/dist/testing/adapters/tree.js +42 -0
  338. package/dist/testing/adapters/tree.js.map +1 -0
  339. package/dist/testing/adapters/writePackageExports.d.ts +2 -0
  340. package/dist/testing/adapters/writePackageExports.d.ts.map +1 -0
  341. package/dist/testing/adapters/writePackageExports.js +9 -0
  342. package/dist/testing/adapters/writePackageExports.js.map +1 -0
  343. package/dist/testing/ruleStory.d.ts +28 -0
  344. package/dist/testing/ruleStory.d.ts.map +1 -0
  345. package/dist/testing/ruleStory.js +115 -0
  346. package/dist/testing/ruleStory.js.map +1 -0
  347. package/dist/unitIoGuard.config.js +1 -1
  348. package/dist/unitIoGuard.config.js.map +1 -1
  349. package/package.json +8 -2
  350. package/src/{rules/suppressions → adapters}/biome/configs.ts +2 -2
  351. package/src/adapters/biome/presetConfig.ts +34 -0
  352. package/src/adapters/biome/rootConfig.ts +19 -0
  353. package/src/adapters/biome/run.ts +1 -1
  354. package/src/adapters/biome/syntaxOf.ts +12 -0
  355. package/src/adapters/biome/withExceptionConfig.ts +45 -0
  356. package/src/adapters/changeKeyApi.ts +62 -0
  357. package/src/adapters/changeKeyFindings.ts +96 -0
  358. package/src/adapters/changeKeyLiterals.ts +60 -0
  359. package/src/adapters/executable.ts +14 -0
  360. package/src/adapters/ignore.ts +16 -0
  361. package/src/adapters/imports/fakeReferences.ts +115 -0
  362. package/src/adapters/imports/fakeTargets.ts +21 -0
  363. package/src/adapters/outsideImportFindings.ts +98 -0
  364. package/src/adapters/queueReadoutFindings.ts +37 -0
  365. package/src/adapters/queueTestingOrigin.ts +113 -0
  366. package/src/adapters/readConfig.ts +42 -0
  367. package/src/adapters/serviceIdFindings.ts +80 -0
  368. package/src/adapters/sharedErrorFindings.ts +84 -0
  369. package/src/adapters/sharedErrorModules.ts +81 -0
  370. package/src/adapters/testProjects.ts +18 -2
  371. package/src/appTestConfig.ts +1 -1
  372. package/src/baseline/cleanupMergeFiles.ts +4 -2
  373. package/src/baseline/shards.ts +6 -2
  374. package/src/biome/exceptionConfig.ts +0 -43
  375. package/src/biome/recognizeDiagnostics.ts +2 -1
  376. package/src/biome/recommendedRules.ts +4 -2
  377. package/src/biome/report.ts +4 -2
  378. package/src/biome/syntax.ts +0 -10
  379. package/src/biome/withoutEntryPointImports.ts +15 -10
  380. package/src/cli/baseline.ts +4 -2
  381. package/src/cli/fix.ts +4 -2
  382. package/src/cli/fixRule.ts +5 -3
  383. package/src/cli/lint.ts +3 -2
  384. package/src/cli/migrateBaseline.ts +4 -2
  385. package/src/cli/migrateExceptions.ts +4 -2
  386. package/src/config/globs.ts +1 -6
  387. package/src/config/load.ts +8 -38
  388. package/src/domEnvironment.config.ts +1 -1
  389. package/src/engine/session.ts +4 -2
  390. package/src/exceptions/biomeFindings.ts +11 -10
  391. package/src/hooks/install.ts +6 -2
  392. package/src/hooks/location.ts +4 -2
  393. package/src/hooks/preCommit.ts +4 -2
  394. package/src/hooks/setup.ts +4 -2
  395. package/src/hooks/status.ts +7 -15
  396. package/src/hooks/uninstall.ts +4 -2
  397. package/src/inventory/collect.ts +2 -2
  398. package/src/inventory/filesystem.ts +4 -2
  399. package/src/inventory/ignoreScope.ts +3 -3
  400. package/src/inventory/shadcnFolders.ts +6 -2
  401. package/src/inventory/trackedPaths.ts +6 -2
  402. package/src/naming/packageLayout.ts +14 -7
  403. package/src/naming/testName.ts +1 -1
  404. package/src/rules/biome.ts +6 -23
  405. package/src/rules/builtIn.ts +12 -0
  406. package/src/rules/effect/adapterImports.ts +10 -0
  407. package/src/rules/effect/program.ts +2 -2
  408. package/src/rules/effect/serviceIds.ts +10 -0
  409. package/src/rules/effect/sharedErrorClasses.ts +10 -0
  410. package/src/rules/files/folderNames.ts +19 -18
  411. package/src/rules/files/namedAfterExport.ts +10 -9
  412. package/src/rules/files/otherNames.ts +17 -16
  413. package/src/rules/files/packageImports.ts +14 -4
  414. package/src/rules/files/stylesheetImporters.ts +13 -6
  415. package/src/rules/imports/manifest.ts +14 -8
  416. package/src/rules/manifestsApplication.ts +44 -33
  417. package/src/rules/manifestsExportsShape.ts +45 -15
  418. package/src/rules/manifestsSorted.ts +16 -11
  419. package/src/rules/manifestsSourceFirst.ts +22 -17
  420. package/src/rules/stories/adapterOnlyFakes.ts +66 -0
  421. package/src/rules/stories/fakeImplementation.ts +23 -0
  422. package/src/rules/stories/fakeReplacements.ts +74 -0
  423. package/src/rules/stories/importOrigin.ts +2 -2
  424. package/src/rules/stories/importedChangeKeys.ts +10 -0
  425. package/src/rules/stories/pureNetImport.ts +29 -0
  426. package/src/rules/stories/queueReadouts.ts +9 -0
  427. package/src/rules/stories/unitTests.ts +6 -3
  428. package/src/rules/suppressions/biome/weakenings.ts +1 -1
  429. package/src/rules/suppressions/biomeOverrides.ts +17 -16
  430. package/src/rules/suppressions/biomeRecommended.ts +13 -32
  431. package/src/rules/suppressions/noIgnoreDeprecations.ts +4 -2
  432. package/src/rules/test-names/colocated.ts +2 -2
  433. package/src/rules/test-names/follow.ts +4 -4
  434. package/src/testing/adapters/assertThat.ts +12 -0
  435. package/src/testing/adapters/cli.ts +105 -0
  436. package/src/testing/adapters/git.ts +62 -0
  437. package/src/testing/adapters/hookPath.ts +6 -0
  438. package/src/testing/adapters/hookRepository.ts +134 -0
  439. package/src/testing/adapters/imports.ts +35 -0
  440. package/src/testing/adapters/packageExports.ts +37 -0
  441. package/src/testing/adapters/qualityTree.ts +26 -0
  442. package/src/testing/adapters/run.ts +7 -0
  443. package/src/testing/adapters/storySpecFiles.ts +54 -0
  444. package/src/testing/adapters/tree.ts +55 -0
  445. package/src/testing/adapters/writePackageExports.ts +9 -0
  446. package/src/testing/ruleStory.ts +139 -0
  447. package/src/unitIoGuard.config.ts +1 -1
  448. package/dist/biome/relocateConfig.d.ts.map +0 -1
  449. package/dist/biome/relocateConfig.js.map +0 -1
  450. package/dist/rules/suppressions/biome/configs.d.ts.map +0 -1
  451. package/dist/rules/suppressions/biome/configs.js.map +0 -1
  452. package/dist/rules/suppressions/biome/resolvePackage.d.ts.map +0 -1
  453. package/dist/rules/suppressions/biome/resolvePackage.js.map +0 -1
  454. /package/dist/{biome → adapters/biome}/relocateConfig.d.ts +0 -0
  455. /package/dist/{biome → adapters/biome}/relocateConfig.js +0 -0
  456. /package/dist/{rules/suppressions → adapters}/biome/resolvePackage.d.ts +0 -0
  457. /package/dist/{rules/suppressions → adapters}/biome/resolvePackage.js +0 -0
  458. /package/src/{biome → adapters/biome}/relocateConfig.ts +0 -0
  459. /package/src/{rules/suppressions → adapters}/biome/resolvePackage.ts +0 -0
@@ -1,13 +1,13 @@
1
- import { basename, dirname, resolve } from "node:path";
2
- import { pathToFileURL } from "node:url";
3
- import { Effect, FileSystem, Schema } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Effect, type FileSystem, Path, Schema } from "effect";
3
+ import { readConfig } from "#adapters/readConfig.ts";
4
4
  import { validOrFail } from "#decoded.ts";
5
5
  import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
6
- import { SetupFailure } from "#failure.ts";
6
+ import type { SetupFailure } from "#failure.ts";
7
7
  import type { InventoryScope } from "#inventory/collect.ts";
8
8
  import { ConsumerDeclaration } from "#rules/suppressions/biome/ConsumerDeclaration.ts";
9
9
  import type { Declaration } from "#rules/suppressions/biome/declarations.ts";
10
- import { CONFIG_FILE, DEFAULT_EXTENSIONS } from "./constants.ts";
10
+ import { DEFAULT_EXTENSIONS } from "./constants.ts";
11
11
  import { type ConfigInput, decodeConfig } from "./decode.ts";
12
12
  import { type ResolvedRules, resolveRules } from "./resolve.ts";
13
13
 
@@ -20,23 +20,6 @@ export interface ResolvedConfig extends ResolvedRules, InventoryScope {
20
20
  readonly root: string;
21
21
  }
22
22
 
23
- function messageOf(cause: unknown): string {
24
- return cause instanceof Error ? cause.message : String(cause);
25
- }
26
-
27
- function importDefault(file: string): Effect.Effect<unknown, SetupFailure> {
28
- return Effect.flatMap(
29
- Effect.tryPromise({
30
- catch: (cause) => new SetupFailure({ cause, message: `cannot load ${file}: ${messageOf(cause)}` }),
31
- try: async (): Promise<unknown> => import(pathToFileURL(file).href),
32
- }),
33
- (loaded) =>
34
- typeof loaded === "object" && loaded !== null && "default" in loaded
35
- ? Effect.succeed(loaded.default)
36
- : Effect.fail(new SetupFailure({ message: `${file} has no default export. Export defineConfig({ ... }) as the default.` })),
37
- );
38
- }
39
-
40
23
  const LegacyOptions = Schema.Struct({ declared: Schema.Array(ConsumerDeclaration) });
41
24
  function biomeDeclarations(config: ConfigInput): readonly Declaration[] {
42
25
  const setting = config.rules?.["suppressions/biome-overrides"];
@@ -63,22 +46,9 @@ export const loadConfig = Effect.fn("Config.loadConfig")(function* (
63
46
  cwd: string,
64
47
  path: string | undefined,
65
48
  ): Effect.fn.Return<ResolvedConfig, SetupFailure, FileSystem.FileSystem> {
66
- const fs = yield* FileSystem.FileSystem;
67
- const file = resolve(cwd, path ?? CONFIG_FILE);
68
- const entries = yield* fs
69
- .readDirectory(dirname(file))
70
- .pipe(
71
- Effect.catchTag("PlatformError", (error) =>
72
- error.reason._tag === "NotFound"
73
- ? Effect.succeed<string[]>([])
74
- : Effect.fail(new SetupFailure({ cause: error, message: `cannot inspect ${file}: ${error.message}` })),
75
- ),
76
- );
77
- const present = entries.includes(basename(file));
78
- if (!present && path !== undefined) {
79
- return yield* new SetupFailure({ message: `no config at ${file}. Check the --config path.` });
80
- }
81
- const loaded = present ? yield* importDefault(file) : {};
49
+ const { dirname } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
50
+
51
+ const { file, loaded } = yield* readConfig(cwd, path);
82
52
  const config = yield* validOrFail(file, yield* Effect.promise(() => decodeConfig(loaded)));
83
53
  const rules = yield* validOrFail(file, yield* resolveRules(config));
84
54
  return resolved(dirname(file), file, config, rules);
@@ -7,7 +7,7 @@ import type { Environment } from "vitest/runtime";
7
7
  // Resolve the DOM plugin from the consumer; depending on test-story would cycle through its Quality tooling.
8
8
  const consumer = createRequire(join(process.cwd(), "package.json"));
9
9
  const { default: environment }: { readonly default: Environment } = await import(
10
- pathToFileURL(consumer.resolve("@shivaedev/test-story/server/domEnvironment.config.ts")).href
10
+ pathToFileURL(consumer.resolve("@shivaedev/test-story/server/adapters/domEnvironment.config.ts")).href
11
11
  );
12
12
 
13
13
  export default environment;
@@ -1,5 +1,5 @@
1
- import { relative } from "node:path";
2
- import { Effect, type Scope } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Effect, Path, type Scope } from "effect";
3
3
  import { setManifestFiles } from "#adapters/manifestInventory.ts";
4
4
  import { manifestReader } from "#adapters/manifestReader.ts";
5
5
  import { loadConfig, type ResolvedConfig } from "#config/load.ts";
@@ -31,6 +31,8 @@ function setup<TValue, TRequirements>(effect: Effect.Effect<TValue, Error, TRequ
31
31
  export const scan = Effect.fn("Engine.scan")(function* (
32
32
  config: ResolvedConfig,
33
33
  ): Effect.fn.Return<Pick<Session, "inventory" | "staleRegistry" | "violations">, SetupFailure, RuleServices | Scope.Scope> {
34
+ const { relative } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
35
+
34
36
  const inventory = yield* setup(collectInventory(config.root, config));
35
37
  const readText = yield* manifestReader(config.root);
36
38
  setManifestFiles(readText, inventory.manifestFiles);
@@ -18,7 +18,7 @@ export const staleBiomeExceptions = Effect.fn("Exceptions.staleBiomeExceptions")
18
18
  entry.rules.includes("biome/files/includes") ? [{ ...entry, rules: ["biome/files/includes"] as const }] : [],
19
19
  );
20
20
  const report = yield* biomeReport(inputs.root, ["check", "--no-errors-on-unmatched"], exclusions, [...new Set(entries.map(({ file }) => file))]);
21
- const diagnostics = yield* Effect.promise(() => withoutEntryPointImports(inputs.readText, report.diagnostics));
21
+ const diagnostics = yield* withoutEntryPointImports(inputs, report.diagnostics);
22
22
  return entries
23
23
  .filter(({ file, rule }) => !diagnostics.some((diagnostic) => diagnostic.location.path === file && `biome/${diagnostic.category}` === rule))
24
24
  .map(
@@ -29,19 +29,20 @@ export const staleBiomeExceptions = Effect.fn("Exceptions.staleBiomeExceptions")
29
29
  );
30
30
  });
31
31
 
32
- export async function missingBiomeFiles(inputs: RuleInputs): Promise<readonly Finding[]> {
32
+ const missingBiomeFile = Effect.fn("Exceptions.missingBiomeFile")(function* (inputs: RuleInputs, file: string): Effect.fn.Return<readonly Finding[]> {
33
+ const text = yield* Effect.promise(() => inputs.readText(file));
34
+ return text === undefined
35
+ ? [{ file, message: `This Biome exception names a missing file. Remove it from exceptions in ${inputs.configFile ?? "quality.config.ts"}.` }]
36
+ : [];
37
+ });
38
+
39
+ export const missingBiomeFiles = Effect.fn("Exceptions.missingBiomeFiles")(function* (inputs: RuleInputs) {
33
40
  const paths = (inputs.exceptions ?? [])
34
41
  .filter((entry) => entry.rules.some((rule) => rule.startsWith("biome/") && rule !== "biome/files/includes"))
35
42
  .flatMap((entry) => entry.files);
36
- const checked = await Promise.all(
37
- [...new Set(paths)].map(async (file) =>
38
- (await inputs.readText(file)) === undefined
39
- ? [{ file, message: `This Biome exception names a missing file. Remove it from exceptions in ${inputs.configFile ?? "quality.config.ts"}.` }]
40
- : [],
41
- ),
42
- );
43
+ const checked = yield* Effect.forEach([...new Set(paths)], (file) => missingBiomeFile(inputs, file), { concurrency: "unbounded" });
43
44
  return checked.flat();
44
- }
45
+ });
45
46
 
46
47
  export function biomeExceptionHint(files: readonly string[], rule: string, config = "quality.config.ts"): string {
47
48
  const entry = { files, reason: "Explain why this exception is permanent.", rules: [`biome/${rule}`] };
@@ -1,5 +1,5 @@
1
- import { basename, dirname, join, relative } from "node:path";
2
- import { Console, Effect, FileSystem } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Console, Effect, FileSystem, Path } from "effect";
3
3
  import { CONFIG_FILE } from "#config/constants.ts";
4
4
  import { loadConfig } from "#config/load.ts";
5
5
  import { SetupFailure } from "#failure.ts";
@@ -28,6 +28,8 @@ const realPath = Effect.fnUntraced(function* (path: string) {
28
28
  });
29
29
 
30
30
  const write = Effect.fnUntraced(function* (file: string, text: string) {
31
+ const { dirname } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
32
+
31
33
  const fs = yield* FileSystem.FileSystem;
32
34
  yield* fs.makeDirectory(dirname(file), { recursive: true }).pipe(
33
35
  Effect.andThen(fs.writeFileString(file, text)),
@@ -37,6 +39,8 @@ const write = Effect.fnUntraced(function* (file: string, text: string) {
37
39
  });
38
40
 
39
41
  export const installHook = Effect.fn("Hooks.installHook")(function* (install: HookInstall) {
42
+ const { basename, dirname, join, relative } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
43
+
40
44
  const config = yield* loadConfig(install.cwd, install.config);
41
45
  const location = yield* hookLocation(config.root);
42
46
  const root = yield* realPath(config.root);
@@ -1,5 +1,5 @@
1
- import { join } from "node:path";
2
- import { Effect } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Effect, Path } from "effect";
3
3
  import { SetupFailure } from "#failure.ts";
4
4
  import { run } from "#git/command.ts";
5
5
 
@@ -11,6 +11,8 @@ export interface HookLocation {
11
11
 
12
12
  // Hooks live in the common git directory, which every worktree of the repository shares.
13
13
  export const hookLocation = Effect.fn("Hooks.hookLocation")(function* (cwd: string) {
14
+ const { join } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
15
+
14
16
  const paths = yield* run(cwd, ["rev-parse", "--path-format=absolute", "--show-toplevel", "--git-common-dir"]);
15
17
  const [toplevel, common] = paths.stdout.trim().split("\n");
16
18
  if (paths.code !== 0 || toplevel === undefined || common === undefined) {
@@ -1,5 +1,5 @@
1
- import { join } from "node:path";
2
- import { Console, Effect } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Console, Effect, Path } from "effect";
3
3
  import { ChildProcess, ChildProcessSpawner } from "effect/process";
4
4
  import { readPackageManifest } from "#adapters/manifestInventory.ts";
5
5
  import { manifestReader } from "#adapters/manifestReader.ts";
@@ -11,6 +11,8 @@ const COMMIT_AGAIN =
11
11
  "help: fix what the output above reports, then commit again; `quality hooks pre-commit` repeats these checks without committing.";
12
12
 
13
13
  const commitScripts = Effect.fnUntraced(function* (root: string) {
14
+ const { join } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
15
+
14
16
  const file = join(root, "package.json");
15
17
  const readText = yield* manifestReader(root);
16
18
  const manifest = yield* Effect.tryPromise({
@@ -1,8 +1,10 @@
1
- import { join } from "node:path";
2
- import { Effect, FileSystem } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Effect, FileSystem, Path } from "effect";
3
3
  import { type HookInstall, installHook } from "./install.ts";
4
4
 
5
5
  export const setupHook = Effect.fn("Hooks.setupHook")(function* (options: Omit<HookInstall, "force">) {
6
+ const { join } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
7
+
6
8
  const fs = yield* FileSystem.FileSystem;
7
9
  if (yield* fs.exists(join(options.cwd, ".git"))) {
8
10
  yield* installHook({ ...options, force: false });
@@ -1,7 +1,6 @@
1
- import { constants } from "node:fs";
2
- import { access, realpath } from "node:fs/promises";
3
- import { dirname, resolve } from "node:path";
4
- import { Console, Effect } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Console, Effect, Path } from "effect";
3
+ import { executable } from "#adapters/executable.ts";
5
4
  import { GateFailed, SetupFailure } from "#failure.ts";
6
5
  import { gitOrFail } from "#git/command.ts";
7
6
  import { readOptionalText } from "#inventory/filesystem.ts";
@@ -9,18 +8,9 @@ import { forwardingPath, globalHooksPath } from "./forwarding.ts";
9
8
  import { type HookLocation, hookLocation } from "./location.ts";
10
9
  import { isHookShim } from "./shim.ts";
11
10
 
12
- function executable(file: string) {
13
- return Effect.promise(async () => {
14
- try {
15
- await access(file, constants.X_OK);
16
- return await realpath(file);
17
- } catch {
18
- return undefined;
19
- }
20
- });
21
- }
22
-
23
11
  export const globalHookStatus = Effect.fn("Hooks.globalHookStatus")(function* (location: HookLocation) {
12
+ const { resolve } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
13
+
24
14
  const path = yield* globalHooksPath(location.toplevel);
25
15
  const hook = resolve(location.toplevel, path, "pre-commit");
26
16
  const target = path === "" ? undefined : yield* executable(hook);
@@ -33,6 +23,8 @@ export const globalHookStatus = Effect.fn("Hooks.globalHookStatus")(function* (l
33
23
  });
34
24
 
35
25
  export const hookStatus = Effect.fn("Hooks.hookStatus")(function* (cwd: string) {
26
+ const { dirname, resolve } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
27
+
36
28
  const location = yield* hookLocation(cwd);
37
29
  const path = (yield* gitOrFail(cwd, ["rev-parse", "--path-format=absolute", "--git-path", "hooks/pre-commit"])).trim();
38
30
  const text = yield* readOptionalText(path).pipe(Effect.mapError((error) => new SetupFailure({ cause: error, message: error.message })));
@@ -1,5 +1,5 @@
1
- import { dirname } from "node:path";
2
- import { Console, Effect, FileSystem } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Console, Effect, FileSystem, Path } from "effect";
3
3
  import { SetupFailure } from "#failure.ts";
4
4
  import { gitOrFail, run } from "#git/command.ts";
5
5
  import { readOptionalText } from "#inventory/filesystem.ts";
@@ -8,6 +8,8 @@ import { hookLocation } from "./location.ts";
8
8
  import { isHookShim } from "./shim.ts";
9
9
 
10
10
  export const uninstallHook = Effect.fn("Hooks.uninstallHook")(function* (cwd: string) {
11
+ const { dirname } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
12
+
11
13
  const fs = yield* FileSystem.FileSystem;
12
14
  const { file } = yield* hookLocation(cwd);
13
15
  const existing = yield* Effect.mapError(readOptionalText(file), (failure) => new SetupFailure({ cause: failure, message: failure.message }));
@@ -1,6 +1,6 @@
1
1
  import { join, relative } from "node:path";
2
2
  import { Effect, FileSystem } from "effect";
3
- import ignore from "ignore";
3
+ import { ignorePatterns } from "#adapters/ignore.ts";
4
4
  import type { SetupFailure } from "#failure.ts";
5
5
  import { manifestsIn } from "#manifests/sorted.ts";
6
6
  import type { RuleServices, SourceFile } from "#rule.ts";
@@ -48,7 +48,7 @@ export const collectInventory = Effect.fn("Inventory.collectInventory")(function
48
48
  root: string,
49
49
  scope: InventoryScope,
50
50
  ): Effect.fn.Return<Inventory, FilesystemFailure | SetupFailure, RuleServices> {
51
- const excluded = ignore().add([...scope.exclude]);
51
+ const excluded = ignorePatterns([...scope.exclude]);
52
52
  const toolOwned = new Set(yield* shadcnFiles(root));
53
53
  const zones = yield* Effect.forEach(scope.sources, (zone) => zoneFiles(root, zone), { concurrency: READ_CONCURRENCY });
54
54
  const relativePaths = zones.flat().map((absolute) => posix(relative(root, absolute)));
@@ -1,5 +1,5 @@
1
- import { dirname } from "node:path";
2
- import { Data, Effect, FileSystem } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Data, Effect, FileSystem, Path } from "effect";
3
3
  import type { PlatformError } from "effect/PlatformError";
4
4
 
5
5
  export class FilesystemFailure extends Data.TaggedError("FilesystemFailure")<{
@@ -41,6 +41,8 @@ export const writeText = Effect.fn("Inventory.writeText")(function* (
41
41
  path: string,
42
42
  text: string,
43
43
  ): Effect.fn.Return<void, FilesystemFailure, FileSystem.FileSystem> {
44
+ const { dirname } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
45
+
44
46
  const fs = yield* FileSystem.FileSystem;
45
47
  const written = Effect.andThen(fs.makeDirectory(dirname(path), { recursive: true }), fs.writeFileString(path, text));
46
48
  return yield* Effect.mapError(written, (error) => new FilesystemFailure({ message: `cannot write ${path}: ${error.message}`, path }));
@@ -1,11 +1,11 @@
1
1
  import { dirname, relative, resolve } from "node:path";
2
- import ignore from "ignore";
2
+ import { ignorePatterns } from "#adapters/ignore.ts";
3
3
 
4
4
  export type Verdict = "ignored" | "kept" | "unknown";
5
5
 
6
6
  interface IgnoreMatcher {
7
7
  readonly base: string;
8
- readonly rules: ReturnType<typeof ignore>;
8
+ readonly rules: ReturnType<typeof ignorePatterns>;
9
9
  }
10
10
 
11
11
  export interface IgnoreScope {
@@ -23,7 +23,7 @@ export function posix(path: string): string {
23
23
  export function withIgnoreFile(scope: IgnoreScope, base: string, contents: string): IgnoreScope {
24
24
  return {
25
25
  boundary: scope.boundary,
26
- matchers: [...scope.matchers, { base, rules: ignore().add(contents) }],
26
+ matchers: [...scope.matchers, { base, rules: ignorePatterns(contents) }],
27
27
  };
28
28
  }
29
29
 
@@ -1,5 +1,5 @@
1
- import { basename, dirname, relative } from "node:path";
2
- import { Effect, Schema } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Effect, Path, Schema } from "effect";
3
3
  import type { SetupFailure } from "#failure.ts";
4
4
  import type { RuleServices } from "#rule.ts";
5
5
  import { FilesystemFailure, readRequiredText } from "./filesystem.ts";
@@ -12,9 +12,13 @@ const Components = Schema.fromJsonString(Schema.Struct({ aliases: Schema.Struct(
12
12
  export const shadcnFolders = Effect.fn("Inventory.shadcnFolders")(function* (
13
13
  root: string,
14
14
  ): Effect.fn.Return<readonly string[], FilesystemFailure | SetupFailure, RuleServices> {
15
+ const { basename } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
16
+
15
17
  const paths = (yield* walk(root)).filter((path) => basename(path) === "components.json");
16
18
  return yield* Effect.forEach(paths, (path) =>
17
19
  Effect.gen(function* () {
20
+ const { dirname, relative } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
21
+
18
22
  const text = yield* readRequiredText(path);
19
23
  return yield* Effect.try({
20
24
  catch: (cause) => new FilesystemFailure({ message: `cannot resolve ${path}: ${String(cause)}`, path }),
@@ -1,9 +1,11 @@
1
- import { join, resolve } from "node:path";
2
- import { Effect } from "effect";
1
+ import * as NodePath from "@effect/platform-node/NodePath";
2
+ import { Effect, Path } from "effect";
3
3
  import { SetupFailure } from "#failure.ts";
4
4
  import { run } from "#git/command.ts";
5
5
 
6
6
  const listedPaths = Effect.fn("Inventory.listedPaths")(function* (directory: string, options: readonly string[], path = ".") {
7
+ const { join } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
8
+
7
9
  const result = yield* run(directory, ["ls-files", "-z", ...options, "--", path]);
8
10
  if (result.code !== 0) {
9
11
  if (result.stderr.includes("not a git repository")) {
@@ -26,6 +28,8 @@ export const ignoredTrackedPaths = Effect.fn("Inventory.ignoredTrackedPaths")(fu
26
28
  });
27
29
 
28
30
  export const ignoredPaths = Effect.fn("Inventory.ignoredPaths")(function* (directory: string) {
31
+ const { resolve } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
32
+
29
33
  const paths = yield* listedPaths(directory, ["--others", "--ignored", "--exclude-standard", "--directory"]);
30
34
  return paths?.map((path) => resolve(path));
31
35
  });
@@ -1,4 +1,5 @@
1
1
  import { posix } from "node:path";
2
+ import { Effect } from "effect";
2
3
  import { readPackageManifest } from "#adapters/manifestInventory.ts";
3
4
  import type { RuleInputs } from "#rule.ts";
4
5
 
@@ -42,13 +43,19 @@ function runBy(directory: string, manifest: unknown): readonly string[] {
42
43
  return [...commands, ...bins].map((target) => posix.join(directory, target));
43
44
  }
44
45
 
45
- export async function packageLayout({ files, readText }: Pick<RuleInputs, "files" | "readText">): Promise<PackageLayout> {
46
+ export const packageLayout = Effect.fn("Naming.packageLayout")(function* ({
47
+ files,
48
+ readText,
49
+ }: Pick<RuleInputs, "files" | "readText">): Effect.fn.Return<PackageLayout> {
46
50
  const directories = ["", ...files.filter((path) => posix.basename(path) === MANIFEST).map((path) => posix.dirname(path))];
47
- const manifests = await Promise.all(
48
- [...new Set(directories)].map(async (directory) => ({
49
- directory: directory === "." ? "" : directory,
50
- manifest: await readPackageManifest(readText, directory === "" ? MANIFEST : `${directory}/${MANIFEST}`),
51
- })),
51
+ const manifests = yield* Effect.forEach(
52
+ [...new Set(directories)],
53
+ (directory) =>
54
+ Effect.map(
55
+ Effect.promise(() => readPackageManifest(readText, directory === "" ? MANIFEST : `${directory}/${MANIFEST}`)),
56
+ (manifest) => ({ directory: directory === "." ? "" : directory, manifest }),
57
+ ),
58
+ { concurrency: "unbounded" },
52
59
  );
53
60
  const present = manifests.filter((entry) => entry.manifest !== undefined);
54
61
  const roots = present.map((entry) => entry.directory).toSorted((left, right) => right.length - left.length);
@@ -62,4 +69,4 @@ export async function packageLayout({ files, readText }: Pick<RuleInputs, "files
62
69
  names,
63
70
  scripts: new Set(present.flatMap(({ directory, manifest }) => runBy(directory, manifest))),
64
71
  };
65
- }
72
+ });
@@ -1,6 +1,6 @@
1
1
  import { posix } from "node:path";
2
2
 
3
- export const ENVIRONMENTS = ["dom", "slow", "typecheck", "unit"] as const;
3
+ export const ENVIRONMENTS = ["dom", "heavy", "slow", "typecheck", "unit"] as const;
4
4
 
5
5
  export type Environment = (typeof ENVIRONMENTS)[number];
6
6
 
@@ -1,12 +1,8 @@
1
1
  import { Effect } from "effect";
2
+ import { PRESET, rootConfig } from "#adapters/biome/rootConfig.ts";
2
3
  import { biomeReport, type Diagnostic, FAILING } from "#biome/report.ts";
3
4
  import { withoutEntryPointImports } from "#biome/withoutEntryPointImports.ts";
4
5
  import { defineRule, type Finding, type Rule, type RuleInputs } from "#rule.ts";
5
- import { itemsOf, member, parseJsonc, textOf } from "#rules/suppressions/biome/json.ts";
6
-
7
- export const PRESET = "@shivaedev/quality/biome/preset.json";
8
-
9
- const ROOT_CONFIGS: readonly string[] = ["biome.json", "biome.jsonc"];
10
6
 
11
7
  function messageOf(diagnostic: Diagnostic): string {
12
8
  return diagnostic.category === "format" && diagnostic.message.startsWith("Formatter would have printed")
@@ -24,32 +20,19 @@ function findingOf(diagnostic: Diagnostic): Finding {
24
20
  };
25
21
  }
26
22
 
27
- interface RootConfig {
28
- readonly extendsPreset: boolean;
29
- readonly path: string;
30
- }
31
-
32
- export async function rootConfig(readText: RuleInputs["readText"]): Promise<RootConfig> {
33
- const texts = await Promise.all(ROOT_CONFIGS.map(async (path) => ({ path, text: await readText(path) })));
34
- const found = texts.find((candidate) => candidate.text !== undefined);
35
- const parsed = found?.text === undefined ? undefined : parseJsonc(found.path, found.text);
36
- const extended = parsed?._tag === "Parsed" ? itemsOf(member(parsed.json, "extends")).map(textOf) : [];
37
- return { extendsPreset: extended.includes(PRESET), path: found?.path ?? "biome.json" };
38
- }
39
-
40
- async function presetFinding(readText: RuleInputs["readText"]): Promise<readonly Finding[]> {
41
- const { extendsPreset, path } = await rootConfig(readText);
23
+ const presetFinding = Effect.fn("Biome.presetFinding")(function* (inputs: Pick<RuleInputs, "readText">) {
24
+ const { extendsPreset, path } = yield* Effect.promise(() => rootConfig(inputs.readText));
42
25
  return extendsPreset ? [] : [{ file: path, message: `Extend "${PRESET}" from the root Biome config.`, subject: "preset" }];
43
- }
26
+ });
44
27
 
45
28
  const bridge = defineRule({
46
29
  check: ({ exceptions, readText, root }) =>
47
30
  Effect.gen(function* () {
48
- const [preset, report] = yield* Effect.all([Effect.promise(() => presetFinding(readText)), biomeReport(root, ["check"], exceptions)], {
31
+ const [preset, report] = yield* Effect.all([presetFinding({ readText }), biomeReport(root, ["check"], exceptions)], {
49
32
  concurrency: "unbounded",
50
33
  });
51
34
  const failing = report.diagnostics.filter((diagnostic) => FAILING.has(diagnostic.severity));
52
- return [...preset, ...(yield* Effect.promise(() => withoutEntryPointImports(readText, failing))).map(findingOf)];
35
+ return [...preset, ...(yield* withoutEntryPointImports({ readText }, failing)).map(findingOf)];
53
36
  }),
54
37
  description:
55
38
  "Biome's lint, format and assist findings under the shared preset, except undeclared-dependency findings for a piece that an application's entry point brings. `quality fix` applies Biome's lint fixes, unsafe ones included, its assist actions and formatting.",
@@ -7,9 +7,12 @@ import { noPrReference } from "#rules/comments/noPrReference.ts";
7
7
  import { noTodo } from "#rules/comments/noTodo.ts";
8
8
  import { docsReferences } from "#rules/docs/references.ts";
9
9
  import { docsUnversionedInstalls } from "#rules/docs/unversionedInstalls.ts";
10
+ import { adapterImports } from "#rules/effect/adapterImports.ts";
10
11
  import { effectBoundary } from "#rules/effect/boundary.ts";
11
12
  import { failureHonesty } from "#rules/effect/failureHonesty.ts";
13
+ import { serviceIds } from "#rules/effect/serviceIds.ts";
12
14
  import { serviceParameters } from "#rules/effect/serviceParameters.ts";
15
+ import { sharedErrorClasses } from "#rules/effect/sharedErrorClasses.ts";
13
16
  import { distinctCase } from "#rules/files/distinctCase.ts";
14
17
  import { folderNames } from "#rules/files/folderNames.ts";
15
18
  import { namedAfterExport } from "#rules/files/namedAfterExport.ts";
@@ -23,15 +26,18 @@ import { noTestCode } from "#rules/imports/noTestCode.ts";
23
26
  import { importsResolvable } from "#rules/imports/resolvable.ts";
24
27
  import { importsRuntime } from "#rules/imports/runtime.ts";
25
28
  import { jsxConditionals } from "#rules/react/jsxConditionals.ts";
29
+ import { adapterOnlyFakes } from "#rules/stories/adapterOnlyFakes.ts";
26
30
  import { authSql } from "#rules/stories/authSql.ts";
27
31
  import { domainOutcomes } from "#rules/stories/domainOutcomes.ts";
28
32
  import { storyEngine } from "#rules/stories/engine.ts";
29
33
  import { globalRetries } from "#rules/stories/globalRetries.ts";
30
34
  import { groupedOutcomes } from "#rules/stories/groupedOutcomes.ts";
31
35
  import { httpStatus } from "#rules/stories/httpStatus.ts";
36
+ import { importedChangeKeys } from "#rules/stories/importedChangeKeys.ts";
32
37
  import { namedValues } from "#rules/stories/namedValues.ts";
33
38
  import { noExpect } from "#rules/stories/noExpect.ts";
34
39
  import { noLimitImports } from "#rules/stories/noLimitImports.ts";
40
+ import { queueReadouts } from "#rules/stories/queueReadouts.ts";
35
41
  import { queueSql } from "#rules/stories/queueSql.ts";
36
42
  import { storySetup } from "#rules/stories/setup.ts";
37
43
  import { specHelpers } from "#rules/stories/specHelpers.ts";
@@ -57,9 +63,12 @@ import { unusedCode } from "./unusedCode.ts";
57
63
 
58
64
  export const builtInRules = [
59
65
  unusedCode,
66
+ adapterImports,
60
67
  effectBoundary,
61
68
  failureHonesty,
69
+ serviceIds,
62
70
  serviceParameters,
71
+ sharedErrorClasses,
63
72
  jsxConditionals,
64
73
  maxLines,
65
74
  maxDepth,
@@ -100,9 +109,12 @@ export const builtInRules = [
100
109
  testsColocated,
101
110
  storySetup,
102
111
  storySpecs,
112
+ adapterOnlyFakes,
103
113
  globalRetries,
104
114
  storyEngine,
105
115
  queueSql,
116
+ queueReadouts,
117
+ importedChangeKeys,
106
118
  authSql,
107
119
  noExpect,
108
120
  specHelpers,
@@ -0,0 +1,10 @@
1
+ import { outsideImportFindings } from "#adapters/outsideImportFindings.ts";
2
+ import { defineRule } from "#rule.ts";
3
+
4
+ export const adapterImports = defineRule({
5
+ check: outsideImportFindings,
6
+ description:
7
+ "Keep value imports of non-Effect runtime dependencies, peers, optional dependencies and Node builtins in adapters/. Type-only imports, workspace modules, test-support/ kits, Effect and @shivaedev packages and React in client/ folders are accepted. Move integrations into adapters/ and expose Effect values. No config exceptions or inline suppressions; baseline existing debt.",
8
+ id: "effect/adapter-imports",
9
+ registrable: false,
10
+ });
@@ -3,7 +3,7 @@ import ts from "typescript";
3
3
  import { projectsFor } from "#adapters/imports/projects.ts";
4
4
  import type { RuleInputs } from "#rule.ts";
5
5
 
6
- export function effectProgram(inputs: RuleInputs, externalTypes = true): ts.Program {
6
+ export function effectProgram(inputs: RuleInputs, externalTypes = true, roots: readonly string[] = []): ts.Program {
7
7
  const projectOf = projectsFor(inputs.root);
8
8
  const options: ts.CompilerOptions = {
9
9
  allowJs: true,
@@ -25,5 +25,5 @@ export function effectProgram(inputs: RuleInputs, externalTypes = true): ts.Prog
25
25
  const project = projectOf(from);
26
26
  return ts.resolveModuleName(name, from, project.typesOptions, host, project.typesCache).resolvedModule;
27
27
  });
28
- return ts.createProgram([...texts.keys()], options, host);
28
+ return ts.createProgram([...texts.keys(), ...roots], options, host);
29
29
  }
@@ -0,0 +1,10 @@
1
+ import { serviceIdFindings } from "#adapters/serviceIdFindings.ts";
2
+ import { defineRule } from "#rule.ts";
3
+
4
+ export const serviceIds = defineRule({
5
+ check: serviceIdFindings,
6
+ description:
7
+ "Literal Context.Service, Context.Reference, defineService and RPC middleware ids in packages/<name>/ start with @shivaedev/<name>/. Prefix the id and update its references. Includes adapters and tests; computed ids and files outside packages/ are not checked. No config exceptions or inline suppressions.",
8
+ id: "effect/service-ids",
9
+ registrable: false,
10
+ });
@@ -0,0 +1,10 @@
1
+ import { sharedErrorFindings } from "#adapters/sharedErrorFindings.ts";
2
+ import { defineRule } from "#rule.ts";
3
+
4
+ export const sharedErrorClasses = defineRule({
5
+ check: sharedErrorFindings,
6
+ description:
7
+ "A tagged error with a tag exported by @shivaedev/errors must use that exported class. Import the shared class instead of declaring another error or subclass with its tag.",
8
+ id: "effect/shared-error-classes",
9
+ registrable: false,
10
+ });