@shivaedev/quality 0.23.0 → 0.25.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 (411) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +6 -2
  3. package/dist/baseline/compare.d.ts +2 -2
  4. package/dist/baseline/compare.d.ts.map +1 -1
  5. package/dist/baseline/compare.js +6 -4
  6. package/dist/baseline/compare.js.map +1 -1
  7. package/dist/baseline/format.d.ts +5 -5
  8. package/dist/baseline/format.d.ts.map +1 -1
  9. package/dist/baseline/format.js +23 -13
  10. package/dist/baseline/format.js.map +1 -1
  11. package/dist/baseline/legacy.d.ts +2 -2
  12. package/dist/baseline/legacy.d.ts.map +1 -1
  13. package/dist/baseline/legacy.js +4 -4
  14. package/dist/baseline/legacy.js.map +1 -1
  15. package/dist/baseline/rewrite.d.ts +1 -1
  16. package/dist/baseline/rewrite.d.ts.map +1 -1
  17. package/dist/baseline/rewrite.js +2 -2
  18. package/dist/baseline/rewrite.js.map +1 -1
  19. package/dist/baseline/update.d.ts +2 -2
  20. package/dist/baseline/update.d.ts.map +1 -1
  21. package/dist/baseline/update.js +27 -21
  22. package/dist/baseline/update.js.map +1 -1
  23. package/dist/cli/args.d.ts +2 -4
  24. package/dist/cli/args.d.ts.map +1 -1
  25. package/dist/cli/args.js +19 -18
  26. package/dist/cli/args.js.map +1 -1
  27. package/dist/cli/baseline.d.ts +1 -1
  28. package/dist/cli/baseline.d.ts.map +1 -1
  29. package/dist/cli/baseline.js +10 -6
  30. package/dist/cli/baseline.js.map +1 -1
  31. package/dist/cli/fix.d.ts +2 -2
  32. package/dist/cli/fix.d.ts.map +1 -1
  33. package/dist/cli/fix.js +35 -41
  34. package/dist/cli/fix.js.map +1 -1
  35. package/dist/cli/lint.d.ts +1 -2
  36. package/dist/cli/lint.d.ts.map +1 -1
  37. package/dist/cli/lint.js +1 -2
  38. package/dist/cli/lint.js.map +1 -1
  39. package/dist/cli/messages.d.ts +1 -1
  40. package/dist/cli/messages.d.ts.map +1 -1
  41. package/dist/cli/messages.js +2 -2
  42. package/dist/cli/migrate.d.ts.map +1 -1
  43. package/dist/cli/migrate.js +2 -2
  44. package/dist/cli/migrate.js.map +1 -1
  45. package/dist/cli/migrateExceptions.js +1 -1
  46. package/dist/cli/migrateExceptions.js.map +1 -1
  47. package/dist/cli/program.js +1 -1
  48. package/dist/cli/program.js.map +1 -1
  49. package/dist/cli/{run-main.d.ts → runMain.d.ts} +1 -1
  50. package/dist/cli/runMain.d.ts.map +1 -0
  51. package/dist/cli/{run-main.js → runMain.js} +3 -3
  52. package/dist/cli/runMain.js.map +1 -0
  53. package/dist/cli/shrink.d.ts +2 -2
  54. package/dist/cli/shrink.d.ts.map +1 -1
  55. package/dist/cli/shrink.js +9 -3
  56. package/dist/cli/shrink.js.map +1 -1
  57. package/dist/cli.js +1 -1
  58. package/dist/cli.js.map +1 -1
  59. package/dist/config/decode.d.ts +1 -1
  60. package/dist/config/decode.d.ts.map +1 -1
  61. package/dist/config/decode.js +13 -9
  62. package/dist/config/decode.js.map +1 -1
  63. package/dist/config/load.d.ts.map +1 -1
  64. package/dist/config/load.js +26 -20
  65. package/dist/config/load.js.map +1 -1
  66. package/dist/config/resolve.d.ts +23 -3
  67. package/dist/config/resolve.d.ts.map +1 -1
  68. package/dist/config/resolve.js +19 -11
  69. package/dist/config/resolve.js.map +1 -1
  70. package/dist/config.d.ts +3 -3
  71. package/dist/config.d.ts.map +1 -1
  72. package/dist/config.js +3 -1
  73. package/dist/config.js.map +1 -1
  74. package/dist/decoded.d.ts +3 -3
  75. package/dist/decoded.d.ts.map +1 -1
  76. package/dist/decoded.js +8 -6
  77. package/dist/decoded.js.map +1 -1
  78. package/dist/engine/{baseline-file.d.ts → baselineFile.d.ts} +2 -2
  79. package/dist/engine/baselineFile.d.ts.map +1 -0
  80. package/dist/engine/{baseline-file.js → baselineFile.js} +5 -3
  81. package/dist/engine/baselineFile.js.map +1 -0
  82. package/dist/engine/evaluate.d.ts +2 -3
  83. package/dist/engine/evaluate.d.ts.map +1 -1
  84. package/dist/engine/evaluate.js +6 -5
  85. package/dist/engine/evaluate.js.map +1 -1
  86. package/dist/engine/{run-rules.d.ts → runRules.d.ts} +2 -2
  87. package/dist/engine/runRules.d.ts.map +1 -0
  88. package/dist/engine/runRules.js +44 -0
  89. package/dist/engine/runRules.js.map +1 -0
  90. package/dist/engine/session.d.ts +1 -1
  91. package/dist/engine/session.d.ts.map +1 -1
  92. package/dist/engine/session.js +10 -6
  93. package/dist/engine/session.js.map +1 -1
  94. package/dist/engine/violation.d.ts +8 -8
  95. package/dist/engine/violation.d.ts.map +1 -1
  96. package/dist/engine/violation.js +23 -11
  97. package/dist/engine/violation.js.map +1 -1
  98. package/dist/exceptions/registry.d.ts +2 -2
  99. package/dist/exceptions/registry.d.ts.map +1 -1
  100. package/dist/exceptions/registry.js +10 -6
  101. package/dist/exceptions/registry.js.map +1 -1
  102. package/dist/git/base.d.ts +1 -2
  103. package/dist/git/base.d.ts.map +1 -1
  104. package/dist/git/base.js +22 -10
  105. package/dist/git/base.js.map +1 -1
  106. package/dist/git/command.d.ts +2 -2
  107. package/dist/git/command.d.ts.map +1 -1
  108. package/dist/git/command.js +13 -9
  109. package/dist/git/command.js.map +1 -1
  110. package/dist/git/history.d.ts +1 -1
  111. package/dist/git/history.d.ts.map +1 -1
  112. package/dist/git/history.js +5 -3
  113. package/dist/git/history.js.map +1 -1
  114. package/dist/hooks/preCommit.js +1 -1
  115. package/dist/hooks/preCommit.js.map +1 -1
  116. package/dist/imports/generated.js +1 -1
  117. package/dist/imports/generated.js.map +1 -1
  118. package/dist/imports/{pnpm-workspace.d.ts → pnpmWorkspacePatterns.d.ts} +1 -1
  119. package/dist/imports/pnpmWorkspacePatterns.d.ts.map +1 -0
  120. package/dist/imports/{pnpm-workspace.js → pnpmWorkspacePatterns.js} +1 -1
  121. package/dist/imports/pnpmWorkspacePatterns.js.map +1 -0
  122. package/dist/imports/resolve.js +1 -1
  123. package/dist/imports/resolve.js.map +1 -1
  124. package/dist/imports/workspace.js +1 -1
  125. package/dist/imports/workspace.js.map +1 -1
  126. package/dist/inventory/collect.d.ts +1 -1
  127. package/dist/inventory/collect.d.ts.map +1 -1
  128. package/dist/inventory/collect.js +8 -6
  129. package/dist/inventory/collect.js.map +1 -1
  130. package/dist/inventory/filesystem.d.ts +1 -1
  131. package/dist/inventory/filesystem.d.ts.map +1 -1
  132. package/dist/inventory/filesystem.js +11 -7
  133. package/dist/inventory/filesystem.js.map +1 -1
  134. package/dist/inventory/ignoreScope.d.ts +17 -0
  135. package/dist/inventory/ignoreScope.d.ts.map +1 -0
  136. package/dist/inventory/{ignore-scope.js → ignoreScope.js} +19 -10
  137. package/dist/inventory/ignoreScope.js.map +1 -0
  138. package/dist/inventory/walk.d.ts +1 -1
  139. package/dist/inventory/walk.d.ts.map +1 -1
  140. package/dist/inventory/walk.js +1 -1
  141. package/dist/inventory/walk.js.map +1 -1
  142. package/dist/manifests/sorted.d.ts +1 -1
  143. package/dist/manifests/sorted.d.ts.map +1 -1
  144. package/dist/manifests/sorted.js +15 -17
  145. package/dist/manifests/sorted.js.map +1 -1
  146. package/dist/report/plural.d.ts +1 -1
  147. package/dist/report/plural.d.ts.map +1 -1
  148. package/dist/report/plural.js +3 -1
  149. package/dist/report/plural.js.map +1 -1
  150. package/dist/report/render.d.ts +1 -3
  151. package/dist/report/render.d.ts.map +1 -1
  152. package/dist/report/render.js +30 -32
  153. package/dist/report/render.js.map +1 -1
  154. package/dist/report/stale.d.ts +1 -1
  155. package/dist/report/stale.d.ts.map +1 -1
  156. package/dist/report/stale.js +18 -8
  157. package/dist/report/stale.js.map +1 -1
  158. package/dist/rule.d.ts +14 -14
  159. package/dist/rule.d.ts.map +1 -1
  160. package/dist/rule.js +11 -9
  161. package/dist/rule.js.map +1 -1
  162. package/dist/rules/{built-in.d.ts → builtIn.d.ts} +3 -3
  163. package/dist/rules/builtIn.d.ts.map +1 -0
  164. package/dist/rules/{built-in.js → builtIn.js} +17 -13
  165. package/dist/rules/builtIn.js.map +1 -0
  166. package/dist/rules/comments/{pattern-rule.d.ts → definePattern.d.ts} +2 -2
  167. package/dist/rules/comments/definePattern.d.ts.map +1 -0
  168. package/dist/rules/comments/definePattern.js +18 -0
  169. package/dist/rules/comments/definePattern.js.map +1 -0
  170. package/dist/rules/comments/kinds.d.ts +4 -4
  171. package/dist/rules/comments/kinds.d.ts.map +1 -1
  172. package/dist/rules/comments/kinds.js +16 -8
  173. package/dist/rules/comments/kinds.js.map +1 -1
  174. package/dist/rules/comments/{max-per-file.d.ts → maxPerFile.d.ts} +1 -1
  175. package/dist/rules/comments/maxPerFile.d.ts.map +1 -0
  176. package/dist/rules/comments/{max-per-file.js → maxPerFile.js} +14 -10
  177. package/dist/rules/comments/maxPerFile.js.map +1 -0
  178. package/dist/rules/comments/{no-banner.d.ts → noBanner.d.ts} +1 -1
  179. package/dist/rules/comments/noBanner.d.ts.map +1 -0
  180. package/dist/rules/comments/{no-banner.js → noBanner.js} +2 -2
  181. package/dist/rules/comments/noBanner.js.map +1 -0
  182. package/dist/rules/comments/{no-environment-pragma.d.ts → noEnvironmentPragma.d.ts} +1 -1
  183. package/dist/rules/comments/noEnvironmentPragma.d.ts.map +1 -0
  184. package/dist/rules/comments/{no-environment-pragma.js → noEnvironmentPragma.js} +2 -2
  185. package/dist/rules/comments/noEnvironmentPragma.js.map +1 -0
  186. package/dist/rules/comments/{no-jsdoc.d.ts → noJsdoc.d.ts} +1 -1
  187. package/dist/rules/comments/noJsdoc.d.ts.map +1 -0
  188. package/dist/rules/comments/{no-jsdoc.js → noJsdoc.js} +1 -1
  189. package/dist/rules/comments/noJsdoc.js.map +1 -0
  190. package/dist/rules/comments/{no-line-reference.d.ts → noLineReference.d.ts} +1 -1
  191. package/dist/rules/comments/noLineReference.d.ts.map +1 -0
  192. package/dist/rules/comments/{no-line-reference.js → noLineReference.js} +2 -2
  193. package/dist/rules/comments/noLineReference.js.map +1 -0
  194. package/dist/rules/comments/{no-pr-reference.d.ts → noPrReference.d.ts} +1 -1
  195. package/dist/rules/comments/noPrReference.d.ts.map +1 -0
  196. package/dist/rules/comments/{no-pr-reference.js → noPrReference.js} +2 -2
  197. package/dist/rules/comments/noPrReference.js.map +1 -0
  198. package/dist/rules/comments/{no-todo.d.ts → noTodo.d.ts} +1 -1
  199. package/dist/rules/comments/noTodo.d.ts.map +1 -0
  200. package/dist/rules/comments/{no-todo.js → noTodo.js} +2 -2
  201. package/dist/rules/comments/noTodo.js.map +1 -0
  202. package/dist/rules/comments/scan.d.ts +3 -3
  203. package/dist/rules/comments/scan.d.ts.map +1 -1
  204. package/dist/rules/comments/scan.js +23 -19
  205. package/dist/rules/comments/scan.js.map +1 -1
  206. package/dist/rules/{manifests-sorted.d.ts → manifestsSorted.d.ts} +1 -1
  207. package/dist/rules/manifestsSorted.d.ts.map +1 -0
  208. package/dist/rules/{manifests-sorted.js → manifestsSorted.js} +1 -1
  209. package/dist/rules/manifestsSorted.js.map +1 -0
  210. package/dist/rules/manifestsSourceFirst.d.ts +2 -0
  211. package/dist/rules/manifestsSourceFirst.d.ts.map +1 -0
  212. package/dist/rules/manifestsSourceFirst.js +43 -0
  213. package/dist/rules/manifestsSourceFirst.js.map +1 -0
  214. package/dist/rules/{max-lines.d.ts → maxLines.d.ts} +1 -1
  215. package/dist/rules/maxLines.d.ts.map +1 -0
  216. package/dist/rules/{max-lines.js → maxLines.js} +13 -11
  217. package/dist/rules/maxLines.js.map +1 -0
  218. package/dist/rules/stories/origins.d.ts +10 -0
  219. package/dist/rules/stories/origins.d.ts.map +1 -0
  220. package/dist/rules/stories/origins.js +129 -0
  221. package/dist/rules/stories/origins.js.map +1 -0
  222. package/dist/rules/stories/prerequisites.d.ts +4 -0
  223. package/dist/rules/stories/prerequisites.d.ts.map +1 -0
  224. package/dist/rules/stories/prerequisites.js +32 -0
  225. package/dist/rules/stories/prerequisites.js.map +1 -0
  226. package/dist/rules/stories/program.d.ts +5 -0
  227. package/dist/rules/stories/program.d.ts.map +1 -0
  228. package/dist/rules/stories/program.js +22 -0
  229. package/dist/rules/stories/program.js.map +1 -0
  230. package/dist/rules/stories/specs.d.ts +2 -0
  231. package/dist/rules/stories/specs.d.ts.map +1 -0
  232. package/dist/rules/stories/specs.js +80 -0
  233. package/dist/rules/stories/specs.js.map +1 -0
  234. package/dist/rules/suppressions/biome/configs.d.ts +1 -1
  235. package/dist/rules/suppressions/biome/configs.d.ts.map +1 -1
  236. package/dist/rules/suppressions/biome/configs.js +23 -17
  237. package/dist/rules/suppressions/biome/configs.js.map +1 -1
  238. package/dist/rules/suppressions/biome/declarations.d.ts +4 -4
  239. package/dist/rules/suppressions/biome/declarations.d.ts.map +1 -1
  240. package/dist/rules/suppressions/biome/declarations.js +15 -7
  241. package/dist/rules/suppressions/biome/declarations.js.map +1 -1
  242. package/dist/rules/suppressions/biome/json.d.ts +6 -6
  243. package/dist/rules/suppressions/biome/json.d.ts.map +1 -1
  244. package/dist/rules/suppressions/biome/json.js +27 -13
  245. package/dist/rules/suppressions/biome/json.js.map +1 -1
  246. package/dist/rules/suppressions/biome/resolve.d.ts +1 -1
  247. package/dist/rules/suppressions/biome/resolve.d.ts.map +1 -1
  248. package/dist/rules/suppressions/biome/resolve.js +23 -17
  249. package/dist/rules/suppressions/biome/resolve.js.map +1 -1
  250. package/dist/rules/suppressions/biome/weakenings.d.ts +1 -1
  251. package/dist/rules/suppressions/biome/weakenings.d.ts.map +1 -1
  252. package/dist/rules/suppressions/biome/weakenings.js +78 -52
  253. package/dist/rules/suppressions/biome/weakenings.js.map +1 -1
  254. package/dist/rules/suppressions/{biome-overrides.d.ts → biomeOverrides.d.ts} +1 -1
  255. package/dist/rules/suppressions/biomeOverrides.d.ts.map +1 -0
  256. package/dist/rules/suppressions/biomeOverrides.js +75 -0
  257. package/dist/rules/suppressions/biomeOverrides.js.map +1 -0
  258. package/dist/rules/suppressions/directives.d.ts +1 -1
  259. package/dist/rules/suppressions/directives.d.ts.map +1 -1
  260. package/dist/rules/suppressions/directives.js +5 -3
  261. package/dist/rules/suppressions/directives.js.map +1 -1
  262. package/dist/rules/suppressions/{no-double-cast.d.ts → noDoubleCast.d.ts} +1 -1
  263. package/dist/rules/suppressions/noDoubleCast.d.ts.map +1 -0
  264. package/dist/rules/suppressions/{no-double-cast.js → noDoubleCast.js} +15 -11
  265. package/dist/rules/suppressions/noDoubleCast.js.map +1 -0
  266. package/dist/rules/suppressions/noIgnoreDeprecations.js +1 -1
  267. package/dist/rules/suppressions/noIgnoreDeprecations.js.map +1 -1
  268. package/dist/rules/suppressions/{no-inline.d.ts → noInline.d.ts} +1 -1
  269. package/dist/rules/suppressions/noInline.d.ts.map +1 -0
  270. package/dist/rules/suppressions/{no-inline.js → noInline.js} +10 -8
  271. package/dist/rules/suppressions/noInline.js.map +1 -0
  272. package/dist/rules/suppressions/stylesheetComments.d.ts +4 -0
  273. package/dist/rules/suppressions/stylesheetComments.d.ts.map +1 -0
  274. package/dist/rules/suppressions/{stylesheet-comments.js → stylesheetComments.js} +12 -6
  275. package/dist/rules/suppressions/stylesheetComments.js.map +1 -0
  276. package/dist/rules/syntax.d.ts +1 -1
  277. package/dist/rules/syntax.d.ts.map +1 -1
  278. package/dist/rules/syntax.js +2 -2
  279. package/dist/rules/syntax.js.map +1 -1
  280. package/dist/{standard-schema.d.ts → standardSchema.d.ts} +7 -7
  281. package/dist/standardSchema.d.ts.map +1 -0
  282. package/dist/{standard-schema.js → standardSchema.js} +1 -1
  283. package/dist/standardSchema.js.map +1 -0
  284. package/docs/debt-and-hooks.md +2 -2
  285. package/docs/modules.md +27 -24
  286. package/docs/roadmap.md +1 -1
  287. package/docs/rules.md +2 -0
  288. package/package.json +2 -3
  289. package/src/baseline/compare.ts +6 -4
  290. package/src/baseline/format.ts +17 -10
  291. package/src/baseline/legacy.ts +4 -4
  292. package/src/baseline/rewrite.ts +2 -2
  293. package/src/baseline/update.ts +23 -19
  294. package/src/cli/args.ts +20 -21
  295. package/src/cli/baseline.ts +36 -35
  296. package/src/cli/fix.ts +40 -43
  297. package/src/cli/lint.ts +17 -21
  298. package/src/cli/messages.ts +2 -2
  299. package/src/cli/migrate.ts +21 -22
  300. package/src/cli/migrateExceptions.ts +1 -1
  301. package/src/cli/program.ts +1 -1
  302. package/src/cli/{run-main.ts → runMain.ts} +2 -2
  303. package/src/cli/shrink.ts +11 -8
  304. package/src/cli.ts +1 -1
  305. package/src/config/decode.ts +15 -10
  306. package/src/config/load.ts +44 -37
  307. package/src/config/resolve.ts +34 -29
  308. package/src/config.ts +5 -3
  309. package/src/decoded.ts +6 -5
  310. package/src/engine/baselineFile.ts +29 -0
  311. package/src/engine/evaluate.ts +7 -8
  312. package/src/engine/{run-rules.ts → runRules.ts} +22 -14
  313. package/src/engine/session.ts +34 -27
  314. package/src/engine/violation.ts +24 -13
  315. package/src/exceptions/registry.ts +10 -8
  316. package/src/git/base.ts +45 -37
  317. package/src/git/command.ts +6 -4
  318. package/src/git/history.ts +5 -4
  319. package/src/hooks/preCommit.ts +1 -1
  320. package/src/imports/generated.ts +1 -1
  321. package/src/imports/resolve.ts +1 -1
  322. package/src/imports/workspace.ts +1 -1
  323. package/src/inventory/collect.ts +40 -35
  324. package/src/inventory/filesystem.ts +38 -30
  325. package/src/inventory/{ignore-scope.ts → ignoreScope.ts} +20 -10
  326. package/src/inventory/walk.ts +1 -1
  327. package/src/manifests/sorted.ts +19 -19
  328. package/src/report/plural.ts +3 -1
  329. package/src/report/render.ts +24 -39
  330. package/src/report/stale.ts +33 -25
  331. package/src/rule.ts +26 -20
  332. package/src/rules/{built-in.ts → builtIn.ts} +16 -12
  333. package/src/rules/comments/{pattern-rule.ts → definePattern.ts} +5 -4
  334. package/src/rules/comments/kinds.ts +16 -9
  335. package/src/rules/comments/{max-per-file.ts → maxPerFile.ts} +15 -11
  336. package/src/rules/comments/{no-banner.ts → noBanner.ts} +1 -1
  337. package/src/rules/comments/{no-environment-pragma.ts → noEnvironmentPragma.ts} +1 -1
  338. package/src/rules/comments/{no-line-reference.ts → noLineReference.ts} +1 -1
  339. package/src/rules/comments/{no-pr-reference.ts → noPrReference.ts} +1 -1
  340. package/src/rules/comments/{no-todo.ts → noTodo.ts} +1 -1
  341. package/src/rules/comments/scan.ts +18 -15
  342. package/src/rules/manifestsSourceFirst.ts +48 -0
  343. package/src/rules/{max-lines.ts → maxLines.ts} +3 -2
  344. package/src/rules/stories/origins.ts +147 -0
  345. package/src/rules/stories/prerequisites.ts +37 -0
  346. package/src/rules/stories/program.ts +29 -0
  347. package/src/rules/stories/specs.ts +93 -0
  348. package/src/rules/suppressions/biome/configs.ts +23 -17
  349. package/src/rules/suppressions/biome/declarations.ts +15 -10
  350. package/src/rules/suppressions/biome/json.ts +25 -13
  351. package/src/rules/suppressions/biome/resolve.ts +23 -18
  352. package/src/rules/suppressions/biome/weakenings.ts +60 -41
  353. package/src/rules/suppressions/{biome-overrides.ts → biomeOverrides.ts} +32 -22
  354. package/src/rules/suppressions/directives.ts +5 -4
  355. package/src/rules/suppressions/{no-double-cast.ts → noDoubleCast.ts} +14 -10
  356. package/src/rules/suppressions/noIgnoreDeprecations.ts +1 -1
  357. package/src/rules/suppressions/{no-inline.ts → noInline.ts} +6 -5
  358. package/src/rules/suppressions/{stylesheet-comments.ts → stylesheetComments.ts} +11 -6
  359. package/src/rules/syntax.ts +2 -2
  360. package/src/{standard-schema.ts → standardSchema.ts} +4 -4
  361. package/dist/cli/run-main.d.ts.map +0 -1
  362. package/dist/cli/run-main.js.map +0 -1
  363. package/dist/engine/baseline-file.d.ts.map +0 -1
  364. package/dist/engine/baseline-file.js.map +0 -1
  365. package/dist/engine/run-rules.d.ts.map +0 -1
  366. package/dist/engine/run-rules.js +0 -34
  367. package/dist/engine/run-rules.js.map +0 -1
  368. package/dist/imports/pnpm-workspace.d.ts.map +0 -1
  369. package/dist/imports/pnpm-workspace.js.map +0 -1
  370. package/dist/inventory/ignore-scope.d.ts +0 -17
  371. package/dist/inventory/ignore-scope.d.ts.map +0 -1
  372. package/dist/inventory/ignore-scope.js.map +0 -1
  373. package/dist/rules/built-in.d.ts.map +0 -1
  374. package/dist/rules/built-in.js.map +0 -1
  375. package/dist/rules/comments/max-per-file.d.ts.map +0 -1
  376. package/dist/rules/comments/max-per-file.js.map +0 -1
  377. package/dist/rules/comments/no-banner.d.ts.map +0 -1
  378. package/dist/rules/comments/no-banner.js.map +0 -1
  379. package/dist/rules/comments/no-environment-pragma.d.ts.map +0 -1
  380. package/dist/rules/comments/no-environment-pragma.js.map +0 -1
  381. package/dist/rules/comments/no-jsdoc.d.ts.map +0 -1
  382. package/dist/rules/comments/no-jsdoc.js.map +0 -1
  383. package/dist/rules/comments/no-line-reference.d.ts.map +0 -1
  384. package/dist/rules/comments/no-line-reference.js.map +0 -1
  385. package/dist/rules/comments/no-pr-reference.d.ts.map +0 -1
  386. package/dist/rules/comments/no-pr-reference.js.map +0 -1
  387. package/dist/rules/comments/no-todo.d.ts.map +0 -1
  388. package/dist/rules/comments/no-todo.js.map +0 -1
  389. package/dist/rules/comments/pattern-rule.d.ts.map +0 -1
  390. package/dist/rules/comments/pattern-rule.js +0 -16
  391. package/dist/rules/comments/pattern-rule.js.map +0 -1
  392. package/dist/rules/manifests-sorted.d.ts.map +0 -1
  393. package/dist/rules/manifests-sorted.js.map +0 -1
  394. package/dist/rules/max-lines.d.ts.map +0 -1
  395. package/dist/rules/max-lines.js.map +0 -1
  396. package/dist/rules/suppressions/biome-overrides.d.ts.map +0 -1
  397. package/dist/rules/suppressions/biome-overrides.js +0 -63
  398. package/dist/rules/suppressions/biome-overrides.js.map +0 -1
  399. package/dist/rules/suppressions/no-double-cast.d.ts.map +0 -1
  400. package/dist/rules/suppressions/no-double-cast.js.map +0 -1
  401. package/dist/rules/suppressions/no-inline.d.ts.map +0 -1
  402. package/dist/rules/suppressions/no-inline.js.map +0 -1
  403. package/dist/rules/suppressions/stylesheet-comments.d.ts +0 -4
  404. package/dist/rules/suppressions/stylesheet-comments.d.ts.map +0 -1
  405. package/dist/rules/suppressions/stylesheet-comments.js.map +0 -1
  406. package/dist/standard-schema.d.ts.map +0 -1
  407. package/dist/standard-schema.js.map +0 -1
  408. package/src/engine/baseline-file.ts +0 -27
  409. /package/src/imports/{pnpm-workspace.ts → pnpmWorkspacePatterns.ts} +0 -0
  410. /package/src/rules/comments/{no-jsdoc.ts → noJsdoc.ts} +0 -0
  411. /package/src/rules/{manifests-sorted.ts → manifestsSorted.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"directives.js","sourceRoot":"","sources":["../../../src/rules/suppressions/directives.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC9C,yCAAyC;IACzC,gDAAgD;IAChD,qEAAqE;IACrE,uCAAuC;IACvC,kBAAkB;IAClB,4BAA4B;IAC5B,oDAAoD;IACpD,iBAAiB;CACjB,CAAC;AAEF,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAEjE,MAAM,MAAM,GAAG,WAAW,CAAC;AAE3B,MAAM,WAAW,GAAG,CAAC,OAAsB,EAAE,IAAY,EAAsB,EAAE;IAChF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IACnG,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACzH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CA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AC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;AAC5G,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export declare const noDoubleCast: import("#rule.ts").Rule<"suppressions/no-double-cast", undefined>;
2
- //# sourceMappingURL=no-double-cast.d.ts.map
2
+ //# sourceMappingURL=noDoubleCast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noDoubleCast.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/noDoubleCast.ts"],"names":[],"mappings":"AA4CA,eAAO,MAAM,YAAY,mEAMvB,CAAC"}
@@ -6,33 +6,37 @@ const BRIDGES = new Map([
6
6
  [ts.SyntaxKind.AnyKeyword, "any"],
7
7
  [ts.SyntaxKind.NeverKeyword, "never"],
8
8
  ]);
9
- const isAssertion = (node) => ts.isAsExpression(node) || ts.isTypeAssertionExpression(node);
10
- const unwrapped = (node) => (ts.isParenthesizedExpression(node) ? unwrapped(node.expression) : node);
11
- const bridgeOf = (node) => {
9
+ function isAssertion(node) {
10
+ return ts.isAsExpression(node) || ts.isTypeAssertionExpression(node);
11
+ }
12
+ function unwrapped(node) {
13
+ return ts.isParenthesizedExpression(node) ? unwrapped(node.expression) : node;
14
+ }
15
+ function bridgeOf(node) {
12
16
  const inner = unwrapped(node.expression);
13
17
  return isAssertion(inner) ? BRIDGES.get(inner.type.kind) : undefined;
14
- };
15
- const castsIn = (path, source) => {
18
+ }
19
+ function castsIn(path, source) {
16
20
  const findings = [];
17
- const visit = (node) => {
21
+ function visit(node) {
18
22
  const bridge = isAssertion(node) ? bridgeOf(node) : undefined;
19
23
  if (bridge !== undefined) {
20
24
  const line = source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1;
21
25
  findings.push({ file: path, line, message: `Casts through "${bridge}" to reach a type the value does not have.` });
22
26
  }
23
27
  ts.forEachChild(node, visit);
24
- };
28
+ }
25
29
  visit(source);
26
30
  return findings;
27
- };
28
- const doubleCasts = (file) => {
31
+ }
32
+ function doubleCasts(file) {
29
33
  const source = parse(file);
30
34
  return source === undefined ? [] : castsIn(file.path, source);
31
- };
35
+ }
32
36
  export const noDoubleCast = defineRule({
33
37
  check: ({ sources }) => sources.flatMap(doubleCasts),
34
38
  description: "A cast through unknown, any or never silences the compiler the way a suppression does. Decode the value at its boundary, narrow it, or fix the type that disagrees.",
35
39
  id: "suppressions/no-double-cast",
36
40
  registrable: false,
37
41
  });
38
- //# sourceMappingURL=no-double-cast.js.map
42
+ //# sourceMappingURL=noDoubleCast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noDoubleCast.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noDoubleCast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAiC,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,GAAuC,IAAI,GAAG,CAAC;IAC3D,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,EAAE,SAAS,CAAC;IACzC,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC;IACjC,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC;CACrC,CAAC,CAAC;AAIH,SAAS,WAAW,CAAC,IAAa;IACjC,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,SAAS,CAAC,IAAmB;IACrC,OAAO,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/E,CAAC;AAED,SAAS,QAAQ,CAAC,IAAe;IAChC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,UAAU,CAA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,qKAAqK;IACtK,EAAE,EAAE,6BAA6B;IACjC,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { relative } from "node:path";
2
2
  import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
3
3
  import { Effect } from "effect";
4
- import { posix } from "#inventory/ignore-scope.ts";
4
+ import { posix } from "#inventory/ignoreScope.ts";
5
5
  import { walk } from "#inventory/walk.ts";
6
6
  import { defineRule } from "#rule.ts";
7
7
  import { member, parseJsonc } from "#rules/suppressions/biome/json.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"noIgnoreDeprecations.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noIgnoreDeprecations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAgB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC,MAAM,OAAO,GAAG,SAAS,MAAM,qHAAqH,CAAC;AAErJ,SAAS,SAAS,CAAC,IAAY,EAAE,IAAY;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9G,OAAO,OAAO,KAAK,SAAS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E,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1G,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACxH,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7G,CAAC;IACD,WAAW,EACV,gNAAgN;IACjN,EAAE,EAAE,qCAAqC;IACzC,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export declare const noInline: import("#rule.ts").Rule<"suppressions/no-inline", undefined>;
2
- //# sourceMappingURL=no-inline.d.ts.map
2
+ //# sourceMappingURL=noInline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noInline.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/noInline.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,QAAQ,8DASnB,CAAC"}
@@ -1,18 +1,20 @@
1
1
  import { defineRule } from "#rule.ts";
2
2
  import { scanComments } from "#rules/comments/scan.ts";
3
3
  import { suppressionIn } from "./directives.js";
4
- import { STYLESHEET, stylesheetComments } from "./stylesheet-comments.js";
4
+ import { STYLESHEET, stylesheetComments } from "./stylesheetComments.js";
5
5
  const TYPE_TEST = /(?:(?:^|\/)typecheck\.test|\.typecheck\.(?:test|spec))\.[cm]?[jt]sx?$/u;
6
6
  const TYPE_TEST_DIRECTIVE = "@ts-expect-error";
7
- const sitesIn = (file, comments) => comments.flatMap((comment) => {
8
- const directive = suppressionIn(comment);
9
- return directive === undefined ? [] : [{ file, line: comment.line, message: `Suppresses a check: "${directive}".`, subject: directive }];
10
- });
11
- const stylesheetSites = async ({ files, readText, sources }) => {
7
+ function sitesIn(file, comments) {
8
+ return comments.flatMap((comment) => {
9
+ const directive = suppressionIn(comment);
10
+ return directive === undefined ? [] : [{ file, line: comment.line, message: `Suppresses a check: "${directive}".`, subject: directive }];
11
+ });
12
+ }
13
+ async function stylesheetSites({ files, readText, sources }) {
12
14
  const read = files.filter((path) => STYLESHEET.test(path));
13
15
  const texts = await Promise.all(read.map(async (path) => sources.find((source) => source.path === path)?.text ?? (await readText(path))));
14
16
  return read.flatMap((path, index) => sitesIn(path, stylesheetComments(path, texts[index] ?? "")));
15
- };
17
+ }
16
18
  function allowed(site) {
17
19
  return site.subject === TYPE_TEST_DIRECTIVE && TYPE_TEST.test(site.file);
18
20
  }
@@ -22,4 +24,4 @@ export const noInline = defineRule({
22
24
  id: "suppressions/no-inline",
23
25
  registrable: false,
24
26
  });
25
- //# sourceMappingURL=no-inline.js.map
27
+ //# sourceMappingURL=noInline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noInline.js","sourceRoot":"","sources":["../../../src/rules/suppressions/noInline.ts"],"names":[],"mappings":"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AAI,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACnG,CAAC;AAED,SAAS,OAAO,CAAC,IAAU;IAC1B,OAAO,IAAI,CAAC,OAAO,KAAK,mBAAmB,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CACvB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CACvH,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CACxB;IACF,WAAW,EACV,0PAA0P;IAC3P,EAAE,EAAE,wBAAwB;IAC5B,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type SourceComment } from "#rules/comments/scan.ts";
2
+ export declare const STYLESHEET: RegExp;
3
+ export declare function stylesheetComments(path: string, text: string): readonly SourceComment[];
4
+ //# sourceMappingURL=stylesheetComments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stylesheetComments.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheetComments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,UAAU,QAA0B,CAAC;AA2BlD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,CAEvF"}
@@ -2,9 +2,13 @@ import { bodyOf } from "#rules/comments/scan.ts";
2
2
  export const STYLESHEET = /\.(?:css|scss|less)$/u;
3
3
  const LINE_COMMENTS = /\.(?:scss|less)$/u;
4
4
  const TOKENS = String.raw `"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|url\([^)]*\)?|\/\*[\s\S]*?(?:\*\/|$)`;
5
- const tokensOf = (path) => new RegExp(LINE_COMMENTS.test(path) ? `${TOKENS}|\\/\\/[^\\n]*` : TOKENS, "giu");
6
- const lineOf = (text, offset) => text.slice(0, offset).split("\n").length;
7
- const toComment = (text, token, offset) => {
5
+ function tokensOf(path) {
6
+ return new RegExp(LINE_COMMENTS.test(path) ? `${TOKENS}|\\/\\/[^\\n]*` : TOKENS, "giu");
7
+ }
8
+ function lineOf(text, offset) {
9
+ return text.slice(0, offset).split("\n").length;
10
+ }
11
+ function toComment(text, token, offset) {
8
12
  const kind = token.startsWith("//") ? "line" : "block";
9
13
  const lineStart = text.lastIndexOf("\n", offset - 1) + 1;
10
14
  return {
@@ -15,6 +19,8 @@ const toComment = (text, token, offset) => {
15
19
  ownLine: text.slice(lineStart, offset).trim() === "",
16
20
  text: token,
17
21
  };
18
- };
19
- export const stylesheetComments = (path, text) => [...text.matchAll(tokensOf(path))].flatMap((match) => (match[0].startsWith("/") ? [toComment(text, match[0], match.index)] : []));
20
- //# sourceMappingURL=stylesheet-comments.js.map
22
+ }
23
+ export function stylesheetComments(path, text) {
24
+ return [...text.matchAll(tokensOf(path))].flatMap((match) => (match[0].startsWith("/") ? [toComment(text, match[0], match.index)] : []));
25
+ }
26
+ //# sourceMappingURL=stylesheetComments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stylesheetComments.js","sourceRoot":"","sources":["../../../src/rules/suppressions/stylesheetComments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,yBAAyB,CAAC;AAErE,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KACX,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,IAAY;IAC5D,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1I,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import ts from "typescript";
2
2
  import type { SourceFile } from "#rule.ts";
3
- export declare const parse: (file: SourceFile) => ts.SourceFile | undefined;
3
+ export declare function parse(file: SourceFile): ts.SourceFile | undefined;
4
4
  //# sourceMappingURL=syntax.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../src/rules/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,eAAO,MAAM,KAAK,SAAU,UAAU,KAAG,EAAE,CAAC,UAAU,GAAG,SAGxD,CAAC"}
1
+ {"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../src/rules/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU,GAAG,SAAS,CAGjE"}
@@ -5,8 +5,8 @@ const SCRIPT_KINDS = [
5
5
  [/\.[cm]?js$/u, ts.ScriptKind.JS],
6
6
  [/\.jsx$/u, ts.ScriptKind.JSX],
7
7
  ];
8
- export const parse = (file) => {
8
+ export function parse(file) {
9
9
  const kind = SCRIPT_KINDS.find(([pattern]) => pattern.test(file.path))?.[1];
10
10
  return kind === undefined ? undefined : ts.createSourceFile(file.path, file.text, ts.ScriptTarget.Latest, true, kind);
11
- };
11
+ }
12
12
  //# sourceMappingURL=syntax.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"syntax.js","sourceRoot":"","sources":["../../src/rules/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,YAAY,GAAoD;IACrE,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;IAC9B,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAgB,EAA6B,EAAE;IACpE,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACvH,CAAC,CAAC"}
1
+ {"version":3,"file":"syntax.js","sourceRoot":"","sources":["../../src/rules/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,YAAY,GAAoD;IACrE,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;IAC9B,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;CAC9B,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,IAAgB;IACrC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACvH,CAAC"}
@@ -1,16 +1,16 @@
1
- export interface StandardSchemaV1<Input = unknown, Output = Input> {
1
+ export interface StandardSchemaV1<TInput = unknown, TOutput = TInput> {
2
2
  readonly "~standard": {
3
3
  readonly version: 1;
4
4
  readonly vendor: string;
5
- readonly validate: (value: unknown) => StandardResult<Output> | Promise<StandardResult<Output>>;
5
+ readonly validate: (value: unknown) => StandardResult<TOutput> | Promise<StandardResult<TOutput>>;
6
6
  readonly types?: {
7
- readonly input: Input;
8
- readonly output: Output;
7
+ readonly input: TInput;
8
+ readonly output: TOutput;
9
9
  } | undefined;
10
10
  };
11
11
  }
12
- export type StandardResult<Output> = {
13
- readonly value: Output;
12
+ export type StandardResult<TOutput> = {
13
+ readonly value: TOutput;
14
14
  readonly issues?: undefined;
15
15
  } | {
16
16
  readonly issues: readonly StandardIssue[];
@@ -22,4 +22,4 @@ export interface StandardIssue {
22
22
  }> | undefined;
23
23
  }
24
24
  export declare function describeIssue(issue: StandardIssue): string;
25
- //# sourceMappingURL=standard-schema.d.ts.map
25
+ //# sourceMappingURL=standardSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardSchema.d.ts","sourceRoot":"","sources":["../src/standardSchema.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,MAAM;IACnE,QAAQ,CAAC,WAAW,EAAE;QACrB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QAClG,QAAQ,CAAC,KAAK,CAAC,EAAE;YAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;SAAE,GAAG,SAAS,CAAC;KAClF,CAAC;CACF;AAED,MAAM,MAAM,cAAc,CAAC,OAAO,IAAI;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,CAAC;AAE/I,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,GAAG;QAAE,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;CACvF;AAWD,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE1D"}
@@ -8,4 +8,4 @@ function segment(part) {
8
8
  export function describeIssue(issue) {
9
9
  return issue.path === undefined || issue.path.length === 0 ? issue.message : `${issue.path.map(segment).join(".")}: ${issue.message}`;
10
10
  }
11
- //# sourceMappingURL=standard-schema.js.map
11
+ //# sourceMappingURL=standardSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardSchema.js","sourceRoot":"","sources":["../src/standardSchema.ts"],"names":[],"mappings":"AAkBA,2HAA2H;AAC3H,SAAS,OAAO,CAAC,GAAgB;IAChC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,OAAO,CAAC,IAAiD;IACjE,OAAO,OAAO,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAoB;IACjD,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;AACvI,CAAC"}
@@ -1,6 +1,6 @@
1
1
  # Existing debt, exceptions and commit checks
2
2
 
3
- The [README](../README.md) introduces the gate. Adopt the whole policy with its default error levels; use the baseline to retain old debt rather than warning or off settings. This page explains how to record debt, keep it current as files change and run the gate at commit time. The wider accepted severity API is described under [configuration limits](../README.md#configuration-limits).
3
+ The [README](../README.md) introduces the gate. Adopt the whole policy at error level; use the baseline to retain old debt. This page explains how to record debt, keep it current as files change and run the gate at commit time.
4
4
 
5
5
  ## Baseline
6
6
 
@@ -11,7 +11,7 @@ The [README](../README.md) introduces the gate. Adopt the whole policy with its
11
11
 
12
12
  The baseline is a JSON Lines file with one entry per line: the violations of one rule in one file. `count` is how many violations the file may have. For a rule that counts occurrences, such as `comments/no-jsdoc`, that is the number of occurrences. For a rule with a limit, it is the amount over the limit: the entry above lets `src/server/db.ts` have 412 lines under a limit of 150. A new baseline is sorted by path and then rule. Later edits preserve unrelated lines, including their formatting and order, so the diff shows the entries that changed.
13
13
 
14
- For an error-level rule, `quality lint` fails when a baselined file has more violations than its `count`; the report then lists all of that file's violations for the rule. The accepted warning-level API does not fail on uncovered findings; it is outside the recommended adoption path. A file at or below its entry passes. An entry that allows more than is left, including a file with no violations left, is listed as a note and does not fail, so fixing debt never breaks the build; `tighten` and `prune` lower it. An entry for a rule that is off or unknown fails until it is pruned. The baseline covers violations at any level.
14
+ `quality lint` fails when a baselined file has more violations than its `count`; the report then lists all of that file's violations for the rule. A file at or below its entry passes. An entry that allows more than is left, including a file with no violations left, is listed as a note and does not fail, so fixing debt never breaks the build; `tighten` and `prune` lower it. An entry for an unknown rule fails until it is pruned.
15
15
 
16
16
  - `quality baseline write` records every error-level violation when there is no baseline yet. Once a baseline exists it refuses, unless `--rule <id>` names the rules to record: it then replaces the entries of those rules with what the files have now, and leaves every other entry as it is.
17
17
  - `quality baseline tighten` lowers and removes the entries of files changed since `HEAD`, and with `--staged`, of the files staged for the next commit. It carries the entry of a file that git sees as moved to the new path. Every other line stays byte for byte.
package/docs/modules.md CHANGED
@@ -9,11 +9,11 @@ A module link opens its source. Type and value declarations with the same name a
9
9
  | Module | Exported names |
10
10
  | --- | --- |
11
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` |
12
+ | [config.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/config.ts) | `Level` (`"error"`), `RuleSetting`, `RuleSettings`, `BuiltInRules`, `QualityConfig`, `defineConfig` |
13
13
  | [decoded.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/decoded.ts) | `Decoded`, `decodeWith`, `validOrFail` |
14
14
  | [failure.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/failure.ts) | `SetupFailure`, `GateFailed` |
15
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` |
16
+ | [standardSchema.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/standardSchema.ts) | `StandardSchemaV1`, `StandardResult`, `StandardIssue`, `describeIssue` |
17
17
  | [testProjects.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/testProjects.ts) | `testProjects` |
18
18
 
19
19
  ## baseline
@@ -50,7 +50,7 @@ A module link opens its source. Type and value declarations with the same name a
50
50
  | [cli/migrate.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/migrate.ts) | `migrateBaseline` |
51
51
  | [cli/migrateExceptions.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/migrateExceptions.ts) | `migrateExceptions` |
52
52
  | [cli/program.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/program.ts) | `Invocation`, `program` |
53
- | [cli/run-main.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/run-main.ts) | `exitCode`, `quietOnClosedPipe`, `services`, `explained`, `runMain` |
53
+ | [cli/runMain.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/runMain.ts) | `exitCode`, `quietOnClosedPipe`, `services`, `explained`, `runMain` |
54
54
  | [cli/shrink.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/cli/shrink.ts) | `pruneBaseline`, `tightenBaseline` |
55
55
 
56
56
  ## config
@@ -66,11 +66,11 @@ A module link opens its source. Type and value declarations with the same name a
66
66
 
67
67
  | Module | Exported names |
68
68
  | --- | --- |
69
- | [engine/baseline-file.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/baseline-file.ts) | `BaselineFile`, `readInput`, `readBaseline` |
69
+ | [engine/baselineFile.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/baselineFile.ts) | `BaselineFile`, `readInput`, `readBaseline` |
70
70
  | [engine/evaluate.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/evaluate.ts) | `Outcome`, `evaluate`, `passes` |
71
- | [engine/run-rules.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/run-rules.ts) | `ActiveRule`, `runRules` |
71
+ | [engine/runRules.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/runRules.ts) | `ActiveRule`, `runRules` |
72
72
  | [engine/session.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/session.ts) | `Session`, `scan`, `openSession` |
73
- | [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` |
73
+ | [engine/violation.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/engine/violation.ts) | `ActiveLevel` (`"error"`), `Violation`, `keyOf`, `byLocation`, `groupBy`, `RuleIndex`, `covers`, `levelOf`, `registrable`, `unusedEntryProblem` |
74
74
 
75
75
  ## exceptions
76
76
 
@@ -116,7 +116,7 @@ A module link opens its source. Type and value declarations with the same name a
116
116
  | [imports/glob.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/glob.ts) | `globMatcher` |
117
117
  | [imports/graph.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/graph.ts) | `ImportEdge`, `UnresolvedImport`, `ImportGraph`, `importGraph` |
118
118
  | [imports/paths.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/paths.ts) | `shortestPath` |
119
- | [imports/pnpm-workspace.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/pnpm-workspace.ts) | `pnpmWorkspacePatterns` |
119
+ | [imports/pnpmWorkspacePatterns.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/pnpmWorkspacePatterns.ts) | `pnpmWorkspacePatterns` |
120
120
  | [imports/projects.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/projects.ts) | `Project`, `projectsFor` |
121
121
  | [imports/resolve.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/resolve.ts) | `Endpoint`, `builtinName`, `packageNameOf`, `isDeclarationFile`, `presumedTarget`, `resolveImport` |
122
122
  | [imports/runtime.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/imports/runtime.ts) | `Runtime`, `runtimeOf` |
@@ -145,7 +145,7 @@ A module link opens its source. Type and value declarations with the same name a
145
145
  | --- | --- |
146
146
  | [inventory/collect.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/collect.ts) | `InventoryScope`, `Inventory`, `linesOf`, `collectInventory` |
147
147
  | [inventory/filesystem.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/filesystem.ts) | `FilesystemFailure`, `orWhenAbsent`, `readOptionalText`, `readRequiredText`, `writeText` |
148
- | [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` |
148
+ | [inventory/ignoreScope.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/ignoreScope.ts) | `Verdict`, `IgnoreScope`, `emptyScope`, `posix`, `withIgnoreFile`, `insideKept`, `verdictFor` |
149
149
  | [inventory/trackedPaths.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/trackedPaths.ts) | `trackedPaths`, `ignoredTrackedPaths` |
150
150
  | [inventory/walk.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/inventory/walk.ts) | `ignoreScopeAt`, `scopeAbove`, `walk` |
151
151
 
@@ -171,7 +171,7 @@ A module link opens its source. Type and value declarations with the same name a
171
171
  | Module | Exported names |
172
172
  | --- | --- |
173
173
  | [report/plural.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/plural.ts) | `plural` |
174
- | [report/render.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/render.ts) | `WarningDetail`, `ReportContext`, `render` |
174
+ | [report/render.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/render.ts) | `ReportContext`, `render` |
175
175
  | [report/stale.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/report/stale.ts) | `staleSections` |
176
176
 
177
177
  ## rules
@@ -179,9 +179,12 @@ A module link opens its source. Type and value declarations with the same name a
179
179
  | Module | Exported names |
180
180
  | --- | --- |
181
181
  | [rules/biome.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/biome.ts) | `PRESET`, `rootConfig`, `biome` |
182
- | [rules/built-in.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/built-in.ts) | `builtInRules` |
183
- | [rules/manifests-sorted.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/manifests-sorted.ts) | `manifestsSorted` |
184
- | [rules/max-lines.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/max-lines.ts) | `maxLines` |
182
+ | [rules/builtIn.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/builtIn.ts) | `builtInRules` |
183
+ | [rules/manifestsSorted.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/manifestsSorted.ts) | `manifestsSorted` |
184
+ | [rules/manifestsSourceFirst.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/manifestsSourceFirst.ts) | `manifestsSourceFirst` |
185
+ | [rules/maxLines.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/maxLines.ts) | `maxLines` |
186
+ | [rules/maxDepth.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/maxDepth.ts) | `maxDepth` |
187
+ | [rules/noBarrel.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/noBarrel.ts) | `noBarrel` |
185
188
  | [rules/syntax.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/syntax.ts) | `parse` |
186
189
 
187
190
  ## rules/comments
@@ -189,14 +192,14 @@ A module link opens its source. Type and value declarations with the same name a
189
192
  | Module | Exported names |
190
193
  | --- | --- |
191
194
  | [rules/comments/kinds.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/kinds.ts) | `Pragmas`, `textOf`, `isJsdoc`, `isPragma`, `isDirective` |
192
- | [rules/comments/max-per-file.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/max-per-file.ts) | `maxPerFile` |
193
- | [rules/comments/no-banner.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-banner.ts) | `noBanner` |
194
- | [rules/comments/no-environment-pragma.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-environment-pragma.ts) | `noEnvironmentPragma` |
195
- | [rules/comments/no-jsdoc.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-jsdoc.ts) | `noJsdoc` |
196
- | [rules/comments/no-line-reference.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-line-reference.ts) | `noLineReference` |
197
- | [rules/comments/no-pr-reference.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-pr-reference.ts) | `noPrReference` |
198
- | [rules/comments/no-todo.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/no-todo.ts) | `noTodo` |
199
- | [rules/comments/pattern-rule.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/pattern-rule.ts) | `definePatternRule` |
195
+ | [rules/comments/maxPerFile.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/maxPerFile.ts) | `maxPerFile` |
196
+ | [rules/comments/noBanner.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/noBanner.ts) | `noBanner` |
197
+ | [rules/comments/noEnvironmentPragma.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/noEnvironmentPragma.ts) | `noEnvironmentPragma` |
198
+ | [rules/comments/noJsdoc.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/noJsdoc.ts) | `noJsdoc` |
199
+ | [rules/comments/noLineReference.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/noLineReference.ts) | `noLineReference` |
200
+ | [rules/comments/noPrReference.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/noPrReference.ts) | `noPrReference` |
201
+ | [rules/comments/noTodo.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/noTodo.ts) | `noTodo` |
202
+ | [rules/comments/definePattern.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/definePattern.ts) | `definePatternRule` |
200
203
  | [rules/comments/scan.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/comments/scan.ts) | `SourceComment`, `bodyOf`, `scanComments`, `commentsOf` |
201
204
 
202
205
  ## rules/files
@@ -233,13 +236,13 @@ A module link opens its source. Type and value declarations with the same name a
233
236
 
234
237
  | Module | Exported names |
235
238
  | --- | --- |
236
- | [rules/suppressions/biome-overrides.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biome-overrides.ts) | `biomeOverrides` |
239
+ | [rules/suppressions/biomeOverrides.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biomeOverrides.ts) | `biomeOverrides` |
237
240
  | [rules/suppressions/biomeRecommended.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/biomeRecommended.ts) | `biomeRecommendedFrom`, `biomeRecommended` |
238
241
  | [rules/suppressions/directives.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/directives.ts) | `SUPPRESSIONS`, `suppressionIn` |
239
- | [rules/suppressions/no-double-cast.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/no-double-cast.ts) | `noDoubleCast` |
240
- | [rules/suppressions/no-inline.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/no-inline.ts) | `noInline` |
242
+ | [rules/suppressions/noDoubleCast.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/noDoubleCast.ts) | `noDoubleCast` |
243
+ | [rules/suppressions/noInline.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/noInline.ts) | `noInline` |
241
244
  | [rules/suppressions/noIgnoreDeprecations.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/noIgnoreDeprecations.ts) | `noIgnoreDeprecations` |
242
- | [rules/suppressions/stylesheet-comments.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/stylesheet-comments.ts) | `STYLESHEET`, `stylesheetComments` |
245
+ | [rules/suppressions/stylesheetComments.ts](https://github.com/ShivaeDev/platform/blob/main/packages/quality/src/rules/suppressions/stylesheetComments.ts) | `STYLESHEET`, `stylesheetComments` |
243
246
 
244
247
  ## rules/suppressions/biome
245
248
 
package/docs/roadmap.md CHANGED
@@ -4,6 +4,7 @@ This page owns Quality's shared policy, tooling, CLI and hook implementation sta
4
4
 
5
5
  ## Built
6
6
 
7
+ - [x] Error-only engine and report, with no CLI warning-report controls; old-debt adoption stays in the baseline.
7
8
  - [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
9
  - [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
10
  - [x] A JSON Lines baseline with counted debt, explicit named-rule recording, lowering and pruning, tracked-move handling and preservation of unrelated lines.
@@ -20,7 +21,6 @@ This page owns Quality's shared policy, tooling, CLI and hook implementation sta
20
21
 
21
22
  ## Next
22
23
 
23
- - [ ] Remove obsolete CLI warning-report controls; config levels are already enforced at `error`. Keep old-debt adoption in the baseline.
24
24
  - [ ] 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.
25
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
26
  - [ ] Define the Effect-boundary rule's source and test scope before porting the repository's `try`/`async` restrictions.
package/docs/rules.md CHANGED
@@ -249,6 +249,8 @@ A finding has its fence's name as its subject, so a config exception with that s
249
249
 
250
250
  `manifests/sorted` keeps every `package.json` in the repository in the key order of [sort-package-json](https://github.com/keithamus/sort-package-json), a dependency of this package. It walks the whole repository, not only the sources, and skips untracked files ignored by git and `node_modules`. A manifest that is not valid JSON is reported too. `quality fix` sorts the manifests, and the rule takes no exceptions.
251
251
 
252
+ `manifests/source-first` reports each condition block in the `exports` or `imports` of a `package.json` that names the `source` condition after another condition, nested blocks included. TypeScript takes the first condition that matches, and `types` always matches, so once built output exists a block that lists `types` first sends TypeScript to the built declarations instead of the sources. Each finding names the line of the block. Move `source` to the top of it. Like `manifests/sorted`, the rule walks the whole repository and takes no exceptions.
253
+
252
254
  ## Local-rule API
253
255
 
254
256
  The API allows a local rule to receive checked source text and return findings. This is an extension reference, not a step every repository must complete; reusable quality policy belongs in the shared package. This example is the same text-scanning rule exercised by the package's CLI tests:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/quality",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
5
5
  "homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
6
6
  "bugs": {
@@ -24,9 +24,8 @@
24
24
  },
25
25
  "exports": {
26
26
  "./*.ts": {
27
- "types": "./dist/*.d.ts",
28
27
  "source": "./src/*.ts",
29
- "import": "./dist/*.js",
28
+ "types": "./dist/*.d.ts",
30
29
  "default": "./dist/*.js"
31
30
  },
32
31
  "./biome": "./biome/preset.json",
@@ -19,9 +19,11 @@ export interface BaselineCheck {
19
19
  readonly stale: readonly StaleBaselineEntry[];
20
20
  }
21
21
 
22
- export const countOf = (violations: readonly Violation[]): number => violations.reduce((total, violation) => total + (violation.count ?? 1), 0);
22
+ export function countOf(violations: readonly Violation[]): number {
23
+ return violations.reduce((total, violation) => total + (violation.count ?? 1), 0);
24
+ }
23
25
 
24
- export const applyBaseline = (violations: readonly Violation[], entries: readonly BaselineEntry[], rules: RuleIndex): BaselineCheck => {
26
+ export function applyBaseline(violations: readonly Violation[], entries: readonly BaselineEntry[], rules: RuleIndex): BaselineCheck {
25
27
  const groups = groupBy(violations, (violation) => keyOf(violation.rule, violation.file));
26
28
  const covered = new Set<string>();
27
29
  const regressions: Regression[] = [];
@@ -31,7 +33,7 @@ export const applyBaseline = (violations: readonly Violation[], entries: readonl
31
33
  const group = groups.get(keyOf(entry.rule, entry.file)) ?? [];
32
34
  if (group.length === 0) {
33
35
  const level = levelOf(rules, entry.rule);
34
- (level === undefined || level === "off" ? stale : loose).push({
36
+ (level === undefined ? stale : loose).push({
35
37
  entry,
36
38
  problem: unusedEntryProblem(rules, entry.rule, "has no violations left"),
37
39
  });
@@ -49,4 +51,4 @@ export const applyBaseline = (violations: readonly Violation[], entries: readonl
49
51
  }
50
52
  const kept = violations.filter((violation) => !covered.has(keyOf(violation.rule, violation.file)));
51
53
  return { baselined: violations.length - kept.length, kept, loose, regressions, stale };
52
- };
54
+ }
@@ -16,18 +16,22 @@ export interface BaselineEntry {
16
16
  readonly rule: string;
17
17
  }
18
18
 
19
- const codepoints = (left: string, right: string): number => (left < right ? -1 : Number(left > right));
19
+ function codepoints(left: string, right: string): number {
20
+ return left < right ? -1 : Number(left > right);
21
+ }
20
22
 
21
- export const byPathAndRule = (left: BaselineEntry, right: BaselineEntry): number =>
22
- codepoints(left.file, right.file) || codepoints(left.rule, right.rule);
23
+ export function byPathAndRule(left: BaselineEntry, right: BaselineEntry): number {
24
+ return codepoints(left.file, right.file) || codepoints(left.rule, right.rule);
25
+ }
23
26
 
24
- export const linesOf = (raw: string | undefined): ReadonlyArray<{ readonly line: number; readonly text: string }> =>
25
- (raw ?? "")
27
+ export function linesOf(raw: string | undefined): ReadonlyArray<{ readonly line: number; readonly text: string }> {
28
+ return (raw ?? "")
26
29
  .split("\n")
27
30
  .map((text, index) => ({ line: index + 1, text }))
28
31
  .filter((row) => row.text.trim() !== "");
32
+ }
29
33
 
30
- export const decodeBaseline = async (raw: string | undefined): Promise<Decoded<readonly BaselineEntry[]>> => {
34
+ export async function decodeBaseline(raw: string | undefined): Promise<Decoded<readonly BaselineEntry[]>> {
31
35
  const issues: string[] = [];
32
36
  const entries: BaselineEntry[] = [];
33
37
  const seen = new Set<string>();
@@ -45,14 +49,17 @@ export const decodeBaseline = async (raw: string | undefined): Promise<Decoded<r
45
49
  entries.push({ ...stored, file: path });
46
50
  }
47
51
  return issues.length === 0 ? { _tag: "Valid", value: entries } : { _tag: "Invalid", issues };
48
- };
52
+ }
49
53
 
50
54
  const LINE_KEYS = ["path", "rule", "count"];
51
55
 
52
- export const encodeEntry = (entry: BaselineEntry): string => JSON.stringify({ count: entry.count, path: entry.file, rule: entry.rule }, LINE_KEYS);
56
+ export function encodeEntry(entry: BaselineEntry): string {
57
+ return JSON.stringify({ count: entry.count, path: entry.file, rule: entry.rule }, LINE_KEYS);
58
+ }
53
59
 
54
- export const encodeBaseline = (entries: readonly BaselineEntry[]): string =>
55
- [...entries]
60
+ export function encodeBaseline(entries: readonly BaselineEntry[]): string {
61
+ return [...entries]
56
62
  .sort(byPathAndRule)
57
63
  .map((entry) => `${encodeEntry(entry)}\n`)
58
64
  .join("");
65
+ }
@@ -19,7 +19,7 @@ export interface LegacyEntry extends BaselineEntry {
19
19
  readonly measure?: number | undefined;
20
20
  }
21
21
 
22
- export const decodeLegacyBaseline = async (raw: string): Promise<Decoded<readonly LegacyEntry[]>> => {
22
+ export async function decodeLegacyBaseline(raw: string): Promise<Decoded<readonly LegacyEntry[]>> {
23
23
  const decoded = await decodeWith(standard, raw);
24
24
  if (decoded._tag === "Invalid") {
25
25
  return decoded;
@@ -28,9 +28,9 @@ export const decodeLegacyBaseline = async (raw: string): Promise<Decoded<readonl
28
28
  Object.entries(files).map(([file, stored]) => ({ ...stored, file, rule })),
29
29
  );
30
30
  return { _tag: "Valid", value: entries };
31
- };
31
+ }
32
32
 
33
- export const convertLegacy = (legacy: readonly LegacyEntry[], violations: readonly Violation[]): readonly BaselineEntry[] => {
33
+ export function convertLegacy(legacy: readonly LegacyEntry[], violations: readonly Violation[]): readonly BaselineEntry[] {
34
34
  const current = groupBy(violations, (violation) => keyOf(violation.rule, violation.file));
35
35
  return legacy.flatMap(({ count, file, measure, rule }) => {
36
36
  if (measure === undefined) {
@@ -41,4 +41,4 @@ export const convertLegacy = (legacy: readonly LegacyEntry[], violations: readon
41
41
  const converted = threshold === undefined ? countOf(group) : Math.ceil(measure - threshold);
42
42
  return converted > 0 ? [{ count: converted, file, rule }] : [];
43
43
  });
44
- };
44
+ }
@@ -7,7 +7,7 @@ interface Row {
7
7
  }
8
8
 
9
9
  // An untouched entry keeps its exact line and a new one goes before the first line that sorts after it, so two branches conflict only on the same or neighbouring entries.
10
- export const rewriteBaseline = (raw: string | undefined, before: readonly BaselineEntry[], after: readonly BaselineEntry[]): string => {
10
+ export function rewriteBaseline(raw: string | undefined, before: readonly BaselineEntry[], after: readonly BaselineEntry[]): string {
11
11
  const wanted = new Map(after.map((entry) => [keyOf(entry.rule, entry.file), entry]));
12
12
  const lines = linesOf(raw);
13
13
  const rows: Row[] = before.flatMap((old, index) => {
@@ -21,4 +21,4 @@ export const rewriteBaseline = (raw: string | undefined, before: readonly Baseli
21
21
  rows.splice(at === -1 ? rows.length : at, 0, { entry, text: encodeEntry(entry) });
22
22
  }
23
23
  return rows.map((row) => `${row.text}\n`).join("");
24
- };
24
+ }