@dereekb/util 13.11.14 → 13.11.15

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 (204) hide show
  1. package/eslint/index.cjs.js +10008 -394
  2. package/eslint/index.esm.js +9982 -392
  3. package/eslint/package.json +4 -4
  4. package/eslint/src/lib/comments.d.ts +14 -3
  5. package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
  6. package/eslint/src/lib/index.d.ts +26 -3
  7. package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
  8. package/eslint/src/lib/no-inline-string-empty-object-intersection.rule.d.ts +44 -0
  9. package/eslint/src/lib/no-inline-type-import.rule.d.ts +38 -0
  10. package/eslint/src/lib/no-sister-re-export.rule.d.ts +69 -0
  11. package/eslint/src/lib/plugin.d.ts +52 -1
  12. package/eslint/src/lib/prefer-canonical-jsdoc.rule.d.ts +68 -0
  13. package/eslint/src/lib/prefer-config-object.rule.d.ts +61 -0
  14. package/eslint/src/lib/prefer-maybe-type.rule.d.ts +72 -0
  15. package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +1 -1
  16. package/eslint/src/lib/prefer-suggested-string.rule.d.ts +51 -0
  17. package/eslint/src/lib/require-constant-naming.rule.d.ts +63 -0
  18. package/eslint/src/lib/require-dbx-action-companion-tags.rule.d.ts +46 -0
  19. package/eslint/src/lib/require-dbx-auth-companion-tags.rule.d.ts +45 -0
  20. package/eslint/src/lib/require-dbx-docs-ui-example-companion-tags.rule.d.ts +42 -0
  21. package/eslint/src/lib/require-dbx-filter-companion-tags.rule.d.ts +43 -0
  22. package/eslint/src/lib/require-dbx-form-field-companion-tags.rule.d.ts +46 -0
  23. package/eslint/src/lib/require-dbx-model-companion-tags.rule.d.ts +46 -0
  24. package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +44 -0
  25. package/eslint/src/lib/require-dbx-model-snapshot-field-companion-tags.rule.d.ts +44 -0
  26. package/eslint/src/lib/require-dbx-pipe-companion-tags.rule.d.ts +43 -0
  27. package/eslint/src/lib/require-dbx-rule-companion-tags.rule.d.ts +44 -0
  28. package/eslint/src/lib/require-dbx-util-companion-tags.rule.d.ts +74 -0
  29. package/eslint/src/lib/require-dbx-web-companion-tags.rule.d.ts +43 -0
  30. package/eslint/src/lib/require-default-prefix-naming.rule.d.ts +60 -0
  31. package/eslint/src/lib/require-deprecated-alias-placement.rule.d.ts +75 -0
  32. package/eslint/src/lib/require-exported-jsdoc-example.rule.d.ts +61 -0
  33. package/eslint/src/lib/require-no-side-effects.rule.d.ts +1 -1
  34. package/eslint/src/lib/require-readonly-config-params.rule.d.ts +57 -0
  35. package/eslint/src/lib/require-single-return.rule.d.ts +42 -0
  36. package/fetch/index.cjs.js +95 -80
  37. package/fetch/index.esm.js +95 -80
  38. package/fetch/package.json +2 -2
  39. package/fetch/src/lib/error.d.ts +2 -2
  40. package/fetch/src/lib/fetch.d.ts +15 -15
  41. package/fetch/src/lib/fetch.file.d.ts +5 -5
  42. package/fetch/src/lib/fetch.limit.d.ts +2 -2
  43. package/fetch/src/lib/fetch.page.d.ts +1 -1
  44. package/fetch/src/lib/fetch.page.iterate.d.ts +4 -4
  45. package/fetch/src/lib/fetch.type.d.ts +3 -2
  46. package/fetch/src/lib/fetch.url.d.ts +13 -13
  47. package/fetch/src/lib/json.d.ts +12 -12
  48. package/fetch/src/lib/timeout.d.ts +2 -2
  49. package/fetch/src/lib/url.d.ts +11 -11
  50. package/index.cjs.js +2592 -2329
  51. package/index.esm.js +2590 -2327
  52. package/package.json +1 -1
  53. package/src/lib/array/array.boolean.d.ts +20 -20
  54. package/src/lib/array/array.d.ts +73 -72
  55. package/src/lib/array/array.factory.d.ts +8 -5
  56. package/src/lib/array/array.filter.d.ts +23 -20
  57. package/src/lib/array/array.find.d.ts +9 -8
  58. package/src/lib/array/array.index.d.ts +15 -14
  59. package/src/lib/array/array.indexed.d.ts +22 -19
  60. package/src/lib/array/array.make.d.ts +3 -2
  61. package/src/lib/array/array.map.d.ts +5 -5
  62. package/src/lib/array/array.number.d.ts +27 -27
  63. package/src/lib/array/array.random.d.ts +11 -10
  64. package/src/lib/array/array.set.d.ts +14 -14
  65. package/src/lib/array/array.string.d.ts +31 -31
  66. package/src/lib/array/array.unique.d.ts +22 -20
  67. package/src/lib/array/array.value.d.ts +3 -2
  68. package/src/lib/assertion/assert.error.d.ts +8 -8
  69. package/src/lib/assertion/assertion.d.ts +5 -5
  70. package/src/lib/assertion/assertion.generic.d.ts +3 -3
  71. package/src/lib/assertion/assertion.number.d.ts +6 -6
  72. package/src/lib/auth/auth.role.claims.d.ts +12 -11
  73. package/src/lib/auth/auth.role.d.ts +3 -3
  74. package/src/lib/auth/pkce.d.ts +2 -2
  75. package/src/lib/boolean.d.ts +11 -11
  76. package/src/lib/cache/cache.memoize.d.ts +6 -6
  77. package/src/lib/contact/domain.d.ts +9 -9
  78. package/src/lib/contact/email.d.ts +11 -11
  79. package/src/lib/contact/phone.d.ts +12 -12
  80. package/src/lib/contact/random.d.ts +11 -9
  81. package/src/lib/date/date.d.ts +60 -59
  82. package/src/lib/date/date.time.d.ts +2 -2
  83. package/src/lib/date/date.unix.d.ts +8 -8
  84. package/src/lib/date/duration.d.ts +17 -17
  85. package/src/lib/date/expires.d.ts +29 -27
  86. package/src/lib/date/hour.d.ts +23 -23
  87. package/src/lib/date/minute.d.ts +6 -6
  88. package/src/lib/date/time.d.ts +10 -9
  89. package/src/lib/date/week.d.ts +32 -31
  90. package/src/lib/encryption/encryption.object.d.ts +3 -3
  91. package/src/lib/error/error.d.ts +13 -12
  92. package/src/lib/error/error.server.d.ts +4 -4
  93. package/src/lib/file/pdf.d.ts +4 -4
  94. package/src/lib/filter/filter.d.ts +3 -2
  95. package/src/lib/function/function.boolean.d.ts +4 -3
  96. package/src/lib/function/function.forward.d.ts +6 -4
  97. package/src/lib/getter/getter.d.ts +24 -19
  98. package/src/lib/getter/getter.map.d.ts +6 -5
  99. package/src/lib/getter/getter.util.d.ts +3 -2
  100. package/src/lib/grouping.d.ts +25 -24
  101. package/src/lib/hash.d.ts +11 -10
  102. package/src/lib/iterable/iterable.d.ts +39 -39
  103. package/src/lib/iterable/iterable.map.d.ts +3 -3
  104. package/src/lib/key.d.ts +16 -16
  105. package/src/lib/map/map.d.ts +12 -12
  106. package/src/lib/map/map.intersection.d.ts +3 -3
  107. package/src/lib/map/map.key.d.ts +16 -14
  108. package/src/lib/misc/host.d.ts +2 -2
  109. package/src/lib/model/id.batch.d.ts +4 -3
  110. package/src/lib/model/id.factory.d.ts +4 -3
  111. package/src/lib/model/model.conversion.d.ts +19 -14
  112. package/src/lib/model/model.conversion.field.d.ts +2 -2
  113. package/src/lib/model/model.copy.d.ts +5 -4
  114. package/src/lib/model/model.d.ts +48 -46
  115. package/src/lib/model/model.modify.d.ts +10 -8
  116. package/src/lib/nodejs/stream.d.ts +6 -5
  117. package/src/lib/number/bitwise.dencoder.d.ts +12 -12
  118. package/src/lib/number/bound.d.ts +16 -13
  119. package/src/lib/number/dollar.d.ts +6 -5
  120. package/src/lib/number/encoded.d.ts +7 -7
  121. package/src/lib/number/factory.d.ts +4 -3
  122. package/src/lib/number/number.d.ts +37 -37
  123. package/src/lib/number/random.d.ts +11 -10
  124. package/src/lib/number/round.d.ts +34 -30
  125. package/src/lib/number/sort.d.ts +3 -2
  126. package/src/lib/number/transform.d.ts +5 -4
  127. package/src/lib/object/object.array.d.ts +6 -6
  128. package/src/lib/object/object.array.delta.d.ts +3 -2
  129. package/src/lib/object/object.d.ts +12 -12
  130. package/src/lib/object/object.empty.d.ts +3 -3
  131. package/src/lib/object/object.equal.d.ts +11 -10
  132. package/src/lib/object/object.filter.pojo.d.ts +74 -74
  133. package/src/lib/object/object.filter.tuple.d.ts +26 -26
  134. package/src/lib/object/object.flatten.d.ts +4 -4
  135. package/src/lib/object/object.key.d.ts +6 -4
  136. package/src/lib/object/object.map.d.ts +15 -13
  137. package/src/lib/page/page.d.ts +5 -5
  138. package/src/lib/page/page.filter.d.ts +8 -8
  139. package/src/lib/path/path.d.ts +98 -88
  140. package/src/lib/promise/callback.d.ts +2 -2
  141. package/src/lib/promise/is.d.ts +6 -6
  142. package/src/lib/promise/poll.d.ts +9 -9
  143. package/src/lib/promise/promise.d.ts +33 -30
  144. package/src/lib/promise/promise.factory.d.ts +4 -3
  145. package/src/lib/promise/promise.loop.d.ts +11 -11
  146. package/src/lib/promise/promise.task.d.ts +6 -5
  147. package/src/lib/promise/promise.type.d.ts +3 -3
  148. package/src/lib/promise/use.d.ts +3 -3
  149. package/src/lib/relation/relation.d.ts +15 -15
  150. package/src/lib/service/handler.config.d.ts +20 -16
  151. package/src/lib/service/handler.d.ts +3 -2
  152. package/src/lib/service/typed.service.d.ts +2 -2
  153. package/src/lib/set/set.d.ts +62 -59
  154. package/src/lib/set/set.delta.d.ts +5 -4
  155. package/src/lib/set/set.hashset.d.ts +5 -5
  156. package/src/lib/set/set.selection.d.ts +5 -4
  157. package/src/lib/sort.d.ts +11 -11
  158. package/src/lib/storage/storage.d.ts +2 -1
  159. package/src/lib/storage/storage.error.d.ts +4 -4
  160. package/src/lib/storage/storage.memory.d.ts +7 -7
  161. package/src/lib/storage/storage.object.d.ts +5 -5
  162. package/src/lib/string/case.d.ts +6 -6
  163. package/src/lib/string/char.d.ts +30 -29
  164. package/src/lib/string/dencoder.d.ts +25 -20
  165. package/src/lib/string/factory.d.ts +11 -8
  166. package/src/lib/string/html.d.ts +19 -19
  167. package/src/lib/string/mimetype.d.ts +9 -8
  168. package/src/lib/string/prefix.d.ts +8 -8
  169. package/src/lib/string/replace.d.ts +45 -39
  170. package/src/lib/string/search.d.ts +5 -4
  171. package/src/lib/string/sort.d.ts +13 -4
  172. package/src/lib/string/string.d.ts +44 -43
  173. package/src/lib/string/transform.d.ts +32 -23
  174. package/src/lib/string/tree.d.ts +5 -4
  175. package/src/lib/string/url.d.ts +5 -4
  176. package/src/lib/tree/tree.array.d.ts +5 -4
  177. package/src/lib/tree/tree.expand.d.ts +6 -6
  178. package/src/lib/tree/tree.explore.d.ts +13 -10
  179. package/src/lib/tree/tree.flatten.d.ts +10 -10
  180. package/src/lib/type.d.ts +42 -12
  181. package/src/lib/value/address.d.ts +7 -7
  182. package/src/lib/value/bound.d.ts +70 -66
  183. package/src/lib/value/build.d.ts +6 -6
  184. package/src/lib/value/comparator.d.ts +19 -17
  185. package/src/lib/value/cron.d.ts +2 -2
  186. package/src/lib/value/decision.d.ts +6 -5
  187. package/src/lib/value/equal.d.ts +11 -9
  188. package/src/lib/value/indexed.d.ts +101 -85
  189. package/src/lib/value/label.d.ts +2 -2
  190. package/src/lib/value/map.d.ts +20 -16
  191. package/src/lib/value/maybe.d.ts +36 -36
  192. package/src/lib/value/modifier.d.ts +24 -23
  193. package/src/lib/value/point.d.ts +85 -77
  194. package/src/lib/value/url.d.ts +2 -2
  195. package/src/lib/value/use.d.ts +36 -33
  196. package/src/lib/value/vector.d.ts +15 -14
  197. package/test/index.cjs.js +41 -36
  198. package/test/index.esm.js +41 -36
  199. package/test/package.json +2 -2
  200. package/test/src/lib/jest/jest.fail.d.ts +2 -2
  201. package/test/src/lib/shared/shared.d.ts +20 -20
  202. package/test/src/lib/shared/shared.fail.d.ts +21 -16
  203. package/test/src/lib/shared/shared.function.d.ts +4 -4
  204. package/test/src/lib/shared/shared.wrap.d.ts +10 -10
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dereekb/util/eslint",
3
- "version": "13.11.14",
3
+ "version": "13.11.15",
4
4
  "peerDependencies": {
5
- "@typescript-eslint/utils": "8.59.0"
5
+ "@typescript-eslint/utils": "8.59.3"
6
6
  },
7
7
  "devDependencies": {
8
- "@typescript-eslint/parser": "8.59.0",
9
- "eslint": "9.39.4"
8
+ "@typescript-eslint/parser": "8.59.3",
9
+ "eslint": "10.4.0"
10
10
  },
11
11
  "exports": {
12
12
  "./package.json": "./package.json",
@@ -1,3 +1,4 @@
1
+ import type { Maybe } from '@dereekb/util';
1
2
  /**
2
3
  * The bundler hint string that marks a function call as side-effect-free.
3
4
  */
@@ -9,7 +10,7 @@ export interface JsdocCommentInfo {
9
10
  readonly hasNoSideEffects: boolean;
10
11
  }
11
12
  export interface FunctionLeadingContext {
12
- readonly jsdoc: JsdocCommentInfo | null;
13
+ readonly jsdoc: Maybe<JsdocCommentInfo>;
13
14
  /**
14
15
  * Adjacent `@__NO_SIDE_EFFECTS__` line/block comments that should be migrated into the JSDoc
15
16
  * and removed. Excludes the implementation-leading annotation on overloaded functions, which
@@ -30,7 +31,7 @@ export interface FunctionLeadingContext {
30
31
  * `null` when the function is single-signature (the line comment is then a removable orphan)
31
32
  * or when no such comment is present.
32
33
  */
33
- readonly implLineComment: AstNode | null;
34
+ readonly implLineComment: Maybe<AstNode>;
34
35
  /**
35
36
  * True when the implementation will carry the `@__NO_SIDE_EFFECTS__` annotation in the emitted
36
37
  * JavaScript:
@@ -74,9 +75,19 @@ export declare function getLineIndent(sourceText: string, offset: number): strin
74
75
  * @returns The statement node ESLint attaches leading comments to.
75
76
  */
76
77
  export declare function getStatementAnchor(node: AstNode): AstNode;
78
+ /**
79
+ * Returns the JSDoc Block comment immediately preceding `anchor`, or `null` when
80
+ * the anchor has no JSDoc leader. Used by the `@dbx<Family>` companion-tag rules
81
+ * to locate the tagged declaration's documentation.
82
+ *
83
+ * @param sourceCode - The ESLint `SourceCode` object.
84
+ * @param anchor - The statement-level node ESLint attaches leading comments to.
85
+ * @returns The JSDoc block comment, or null when none is present.
86
+ */
87
+ export declare function leadingJsdocFor(sourceCode: AstNode, anchor: AstNode): Maybe<AstNode>;
77
88
  /**
78
89
  * Walks backward from the implementation FunctionDeclaration through any overload signatures
79
- * with the same name, collecting:
90
+ * with the same name, collecting:.
80
91
  *
81
92
  * - The leading JSDoc block (preferring the one attached to the **first** overload, since that's
82
93
  * where the function's documentation conventionally lives).
@@ -0,0 +1,280 @@
1
+ /**
2
+ * Shared helpers for the `@dbx<Family>` companion-tag ESLint rules. Mirrors the
3
+ * scanner schemas in `packages/dbx-components-mcp/src/scan/*-extract.ts` so
4
+ * violations surface at lint time instead of at manifest-regeneration time.
5
+ *
6
+ * Each per-family rule supplies a {@link DbxTagFamilySpec} describing which
7
+ * companions are required/optional, what value format each accepts, and which
8
+ * messageId to emit when a check fails. The rule body itself only wires the
9
+ * visitors and message map; all value-format validation lives here.
10
+ */
11
+ import type { Maybe } from '@dereekb/util';
12
+ import { type ParsedJsdoc, type ParsedJsdocTag } from './jsdoc-parser';
13
+ interface AstNode {
14
+ readonly type: string;
15
+ [key: string]: any;
16
+ }
17
+ /**
18
+ * Kebab-case slug pattern: lowercase letters/digits, words separated by single hyphens,
19
+ * starts with a letter. Used to validate slug/related/skill-ref values.
20
+ */
21
+ export declare const KEBAB_SLUG_PATTERN: RegExp;
22
+ /**
23
+ * Pascal-case TypeScript identifier pattern (starts uppercase). Used for model
24
+ * identifiers and other `<ModelName>` style tag values.
25
+ */
26
+ export declare const PASCAL_IDENTIFIER_PATTERN: RegExp;
27
+ /**
28
+ * Discriminated description of how a companion tag's value should be parsed
29
+ * and validated. The shared checker dispatches on `kind`.
30
+ */
31
+ export type DbxTagFormat = {
32
+ readonly kind: 'marker';
33
+ } | {
34
+ readonly kind: 'kebab-slug';
35
+ } | {
36
+ readonly kind: 'enum';
37
+ readonly values: readonly string[];
38
+ } | {
39
+ readonly kind: 'pascal-identifier';
40
+ } | {
41
+ readonly kind: 'comma-list-kebab-slug';
42
+ } | {
43
+ readonly kind: 'comma-list-lowercase';
44
+ } | {
45
+ readonly kind: 'comma-list-free-text';
46
+ } | {
47
+ readonly kind: 'free-text';
48
+ } | {
49
+ readonly kind: 'boolean';
50
+ };
51
+ /**
52
+ * One companion-tag spec entry. `suffix` is appended to the family marker name
53
+ * to form the full tag (e.g. `dbxPipe` + `Slug` → `@dbxPipeSlug`).
54
+ */
55
+ export interface DbxCompanionTagSpec {
56
+ readonly suffix: string;
57
+ readonly required?: boolean;
58
+ readonly multiple?: boolean;
59
+ readonly format: DbxTagFormat;
60
+ }
61
+ /**
62
+ * The full set of companions plus the marker that triggers a family rule.
63
+ */
64
+ export interface DbxTagFamilySpec {
65
+ readonly marker: string;
66
+ readonly companions: readonly DbxCompanionTagSpec[];
67
+ }
68
+ /**
69
+ * One violation emitted by {@link checkDbxTagFamily}. Each rule's `meta.messages`
70
+ * map provides the message text for each `kind`.
71
+ */
72
+ export type DbxTagViolation = {
73
+ readonly kind: 'missing';
74
+ readonly suffix: string;
75
+ readonly lineIndex: number;
76
+ } | {
77
+ readonly kind: 'empty';
78
+ readonly suffix: string;
79
+ readonly lineIndex: number;
80
+ } | {
81
+ readonly kind: 'invalid-kebab';
82
+ readonly suffix: string;
83
+ readonly value: string;
84
+ readonly lineIndex: number;
85
+ } | {
86
+ readonly kind: 'invalid-enum';
87
+ readonly suffix: string;
88
+ readonly value: string;
89
+ readonly allowed: readonly string[];
90
+ readonly lineIndex: number;
91
+ } | {
92
+ readonly kind: 'invalid-pascal';
93
+ readonly suffix: string;
94
+ readonly value: string;
95
+ readonly lineIndex: number;
96
+ } | {
97
+ readonly kind: 'invalid-boolean';
98
+ readonly suffix: string;
99
+ readonly value: string;
100
+ readonly lineIndex: number;
101
+ } | {
102
+ readonly kind: 'comma-item-not-kebab';
103
+ readonly suffix: string;
104
+ readonly value: string;
105
+ readonly lineIndex: number;
106
+ } | {
107
+ readonly kind: 'tags-not-lowercase';
108
+ readonly suffix: string;
109
+ readonly value: string;
110
+ readonly lineIndex: number;
111
+ readonly raw: ParsedJsdocTag;
112
+ } | {
113
+ readonly kind: 'unknown';
114
+ readonly suffix: string;
115
+ readonly lineIndex: number;
116
+ } | {
117
+ readonly kind: 'duplicate';
118
+ readonly suffix: string;
119
+ readonly lineIndex: number;
120
+ };
121
+ /**
122
+ * Splits a comma-separated tag-value string into trimmed items, preserving order.
123
+ *
124
+ * @param value - Raw text following the tag name on a single line.
125
+ * @returns Non-empty trimmed segments in declaration order.
126
+ */
127
+ export declare function splitCommaSeparated(value: string): string[];
128
+ /**
129
+ * Parses a boolean tag value using the workspace vocabulary
130
+ * (`''`/`true`/`yes` → true; `false`/`no` → false). Other inputs return `undefined`.
131
+ *
132
+ * @param text - The trimmed tag value text.
133
+ * @returns The parsed boolean, or `undefined` when the text is not in the vocabulary.
134
+ */
135
+ export declare function parseBooleanTagValue(text: string): Maybe<boolean>;
136
+ /**
137
+ * Returns the source-text offset of an offset-within-comment-value, given a Block comment node.
138
+ *
139
+ * @param commentNode - The ESLint Block comment AST node.
140
+ * @param valueOffset - The character offset within `comment.value`.
141
+ * @returns The character offset in the source file.
142
+ */
143
+ export declare function commentValueToSourceOffset(commentNode: AstNode, valueOffset: number): number;
144
+ /**
145
+ * Returns the family marker + companion tag list for the given parsed JSDoc.
146
+ * Family membership is determined by tag-name prefix.
147
+ *
148
+ * @param parsed - The parsed JSDoc.
149
+ * @param marker - The bare family marker (e.g. `'dbxPipe'`).
150
+ * @returns The marker tag (if present), and all companion tags in source order.
151
+ */
152
+ export declare function findFamilyTags(parsed: ParsedJsdoc, marker: string): {
153
+ readonly markerTag: Maybe<ParsedJsdocTag>;
154
+ readonly familyTags: readonly ParsedJsdocTag[];
155
+ };
156
+ /**
157
+ * Groups companion tags (those after the marker) by suffix. Marker entries are excluded.
158
+ *
159
+ * @param familyTags - The family tag list from {@link findFamilyTags}.
160
+ * @param marker - The bare family marker.
161
+ * @returns Lookup keyed by companion-suffix listing matching tags in declaration order.
162
+ */
163
+ export declare function groupCompanionsBySuffix(familyTags: readonly ParsedJsdocTag[], marker: string): Map<string, ParsedJsdocTag[]>;
164
+ /**
165
+ * Runs the canonical companion-tag validation pass for a `@dbx<Family>`-tagged
166
+ * JSDoc against the supplied {@link DbxTagFamilySpec}. Emits one
167
+ * {@link DbxTagViolation} per finding via `emit`; the calling rule maps each
168
+ * violation to its own messageId.
169
+ *
170
+ * Validation pass order:
171
+ *
172
+ * 1. Unknown companions (typo detection — companions not in the spec).
173
+ * 2. Required companions present (one violation per missing required tag).
174
+ * 3. Duplicates (companion appears more than once, when `multiple` is not set).
175
+ * 4. Per-companion value-format validation.
176
+ *
177
+ * Marker presence is the caller's responsibility — pass `markerPresent=true`
178
+ * (i.e. `requireBareMarker` already satisfied) before invoking this.
179
+ */
180
+ export interface CheckDbxTagFamilyInput {
181
+ readonly parsed: ParsedJsdoc;
182
+ readonly spec: DbxTagFamilySpec;
183
+ readonly markerTag: ParsedJsdocTag;
184
+ readonly familyTags: readonly ParsedJsdocTag[];
185
+ readonly emit: (violation: DbxTagViolation) => void;
186
+ }
187
+ /**
188
+ * Validates a `@dbx<Family>` marker plus its companion tags against the supplied spec.
189
+ * Reports unknown companions, missing required companions, duplicates, and per-companion
190
+ * value violations through `input.emit`.
191
+ *
192
+ * @param input - Parsed JSDoc, family spec, resolved marker/companion tags, and emit sink.
193
+ *
194
+ * @example
195
+ * ```ts
196
+ * checkDbxTagFamily({ parsed, spec, markerTag, familyTags, emit });
197
+ * ```
198
+ */
199
+ export declare function checkDbxTagFamily(input: CheckDbxTagFamilyInput): void;
200
+ /**
201
+ * Wraps `context.report` with the family rule's common "report on a tag line"
202
+ * helper. The shared rule body uses this to translate {@link DbxTagViolation}
203
+ * locations into ESLint source ranges.
204
+ */
205
+ export interface ReportOnLineInput {
206
+ readonly commentNode: AstNode;
207
+ readonly parsed: ParsedJsdoc;
208
+ readonly sourceCode: AstNode;
209
+ readonly lineIndex: number;
210
+ readonly messageId: string;
211
+ readonly data?: Record<string, string>;
212
+ readonly report: (descriptor: {
213
+ loc: AstNode;
214
+ messageId: string;
215
+ data?: Record<string, string>;
216
+ fix?: (fixer: AstNode) => Maybe<AstNode | AstNode[]>;
217
+ }) => void;
218
+ readonly fix?: (fixer: AstNode) => Maybe<AstNode | AstNode[]>;
219
+ }
220
+ /**
221
+ * Translates a JSDoc-line violation into an ESLint `context.report()` call by computing the
222
+ * source range of the offending line and attaching the supplied message + optional fixer.
223
+ *
224
+ * @param input - Reporting context (comment node, parsed JSDoc, source code, line index, message id, optional data + fixer, report sink).
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * reportOnJsdocLine({ commentNode, parsed, sourceCode, lineIndex: tag.startLineIndex, messageId: 'unknown', report: context.report });
229
+ * ```
230
+ */
231
+ export declare function reportOnJsdocLine(input: ReportOnLineInput): void;
232
+ /**
233
+ * The visitor scopes used by `@dbx<Family>` companion-tag rules. Each rule
234
+ * supplies a subset and the shared visitor wires them with the canonical
235
+ * `getStatementAnchor` / `leadingJsdocFor` logic.
236
+ */
237
+ export type DbxFamilyVisitorKind = 'FunctionDeclaration' | 'VariableDeclaration' | 'ClassDeclaration' | 'TSInterfaceDeclaration' | 'TSTypeAliasDeclaration' | 'TSEnumDeclaration' | 'TSPropertySignature' | 'PropertyDefinition' | 'TSEnumMember';
238
+ /**
239
+ * Callback that maps a {@link DbxTagViolation} to its rule-specific
240
+ * messageId + data, or `null` when the violation should be silently dropped
241
+ * (e.g. when the rule does not require the missing companion).
242
+ */
243
+ export type DbxFamilyViolationMapper = (violation: DbxTagViolation) => Maybe<{
244
+ readonly messageId: string;
245
+ readonly data?: Record<string, string>;
246
+ readonly fixable?: boolean;
247
+ }>;
248
+ /**
249
+ * Produces an auto-fix for a `@dbx<Family>Tags ...` line that lowercases every
250
+ * token after the tag name. Returns the replacement source range + text, or
251
+ * `undefined` when the line is already canonical.
252
+ *
253
+ * @param input - The fix context (comment node, parsed JSDoc, source code, tag).
254
+ * @returns The replacement range/text, or `undefined` when no fix is needed.
255
+ */
256
+ export interface BuildLowercaseTagsFixInput {
257
+ readonly commentNode: AstNode;
258
+ readonly parsed: ParsedJsdoc;
259
+ readonly sourceCode: AstNode;
260
+ readonly tag: ParsedJsdocTag;
261
+ }
262
+ export interface LowercaseTagsFixResult {
263
+ readonly startOffset: number;
264
+ readonly endOffset: number;
265
+ readonly replacement: string;
266
+ }
267
+ /**
268
+ * Computes an auto-fix descriptor that lowercases every token after a `@dbx<Family>Tags` tag
269
+ * name. Returns `undefined` when the line is already canonical so the caller can short-circuit.
270
+ *
271
+ * @param input - Fix context (comment node, parsed JSDoc, source code, target tag).
272
+ * @returns Replacement range + text when a rewrite is needed; otherwise `undefined`.
273
+ *
274
+ * @example
275
+ * ```ts
276
+ * const fix = buildLowercaseTagsFix({ commentNode, parsed, sourceCode, tag });
277
+ * ```
278
+ */
279
+ export declare function buildLowercaseTagsFix(input: BuildLowercaseTagsFixInput): Maybe<LowercaseTagsFixResult>;
280
+ export {};
@@ -1,3 +1,26 @@
1
- export { utilRequireNoSideEffectsRule, type UtilRequireNoSideEffectsRuleOptions, type UtilRequireNoSideEffectsRuleDefinition } from './require-no-side-effects.rule';
2
- export { utilPreferNoSideEffectsInJsdocRule, type UtilPreferNoSideEffectsInJsdocRuleDefinition } from './prefer-no-side-effects-in-jsdoc.rule';
3
- export { utilEslintPlugin, type UtilEslintPlugin } from './plugin';
1
+ export { UTIL_REQUIRE_NO_SIDE_EFFECTS_RULE, type UtilRequireNoSideEffectsRuleOptions, type UtilRequireNoSideEffectsRuleDefinition } from './require-no-side-effects.rule';
2
+ export { UTIL_PREFER_NO_SIDE_EFFECTS_IN_JSDOC_RULE, type UtilPreferNoSideEffectsInJsdocRuleDefinition } from './prefer-no-side-effects-in-jsdoc.rule';
3
+ export { UTIL_NO_SISTER_RE_EXPORT_RULE, type UtilNoSisterReExportRuleOptions, type UtilNoSisterReExportRuleDefinition } from './no-sister-re-export.rule';
4
+ export { UTIL_REQUIRE_SINGLE_RETURN_RULE, type UtilRequireSingleReturnRuleDefinition } from './require-single-return.rule';
5
+ export { UTIL_REQUIRE_READONLY_CONFIG_PARAMS_RULE, type UtilRequireReadonlyConfigParamsRuleOptions, type UtilRequireReadonlyConfigParamsRuleDefinition } from './require-readonly-config-params.rule';
6
+ export { UTIL_PREFER_CONFIG_OBJECT_RULE, UTIL_PREFER_CONFIG_OBJECT_HARD_RULE, type UtilPreferConfigObjectRuleOptions, type UtilPreferConfigObjectRuleDefinition } from './prefer-config-object.rule';
7
+ export { UTIL_PREFER_MAYBE_TYPE_RULE, type UtilPreferMaybeTypeRuleOptions, type UtilPreferMaybeTypeRuleDefinition } from './prefer-maybe-type.rule';
8
+ export { UTIL_NO_INLINE_TYPE_IMPORT_RULE, type UtilNoInlineTypeImportRuleDefinition } from './no-inline-type-import.rule';
9
+ export { UTIL_REQUIRE_DEPRECATED_ALIAS_PLACEMENT_RULE, type UtilRequireDeprecatedAliasPlacementRuleDefinition } from './require-deprecated-alias-placement.rule';
10
+ export { UTIL_PREFER_CANONICAL_JSDOC_RULE, type UtilPreferCanonicalJsdocRuleOptions, type UtilPreferCanonicalJsdocRuleDefinition } from './prefer-canonical-jsdoc.rule';
11
+ export { UTIL_REQUIRE_DBX_UTIL_COMPANION_TAGS_RULE, type UtilRequireDbxUtilCompanionTagsRuleOptions, type UtilRequireDbxUtilCompanionTagsRuleDefinition } from './require-dbx-util-companion-tags.rule';
12
+ export { UTIL_REQUIRE_DBX_PIPE_COMPANION_TAGS_RULE, type UtilRequireDbxPipeCompanionTagsRuleOptions, type UtilRequireDbxPipeCompanionTagsRuleDefinition } from './require-dbx-pipe-companion-tags.rule';
13
+ export { UTIL_REQUIRE_DBX_FILTER_COMPANION_TAGS_RULE, type UtilRequireDbxFilterCompanionTagsRuleOptions, type UtilRequireDbxFilterCompanionTagsRuleDefinition } from './require-dbx-filter-companion-tags.rule';
14
+ export { UTIL_REQUIRE_DBX_WEB_COMPANION_TAGS_RULE, type UtilRequireDbxWebCompanionTagsRuleOptions, type UtilRequireDbxWebCompanionTagsRuleDefinition } from './require-dbx-web-companion-tags.rule';
15
+ export { UTIL_REQUIRE_DBX_DOCS_UI_EXAMPLE_COMPANION_TAGS_RULE, type UtilRequireDbxDocsUiExampleCompanionTagsRuleOptions, type UtilRequireDbxDocsUiExampleCompanionTagsRuleDefinition } from './require-dbx-docs-ui-example-companion-tags.rule';
16
+ export { UTIL_REQUIRE_DBX_MODEL_SNAPSHOT_FIELD_COMPANION_TAGS_RULE, type UtilRequireDbxModelSnapshotFieldCompanionTagsRuleOptions, type UtilRequireDbxModelSnapshotFieldCompanionTagsRuleDefinition } from './require-dbx-model-snapshot-field-companion-tags.rule';
17
+ export { UTIL_REQUIRE_DBX_MODEL_FIREBASE_INDEX_COMPANION_TAGS_RULE, type UtilRequireDbxModelFirebaseIndexCompanionTagsRuleOptions, type UtilRequireDbxModelFirebaseIndexCompanionTagsRuleDefinition } from './require-dbx-model-firebase-index-companion-tags.rule';
18
+ export { UTIL_REQUIRE_DBX_ACTION_COMPANION_TAGS_RULE, type UtilRequireDbxActionCompanionTagsRuleOptions, type UtilRequireDbxActionCompanionTagsRuleDefinition } from './require-dbx-action-companion-tags.rule';
19
+ export { UTIL_REQUIRE_DBX_FORM_FIELD_COMPANION_TAGS_RULE, type UtilRequireDbxFormFieldCompanionTagsRuleOptions, type UtilRequireDbxFormFieldCompanionTagsRuleDefinition } from './require-dbx-form-field-companion-tags.rule';
20
+ export { UTIL_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE, type UtilRequireDbxModelCompanionTagsRuleOptions, type UtilRequireDbxModelCompanionTagsRuleDefinition } from './require-dbx-model-companion-tags.rule';
21
+ export { UTIL_REQUIRE_DBX_AUTH_COMPANION_TAGS_RULE, type UtilRequireDbxAuthCompanionTagsRuleOptions, type UtilRequireDbxAuthCompanionTagsRuleDefinition } from './require-dbx-auth-companion-tags.rule';
22
+ export { UTIL_REQUIRE_DBX_RULE_COMPANION_TAGS_RULE, type UtilRequireDbxRuleCompanionTagsRuleOptions, type UtilRequireDbxRuleCompanionTagsRuleDefinition } from './require-dbx-rule-companion-tags.rule';
23
+ export { UTIL_REQUIRE_CONSTANT_NAMING_RULE, type UtilRequireConstantNamingRuleOptions, type UtilRequireConstantNamingRuleDefinition } from './require-constant-naming.rule';
24
+ export { UTIL_REQUIRE_DEFAULT_PREFIX_NAMING_RULE, type UtilRequireDefaultPrefixNamingRuleOptions, type UtilRequireDefaultPrefixNamingRuleDefinition } from './require-default-prefix-naming.rule';
25
+ export { UTIL_REQUIRE_EXPORTED_JSDOC_EXAMPLE_RULE, type UtilRequireExportedJsdocExampleRuleOptions, type UtilRequireExportedJsdocExampleRuleDefinition } from './require-exported-jsdoc-example.rule';
26
+ export { UTIL_ESLINT_PLUGIN, type UtilEslintPlugin } from './plugin';
@@ -0,0 +1,116 @@
1
+ import type { Maybe } from '@dereekb/util';
2
+ /**
3
+ * Minimal JSDoc parser used by the workspace's custom ESLint rules.
4
+ *
5
+ * Operates on the raw `value` of an ESLint Block comment (the text between `/*` and `*\/`,
6
+ * which includes the leading `*` of a JSDoc opener). Returns a structured view of the comment:
7
+ * description, paragraphs, tags (with their continuation lines), and per-line metadata.
8
+ */
9
+ /**
10
+ * Per-line view of a comment body.
11
+ */
12
+ export interface ParsedJsdocLine {
13
+ /**
14
+ * Raw line content with leading whitespace + `*` prefix preserved.
15
+ */
16
+ readonly raw: string;
17
+ /**
18
+ * Text content after the leading whitespace + `*` + optional space prefix has been stripped.
19
+ */
20
+ readonly text: string;
21
+ /**
22
+ * True when the line is blank after stripping (only `* ` with nothing else).
23
+ */
24
+ readonly blank: boolean;
25
+ /**
26
+ * Index in the original `splitLines` array.
27
+ */
28
+ readonly index: number;
29
+ /**
30
+ * Character offset of `raw[0]` relative to the start of `commentValue` (not the source file).
31
+ */
32
+ readonly valueOffsetStart: number;
33
+ /**
34
+ * Character offset of `text[0]` relative to the start of `commentValue`. Equals `valueOffsetStart` plus the length of the stripped prefix.
35
+ */
36
+ readonly textOffsetStart: number;
37
+ }
38
+ /**
39
+ * Parsed view of a single `@tag` block, including any continuation lines that follow it
40
+ * up to the next tag (or end of comment).
41
+ */
42
+ export interface ParsedJsdocTag {
43
+ /**
44
+ * Tag name without the leading `@`, e.g. `param`, `returns`, `throws`, `dbxUtil`, `__NO_SIDE_EFFECTS__`.
45
+ */
46
+ readonly tag: string;
47
+ /**
48
+ * For `@param`: the parameter name. For other tags: `undefined`.
49
+ */
50
+ readonly name: Maybe<string>;
51
+ /**
52
+ * For `@throws` / `@param` style: the `{Type}` annotation if present.
53
+ */
54
+ readonly type: Maybe<string>;
55
+ /**
56
+ * Remaining text on the tag line + continuation lines, joined with `\n`. Trimmed of trailing whitespace.
57
+ */
58
+ readonly description: string;
59
+ /**
60
+ * All lines belonging to this tag (the tag line itself and any continuation lines).
61
+ */
62
+ readonly lines: readonly ParsedJsdocLine[];
63
+ /**
64
+ * Index in the comment-lines array where the tag starts.
65
+ */
66
+ readonly startLineIndex: number;
67
+ /**
68
+ * Index (inclusive) where the tag ends.
69
+ */
70
+ readonly endLineIndex: number;
71
+ }
72
+ /**
73
+ * Parsed view of a whole JSDoc comment.
74
+ */
75
+ export interface ParsedJsdoc {
76
+ /**
77
+ * All lines in the comment body.
78
+ */
79
+ readonly lines: readonly ParsedJsdocLine[];
80
+ /**
81
+ * Lines belonging to the description (before any tag).
82
+ */
83
+ readonly descriptionLines: readonly ParsedJsdocLine[];
84
+ /**
85
+ * Description text joined with `\n`, with leading and trailing blank lines stripped.
86
+ */
87
+ readonly description: string;
88
+ /**
89
+ * Description split into paragraphs by blank lines, with each paragraph joined by `\n`.
90
+ */
91
+ readonly descriptionParagraphs: readonly string[];
92
+ /**
93
+ * All tags in source order.
94
+ */
95
+ readonly tags: readonly ParsedJsdocTag[];
96
+ /**
97
+ * True when the original comment is a single-line `/** ... *\/` block (no newlines).
98
+ */
99
+ readonly singleLine: boolean;
100
+ }
101
+ /**
102
+ * Parses the value of an ESLint Block comment that represents a JSDoc into a structured form.
103
+ *
104
+ * @param commentValue - The `value` of an ESLint Block comment (text between `/*` and `*\/`, including the leading `*`).
105
+ * @returns A structured view of the JSDoc with description, paragraphs, and tags.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * const parsed = parseJsdocComment('*\n * Hello.\n *\n * @param x - The value.\n ');
110
+ * // parsed.description === 'Hello.'
111
+ * // parsed.tags[0].tag === 'param'
112
+ * // parsed.tags[0].name === 'x'
113
+ * // parsed.tags[0].description === 'The value.'
114
+ * ```
115
+ */
116
+ export declare function parseJsdocComment(commentValue: string): ParsedJsdoc;
@@ -0,0 +1,44 @@
1
+ interface AstNode {
2
+ readonly type: string;
3
+ [key: string]: any;
4
+ }
5
+ /**
6
+ * ESLint rule definition for no-inline-string-empty-object-intersection.
7
+ */
8
+ export interface UtilNoInlineStringEmptyObjectIntersectionRuleDefinition {
9
+ readonly meta: {
10
+ readonly type: 'problem';
11
+ readonly docs: {
12
+ readonly description: string;
13
+ readonly recommended: boolean;
14
+ };
15
+ readonly messages: {
16
+ readonly inlineIntersectionForbidden: string;
17
+ };
18
+ readonly schema: readonly object[];
19
+ };
20
+ create(context: {
21
+ report: (descriptor: {
22
+ node: AstNode;
23
+ messageId: string;
24
+ data?: Record<string, string>;
25
+ }) => void;
26
+ }): Record<string, (node: AstNode) => void>;
27
+ }
28
+ /**
29
+ * ESLint rule that errors on any inline `string & {}` intersection — either standalone or as a
30
+ * member of a union (the `T | (string & {})` autocomplete-preserving idiom). The intersection is
31
+ * opaque at the call site and reads like a typo; the workspace's `SuggestedString<T>` alias from
32
+ * `@dereekb/util` is the only sanctioned way to express the same shape.
33
+ *
34
+ * The rule is intentionally non-fixable: switching to `SuggestedString<T>` also requires adding
35
+ * an `import { type SuggestedString } from '@dereekb/util'` (or a relative path inside
36
+ * `@dereekb/util` itself), and the right insertion point depends on existing import structure.
37
+ * The error message names the type so the developer can make the change deliberately.
38
+ *
39
+ * The rule visits `TSIntersectionType` directly, so it fires regardless of whether the
40
+ * intersection appears inside a union, a parenthesized type, a type alias body, a function
41
+ * signature, or anywhere else.
42
+ */
43
+ export declare const UTIL_NO_INLINE_STRING_EMPTY_OBJECT_INTERSECTION_RULE: UtilNoInlineStringEmptyObjectIntersectionRuleDefinition;
44
+ export {};
@@ -0,0 +1,38 @@
1
+ interface AstNode {
2
+ readonly type: string;
3
+ [key: string]: any;
4
+ }
5
+ /**
6
+ * ESLint rule definition for no-inline-type-import.
7
+ */
8
+ export interface UtilNoInlineTypeImportRuleDefinition {
9
+ readonly meta: {
10
+ readonly type: 'suggestion';
11
+ readonly docs: {
12
+ readonly description: string;
13
+ readonly recommended: boolean;
14
+ };
15
+ readonly messages: {
16
+ readonly inlineImportTypeForbidden: string;
17
+ };
18
+ readonly schema: readonly object[];
19
+ };
20
+ create(context: {
21
+ report: (descriptor: {
22
+ node: AstNode;
23
+ messageId: string;
24
+ data?: Record<string, string>;
25
+ }) => void;
26
+ }): Record<string, (node: AstNode) => void>;
27
+ }
28
+ /**
29
+ * ESLint rule prohibiting inline `import('path').Type` usage in type positions. Inline imports are
30
+ * a TypeScript shortcut that bypasses the workspace convention of declaring all imports at the top
31
+ * of the file via `import type`. The rule reports each occurrence; rewriting the source is left to
32
+ * the developer because resolving the right top-of-file import (or merging with an existing one)
33
+ * is too source-shape-dependent to mechanize safely.
34
+ *
35
+ * @see `dbx__note__typescript-programming` → No Inline Type Imports
36
+ */
37
+ export declare const UTIL_NO_INLINE_TYPE_IMPORT_RULE: UtilNoInlineTypeImportRuleDefinition;
38
+ export {};
@@ -0,0 +1,69 @@
1
+ interface AstNode {
2
+ readonly type: string;
3
+ [key: string]: any;
4
+ }
5
+ /**
6
+ * Options for the no-sister-re-export rule.
7
+ */
8
+ export interface UtilNoSisterReExportRuleOptions {
9
+ /**
10
+ * Glob-style specifier patterns that identify "sister" packages. A specifier matching
11
+ * any pattern is reported. `*` matches any run of characters; other regex metacharacters
12
+ * are escaped. Anchored start-to-end.
13
+ *
14
+ * @example ['@dereekb/*', 'joinfoodflip-*']
15
+ */
16
+ readonly patterns?: readonly string[];
17
+ /**
18
+ * Exact specifier exemptions. A re-export whose source string exactly matches an entry
19
+ * is always allowed, even if it matches one of `patterns`.
20
+ */
21
+ readonly allow?: readonly string[];
22
+ /**
23
+ * When true, type-only re-exports (`export type { ... } from 'pkg'` and `export type * from 'pkg'`)
24
+ * are allowed regardless of `patterns`. Defaults to false.
25
+ */
26
+ readonly allowTypeOnly?: boolean;
27
+ }
28
+ /**
29
+ * ESLint rule definition for no-sister-re-export.
30
+ */
31
+ export interface UtilNoSisterReExportRuleDefinition {
32
+ readonly meta: {
33
+ readonly type: 'problem';
34
+ readonly docs: {
35
+ readonly description: string;
36
+ readonly recommended: boolean;
37
+ };
38
+ readonly messages: {
39
+ readonly noSisterReExport: string;
40
+ readonly noSisterReExportAll: string;
41
+ };
42
+ readonly schema: readonly object[];
43
+ };
44
+ create(context: {
45
+ options: UtilNoSisterReExportRuleOptions[];
46
+ report: (descriptor: {
47
+ node: AstNode;
48
+ messageId: string;
49
+ data?: Record<string, string>;
50
+ }) => void;
51
+ }): Record<string, (node: AstNode) => void>;
52
+ }
53
+ /**
54
+ * ESLint rule that disallows re-exporting from "sister" packages — workspace packages other than
55
+ * the one the file lives in. Catches the common shortcut of
56
+ *
57
+ * ```ts
58
+ * export { somethingFromOtherPackage } from 'some-other-package';
59
+ * ```
60
+ *
61
+ * inside package A when `some-other-package` is package B in the same workspace. The fix is to
62
+ * either import directly from the source package at the call site, or to expose the symbol from
63
+ * that package's own public surface so callers don't traverse an unrelated package's barrel.
64
+ *
65
+ * Sister packages are identified by `options.patterns` (glob-style; `*` matches any run of characters).
66
+ * Relative re-exports (`./local`, `../sibling`) are always allowed.
67
+ */
68
+ export declare const UTIL_NO_SISTER_RE_EXPORT_RULE: UtilNoSisterReExportRuleDefinition;
69
+ export {};