@dereekb/firebase 13.12.2 → 13.12.3

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.
@@ -1,1135 +1,12 @@
1
1
  'use strict';
2
2
 
3
+ var eslint = require('@dereekb/util/eslint');
3
4
  var node_module = require('node:module');
4
5
  var node_fs = require('node:fs');
5
6
  var node_path = require('node:path');
6
7
  var typescriptEstree = require('@typescript-eslint/typescript-estree');
7
8
  var parser = require('@typescript-eslint/parser');
8
9
 
9
- /**
10
- * Returns the outermost statement node for a FunctionDeclaration — its `ExportNamedDeclaration`
11
- * or `ExportDefaultDeclaration` parent if exported, otherwise the declaration itself. This is the
12
- * node ESLint attaches leading comments to.
13
- *
14
- * @param node - The FunctionDeclaration AST node.
15
- * @returns The statement node ESLint attaches leading comments to.
16
- */ function getStatementAnchor(node) {
17
- return node.parent && (node.parent.type === 'ExportNamedDeclaration' || node.parent.type === 'ExportDefaultDeclaration') ? node.parent : node;
18
- }
19
- /**
20
- * Returns the JSDoc Block comment immediately preceding `anchor`, or `null` when
21
- * the anchor has no JSDoc leader. Used by the `@dbx<Family>` companion-tag rules
22
- * to locate the tagged declaration's documentation.
23
- *
24
- * @param sourceCode - The ESLint `SourceCode` object.
25
- * @param anchor - The statement-level node ESLint attaches leading comments to.
26
- * @returns The JSDoc block comment, or null when none is present.
27
- */ function leadingJsdocFor(sourceCode, anchor) {
28
- var comments = sourceCode.getCommentsBefore(anchor) || [];
29
- var result = null;
30
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
31
- try {
32
- for(var _iterator = comments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
33
- var comment = _step.value;
34
- if (comment.type === 'Block' && typeof comment.value === 'string' && comment.value.startsWith('*')) {
35
- result = comment;
36
- }
37
- }
38
- } catch (err) {
39
- _didIteratorError = true;
40
- _iteratorError = err;
41
- } finally{
42
- try {
43
- if (!_iteratorNormalCompletion && _iterator.return != null) {
44
- _iterator.return();
45
- }
46
- } finally{
47
- if (_didIteratorError) {
48
- throw _iteratorError;
49
- }
50
- }
51
- }
52
- return result;
53
- }
54
-
55
- /**
56
- * Default maximum positional parameters before the warn-level rule suggests a config object.
57
- * Triggers a warning when a function has more than 2 positional parameters (i.e. 3+ args).
58
- */ var DEFAULT_MAX_PARAMS_WARN = 2;
59
- /**
60
- * Default maximum positional parameters before the hard-error rule rejects the signature.
61
- * Triggers an error when a function has more than 4 positional parameters (i.e. 5+ args).
62
- */ var DEFAULT_MAX_PARAMS_HARD = 4;
63
- /**
64
- * Default JSDoc tag that opts a function out of this rule.
65
- */ var DEFAULT_ALLOW_JSDOC_TAG = '@dbxAllowMultiParams';
66
- /**
67
- * Returns a human-readable display name for the function-like node, or `<anonymous>`.
68
- *
69
- * @param node - The function-like AST node.
70
- * @returns The identifier string used in diagnostic messages.
71
- */ function getFunctionDisplayName(node) {
72
- var _node_id;
73
- var name = '<anonymous>';
74
- if (((_node_id = node.id) === null || _node_id === void 0 ? void 0 : _node_id.type) === 'Identifier') {
75
- name = node.id.name;
76
- } else if (node.parent) {
77
- var _parent_id, _parent_key, _parent_key1, _parent_left;
78
- var parent = node.parent;
79
- if (parent.type === 'VariableDeclarator' && ((_parent_id = parent.id) === null || _parent_id === void 0 ? void 0 : _parent_id.type) === 'Identifier') {
80
- name = parent.id.name;
81
- } else if (parent.type === 'Property' && ((_parent_key = parent.key) === null || _parent_key === void 0 ? void 0 : _parent_key.type) === 'Identifier') {
82
- name = parent.key.name;
83
- } else if (parent.type === 'MethodDefinition' && ((_parent_key1 = parent.key) === null || _parent_key1 === void 0 ? void 0 : _parent_key1.type) === 'Identifier') {
84
- name = parent.key.name;
85
- } else if (parent.type === 'AssignmentExpression' && ((_parent_left = parent.left) === null || _parent_left === void 0 ? void 0 : _parent_left.type) === 'Identifier') {
86
- name = parent.left.name;
87
- }
88
- }
89
- return name;
90
- }
91
- /**
92
- * Returns true if a parameter has any decorators (NestJS handler/Inject pattern).
93
- *
94
- * @param param - The parameter AST node.
95
- * @returns True when the parameter carries at least one decorator.
96
- */ function paramHasDecorator(param) {
97
- var _param_decorators;
98
- var decorators = (_param_decorators = param.decorators) !== null && _param_decorators !== void 0 ? _param_decorators : [];
99
- return Array.isArray(decorators) && decorators.length > 0;
100
- }
101
- /**
102
- * Returns true when the function is the constructor of a class.
103
- *
104
- * @param node - The function-like AST node.
105
- * @returns True if `node` is the `constructor` body of a class.
106
- */ function isConstructor(node) {
107
- var _node_parent;
108
- return ((_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.type) === 'MethodDefinition' && node.parent.kind === 'constructor';
109
- }
110
- /**
111
- * Returns true if any leading JSDoc block above `anchor` contains the allow tag.
112
- *
113
- * @param sourceCode - The ESLint `SourceCode` instance.
114
- * @param anchor - The AST node whose leading comments are scanned.
115
- * @param allowTag - The JSDoc tag string that opts the function out.
116
- * @returns True when a JSDoc with the allow tag is present.
117
- */ function hasAllowJsdoc(sourceCode, anchor, allowTag) {
118
- var comments = sourceCode.getCommentsBefore(anchor) || [];
119
- var allow = false;
120
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
121
- try {
122
- for(var _iterator = comments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
123
- var comment = _step.value;
124
- if (comment.type === 'Block' && comment.value.startsWith('*') && comment.value.includes(allowTag)) {
125
- allow = true;
126
- }
127
- }
128
- } catch (err) {
129
- _didIteratorError = true;
130
- _iteratorError = err;
131
- } finally{
132
- try {
133
- if (!_iteratorNormalCompletion && _iterator.return != null) {
134
- _iterator.return();
135
- }
136
- } finally{
137
- if (_didIteratorError) {
138
- throw _iteratorError;
139
- }
140
- }
141
- }
142
- return allow;
143
- }
144
- /**
145
- * Builds a prefer-config-object-style rule with a configurable default `maxParams` threshold.
146
- * Class constructors and decorated parameters (e.g. NestJS `@Inject`) are exempted. Functions can
147
- * opt out via a leading JSDoc block carrying the configured allow tag (default `@dbxAllowMultiParams`).
148
- *
149
- * @param config - Default threshold and rule description.
150
- * @returns A complete ESLint rule definition that emits `tooManyParams` reports.
151
- */ function createPreferConfigObjectRule(config) {
152
- return {
153
- meta: {
154
- type: 'suggestion',
155
- docs: {
156
- description: config.description,
157
- recommended: true
158
- },
159
- messages: {
160
- tooManyParams: "Function '{{name}}' takes {{count}} positional parameters; use a single config object instead (see dbx__note__typescript-programming → Prefer Single Config Object)."
161
- },
162
- schema: [
163
- {
164
- type: 'object',
165
- properties: {
166
- maxParams: {
167
- type: 'number',
168
- minimum: 0,
169
- description: 'Maximum number of positional parameters before the rule fires.'
170
- },
171
- allowJsdocTag: {
172
- type: 'string',
173
- description: 'JSDoc tag that opts a function out of this rule.'
174
- }
175
- },
176
- additionalProperties: false
177
- }
178
- ]
179
- },
180
- create: function create(context) {
181
- var _context_options_, _options_maxParams, _options_allowJsdocTag;
182
- var options = (_context_options_ = context.options[0]) !== null && _context_options_ !== void 0 ? _context_options_ : {};
183
- var maxParams = (_options_maxParams = options.maxParams) !== null && _options_maxParams !== void 0 ? _options_maxParams : config.defaultMaxParams;
184
- var allowTag = (_options_allowJsdocTag = options.allowJsdocTag) !== null && _options_allowJsdocTag !== void 0 ? _options_allowJsdocTag : DEFAULT_ALLOW_JSDOC_TAG;
185
- var sourceCode = context.sourceCode;
186
- function checkFunction(node) {
187
- if (!isConstructor(node)) {
188
- var _node_params;
189
- var params = (_node_params = node.params) !== null && _node_params !== void 0 ? _node_params : [];
190
- // Decorated parameters indicate framework-driven signatures (NestJS handlers, Angular DI inside
191
- // constructors which we already skip — but standalone decorated functions exist too).
192
- if (!params.some(paramHasDecorator) && params.length > maxParams) {
193
- var _node_parent, _node_parent_parent;
194
- // Anchor for JSDoc lookup: prefer the enclosing export statement, then a VariableDeclaration
195
- // (for `const fn = () => ...`), otherwise the function node itself.
196
- var anchor = node;
197
- if (((_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.type) === 'VariableDeclarator' && ((_node_parent_parent = node.parent.parent) === null || _node_parent_parent === void 0 ? void 0 : _node_parent_parent.type) === 'VariableDeclaration') {
198
- anchor = node.parent.parent;
199
- }
200
- if (anchor.parent && (anchor.parent.type === 'ExportNamedDeclaration' || anchor.parent.type === 'ExportDefaultDeclaration')) {
201
- anchor = anchor.parent;
202
- }
203
- if (!hasAllowJsdoc(sourceCode, anchor, allowTag)) {
204
- var _node_id;
205
- var name = getFunctionDisplayName(node);
206
- context.report({
207
- node: (_node_id = node.id) !== null && _node_id !== void 0 ? _node_id : node,
208
- messageId: 'tooManyParams',
209
- data: {
210
- name: name,
211
- count: String(params.length)
212
- }
213
- });
214
- }
215
- }
216
- }
217
- }
218
- return {
219
- FunctionDeclaration: checkFunction,
220
- FunctionExpression: checkFunction,
221
- ArrowFunctionExpression: checkFunction
222
- };
223
- }
224
- };
225
- }
226
- /**
227
- * ESLint rule recommending a single config object when a function takes more than two positional
228
- * parameters (default `maxParams: 2`, i.e. fires at 3+ args). Intended to be configured at the
229
- * `warn` severity. Pair with `prefer-config-object-hard` for a stricter cap.
230
- *
231
- * @see `dbx__note__typescript-programming` → Prefer Single Config Object
232
- */ createPreferConfigObjectRule({
233
- defaultMaxParams: DEFAULT_MAX_PARAMS_WARN,
234
- description: 'Prefer a single config object when a function takes more than two positional parameters.'
235
- });
236
- /**
237
- * Hard-stop variant of `prefer-config-object`. Fires when a function takes more than four positional
238
- * parameters (default `maxParams: 4`, i.e. fires at 5+ args). Intended to be configured at the
239
- * `error` severity so genuinely unwieldy signatures break the build even when the softer warn-level
240
- * rule is disabled or downgraded.
241
- *
242
- * @see `dbx__note__typescript-programming` → Prefer Single Config Object
243
- */ createPreferConfigObjectRule({
244
- defaultMaxParams: DEFAULT_MAX_PARAMS_HARD,
245
- description: 'Reject function signatures with more than four positional parameters; require a single config object.'
246
- });
247
-
248
- function _array_like_to_array$h(arr, len) {
249
- if (len == null || len > arr.length) len = arr.length;
250
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
251
- return arr2;
252
- }
253
- function _array_with_holes$a(arr) {
254
- if (Array.isArray(arr)) return arr;
255
- }
256
- function _iterable_to_array_limit$a(arr, i) {
257
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
258
- if (_i == null) return;
259
- var _arr = [];
260
- var _n = true;
261
- var _d = false;
262
- var _s, _e;
263
- try {
264
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
265
- _arr.push(_s.value);
266
- if (i && _arr.length === i) break;
267
- }
268
- } catch (err) {
269
- _d = true;
270
- _e = err;
271
- } finally{
272
- try {
273
- if (!_n && _i["return"] != null) _i["return"]();
274
- } finally{
275
- if (_d) throw _e;
276
- }
277
- }
278
- return _arr;
279
- }
280
- function _non_iterable_rest$a() {
281
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
282
- }
283
- function _sliced_to_array$a(arr, i) {
284
- return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$a();
285
- }
286
- function _unsupported_iterable_to_array$h(o, minLen) {
287
- if (!o) return;
288
- if (typeof o === "string") return _array_like_to_array$h(o, minLen);
289
- var n = Object.prototype.toString.call(o).slice(8, -1);
290
- if (n === "Object" && o.constructor) n = o.constructor.name;
291
- if (n === "Map" || n === "Set") return Array.from(n);
292
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
293
- }
294
- var TAG_LINE_REGEX = /^@([A-Za-z_]\w*)\s*(.*)$/;
295
- var TYPE_ANNOTATION_REGEX = /^\{([^}]*)\}\s*(.*)$/;
296
- var PARAM_NAME_REGEX = /^([A-Za-z_$][A-Za-z0-9_$.[\]]*)\s*(.*)$/;
297
- var LINE_PREFIX_REGEX = /^(\s*\*?\s?)(.*)$/;
298
- /**
299
- * Strips the leading whitespace + `*` + optional space prefix from a JSDoc body line and reports the length stripped.
300
- *
301
- * @param raw - The raw line as it appears in `comment.value`.
302
- * @returns A `{ text, prefixLength }` pair.
303
- *
304
- * @example
305
- * ```ts
306
- * stripPrefix(' * @param x - desc'); // { text: '@param x - desc', prefixLength: 3 }
307
- * stripPrefix(' *'); // { text: '', prefixLength: 2 }
308
- * stripPrefix('* hello'); // { text: 'hello', prefixLength: 2 }
309
- * ```
310
- */ function stripPrefix(raw) {
311
- var match = LINE_PREFIX_REGEX.exec(raw);
312
- var result = {
313
- text: raw,
314
- prefixLength: 0
315
- };
316
- if (match) {
317
- result.text = match[2];
318
- result.prefixLength = match[1].length;
319
- }
320
- return result;
321
- }
322
- /**
323
- * Splits the raw comment value into per-line views with prefix/offset metadata.
324
- *
325
- * @param commentValue - The `value` of an ESLint Block comment.
326
- * @returns Array of parsed line records in source order.
327
- */ function buildParsedLines(commentValue) {
328
- var rawLines = commentValue.split('\n');
329
- var runningOffset = 0;
330
- return rawLines.map(function(raw, index) {
331
- var _stripPrefix = stripPrefix(raw), stripped = _stripPrefix.text, prefixLength = _stripPrefix.prefixLength;
332
- var text = stripped.trimEnd();
333
- var blank = text.length === 0;
334
- var valueOffsetStart = runningOffset;
335
- var textOffsetStart = runningOffset + prefixLength;
336
- runningOffset += raw.length + 1; // +1 for the consumed `\n` (overshoots on last line, harmless)
337
- return {
338
- raw: raw,
339
- text: text,
340
- blank: blank,
341
- index: index,
342
- valueOffsetStart: valueOffsetStart,
343
- textOffsetStart: textOffsetStart
344
- };
345
- });
346
- }
347
- /**
348
- * Computes, per line, whether it sits inside a fenced code block (a ```` ``` ```` block, typically
349
- * an `@example` body) and therefore must not be treated as a tag boundary. Fence delimiter lines
350
- * themselves are flagged too. Without this, `@`-prefixed lines inside a fence — decorators like
351
- * `@Global()` / `@Module()`, or JSDoc snippets — would be mis-parsed as standalone JSDoc tags.
352
- *
353
- * @param lines - Parsed lines in source order.
354
- * @returns Boolean mask where `true` marks a line that must not start a tag.
355
- */ function computeFenceMask(lines) {
356
- var mask = lines.map(function() {
357
- return false;
358
- });
359
- var fenceOpen = false;
360
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
361
- try {
362
- for(var _iterator = lines.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
363
- var _step_value = _sliced_to_array$a(_step.value, 2), i = _step_value[0], line = _step_value[1];
364
- var isDelimiter = line.text.trimStart().startsWith('```');
365
- if (isDelimiter) {
366
- mask[i] = true;
367
- fenceOpen = !fenceOpen;
368
- } else {
369
- mask[i] = fenceOpen;
370
- }
371
- }
372
- } catch (err) {
373
- _didIteratorError = true;
374
- _iteratorError = err;
375
- } finally{
376
- try {
377
- if (!_iteratorNormalCompletion && _iterator.return != null) {
378
- _iterator.return();
379
- }
380
- } finally{
381
- if (_didIteratorError) {
382
- throw _iteratorError;
383
- }
384
- }
385
- }
386
- return mask;
387
- }
388
- /**
389
- * Returns true when the line at `index` opens a JSDoc tag and is not masked out by a code fence.
390
- *
391
- * @param lines - Parsed lines in source order.
392
- * @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
393
- * @param index - Line index to test.
394
- * @returns True when the line begins a tag that should be treated as a tag boundary.
395
- */ function isTagStart(lines, fenceMask, index) {
396
- return !fenceMask[index] && TAG_LINE_REGEX.test(lines[index].text);
397
- }
398
- /**
399
- * Returns the index of the first line that begins with a JSDoc `@tag`, or `-1` when none exists.
400
- *
401
- * @param lines - Parsed lines in source order.
402
- * @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
403
- * @returns Zero-based line index of the first tag, or `-1` when no tag is present.
404
- */ function findFirstTagIndex(lines, fenceMask) {
405
- var firstTagIndex = -1;
406
- for(var i = 0; i < lines.length; i += 1){
407
- if (isTagStart(lines, fenceMask, i)) {
408
- firstTagIndex = i;
409
- break;
410
- }
411
- }
412
- return firstTagIndex;
413
- }
414
- /**
415
- * Trims leading and trailing blank lines from a contiguous run of description lines.
416
- *
417
- * @param descriptionLines - Description-section lines before any tag.
418
- * @returns Sub-array with surrounding blank lines stripped.
419
- */ function trimBlankBoundaries(descriptionLines) {
420
- var descStart = 0;
421
- var descEnd = descriptionLines.length;
422
- while(descStart < descEnd && descriptionLines[descStart].blank)descStart += 1;
423
- while(descEnd > descStart && descriptionLines[descEnd - 1].blank)descEnd -= 1;
424
- return descriptionLines.slice(descStart, descEnd);
425
- }
426
- /**
427
- * Splits the trimmed description lines into paragraphs separated by blank-line runs.
428
- *
429
- * @param trimmedDescription - Description lines with surrounding blank lines removed.
430
- * @returns Paragraph strings joined by `\n`.
431
- */ function buildDescriptionParagraphs(trimmedDescription) {
432
- var descriptionParagraphs = [];
433
- var paragraphBuffer = [];
434
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
435
- try {
436
- for(var _iterator = trimmedDescription[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
437
- var line = _step.value;
438
- if (line.blank) {
439
- if (paragraphBuffer.length > 0) {
440
- descriptionParagraphs.push(paragraphBuffer.join('\n'));
441
- paragraphBuffer = [];
442
- }
443
- } else {
444
- paragraphBuffer.push(line.text);
445
- }
446
- }
447
- } catch (err) {
448
- _didIteratorError = true;
449
- _iteratorError = err;
450
- } finally{
451
- try {
452
- if (!_iteratorNormalCompletion && _iterator.return != null) {
453
- _iterator.return();
454
- }
455
- } finally{
456
- if (_didIteratorError) {
457
- throw _iteratorError;
458
- }
459
- }
460
- }
461
- if (paragraphBuffer.length > 0) {
462
- descriptionParagraphs.push(paragraphBuffer.join('\n'));
463
- }
464
- return descriptionParagraphs;
465
- }
466
- /**
467
- * Pulls an optional `{Type}` annotation off the front of a tag remainder.
468
- *
469
- * @param remainder - The tag-line text after the `@tagName` prefix.
470
- * @returns The annotation (or `undefined`) plus the remaining text.
471
- */ function extractTypeAnnotation(remainder) {
472
- var type;
473
- var rest = remainder;
474
- var typeMatch = TYPE_ANNOTATION_REGEX.exec(remainder);
475
- if (typeMatch) {
476
- type = typeMatch[1];
477
- rest = typeMatch[2];
478
- }
479
- return {
480
- type: type,
481
- rest: rest
482
- };
483
- }
484
- /**
485
- * Pulls an optional parameter name off the front of a `@param` tag remainder.
486
- *
487
- * @param tagName - Tag name (only `'param'` extracts a name; other tags pass through).
488
- * @param remainder - The tag-line text after the optional `{Type}` annotation.
489
- * @returns The parameter name (or `undefined`) plus the remaining text.
490
- */ function extractParamName(tagName, remainder) {
491
- var name;
492
- var rest = remainder;
493
- if (tagName === 'param') {
494
- var nameMatch = PARAM_NAME_REGEX.exec(remainder);
495
- if (nameMatch) {
496
- name = nameMatch[1];
497
- rest = nameMatch[2];
498
- }
499
- }
500
- return {
501
- name: name,
502
- rest: rest
503
- };
504
- }
505
- /**
506
- * Collects the tag line at `startIndex` plus every following non-tag continuation line.
507
- *
508
- * @param lines - All parsed lines in the comment.
509
- * @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
510
- * @param startIndex - Index of the `@tag` opening line.
511
- * @returns The collected tag lines and the index of the next unconsumed line.
512
- */ function collectTagLines(lines, fenceMask, startIndex) {
513
- var tagLines = [
514
- lines[startIndex]
515
- ];
516
- var j = startIndex + 1;
517
- while(j < lines.length){
518
- if (isTagStart(lines, fenceMask, j)) break;
519
- tagLines.push(lines[j]);
520
- j += 1;
521
- }
522
- return {
523
- tagLines: tagLines,
524
- nextIndex: j
525
- };
526
- }
527
- /**
528
- * Joins the on-line remainder and continuation-line text into a tag description, dropping trailing
529
- * blank lines while preserving interior blanks.
530
- *
531
- * @param remainder - The on-line remainder after stripping `@tagName {Type} name`.
532
- * @param tagLines - All lines that belong to the tag (including the header line at index 0).
533
- * @returns Description text joined by `\n`.
534
- */ function buildTagDescription(remainder, tagLines) {
535
- var descriptionParts = [];
536
- if (remainder.length > 0) descriptionParts.push(remainder);
537
- for(var k = 1; k < tagLines.length; k += 1){
538
- descriptionParts.push(tagLines[k].text);
539
- }
540
- while(descriptionParts.length > 0 && descriptionParts.at(-1).trim().length === 0){
541
- descriptionParts.pop();
542
- }
543
- return descriptionParts.join('\n');
544
- }
545
- /**
546
- * Builds a single parsed-tag record starting at `startIndex` in the line array.
547
- *
548
- * @param lines - All parsed lines in the comment.
549
- * @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
550
- * @param startIndex - Index of the `@tag` opening line.
551
- * @returns The parsed tag and the next unconsumed line index.
552
- */ function parseTagAt(lines, fenceMask, startIndex) {
553
- var line = lines[startIndex];
554
- var match = TAG_LINE_REGEX.exec(line.text);
555
- var tagName = match[1];
556
- var _extractTypeAnnotation = extractTypeAnnotation(match[2]), type = _extractTypeAnnotation.type, afterType = _extractTypeAnnotation.rest;
557
- var _extractParamName = extractParamName(tagName, afterType), name = _extractParamName.name, afterName = _extractParamName.rest;
558
- var _collectTagLines = collectTagLines(lines, fenceMask, startIndex), tagLines = _collectTagLines.tagLines, nextIndex = _collectTagLines.nextIndex;
559
- var description = buildTagDescription(afterName, tagLines);
560
- return {
561
- tag: {
562
- tag: tagName,
563
- name: name,
564
- type: type,
565
- description: description,
566
- lines: tagLines,
567
- startLineIndex: startIndex,
568
- endLineIndex: nextIndex - 1
569
- },
570
- nextIndex: nextIndex
571
- };
572
- }
573
- /**
574
- * Parses every `@tag` block starting from `firstTagIndex` to the end of the line array.
575
- *
576
- * @param lines - All parsed lines in the comment.
577
- * @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
578
- * @param firstTagIndex - Index where tag parsing should begin (`-1` skips entirely).
579
- * @returns All parsed tags in source order.
580
- */ function parseTags(lines, fenceMask, firstTagIndex) {
581
- var tags = [];
582
- if (firstTagIndex !== -1) {
583
- var i = firstTagIndex;
584
- while(i < lines.length){
585
- if (!isTagStart(lines, fenceMask, i)) {
586
- i += 1;
587
- continue;
588
- }
589
- var _parseTagAt = parseTagAt(lines, fenceMask, i), tag = _parseTagAt.tag, nextIndex = _parseTagAt.nextIndex;
590
- tags.push(tag);
591
- i = nextIndex;
592
- }
593
- }
594
- return tags;
595
- }
596
- /**
597
- * Parses the value of an ESLint Block comment that represents a JSDoc into a structured form.
598
- *
599
- * @param commentValue - The `value` of an ESLint Block comment (text between `/*` and `*\/`, including the leading `*`).
600
- * @returns A structured view of the JSDoc with description, paragraphs, and tags.
601
- *
602
- * @example
603
- * ```ts
604
- * const parsed = parseJsdocComment('*\n * Hello.\n *\n * @param x - The value.\n ');
605
- * // parsed.description === 'Hello.'
606
- * // parsed.tags[0].tag === 'param'
607
- * // parsed.tags[0].name === 'x'
608
- * // parsed.tags[0].description === 'The value.'
609
- * ```
610
- */ function parseJsdocComment(commentValue) {
611
- var singleLine = !commentValue.includes('\n');
612
- var lines = buildParsedLines(commentValue);
613
- var fenceMask = computeFenceMask(lines);
614
- var firstTagIndex = findFirstTagIndex(lines, fenceMask);
615
- var descriptionLines = firstTagIndex === -1 ? lines.slice() : lines.slice(0, firstTagIndex);
616
- var trimmedDescription = trimBlankBoundaries(descriptionLines);
617
- var description = trimmedDescription.map(function(l) {
618
- return l.text;
619
- }).join('\n');
620
- var descriptionParagraphs = buildDescriptionParagraphs(trimmedDescription);
621
- var tags = parseTags(lines, fenceMask, firstTagIndex);
622
- return {
623
- lines: lines,
624
- descriptionLines: descriptionLines,
625
- description: description,
626
- descriptionParagraphs: descriptionParagraphs,
627
- tags: tags,
628
- singleLine: singleLine
629
- };
630
- }
631
-
632
- /**
633
- * Shared helpers for the `@dbx<Family>` companion-tag ESLint rules. Mirrors the
634
- * scanner schemas in `packages/dbx-cli/src/lib/mcp-scan/scan/*-extract.ts` so
635
- * violations surface at lint time instead of at manifest-regeneration time.
636
- *
637
- * Each per-family rule supplies a {@link DbxTagFamilySpec} describing which
638
- * companions are required/optional, what value format each accepts, and which
639
- * messageId to emit when a check fails. The rule body itself only wires the
640
- * visitors and message map; all value-format validation lives here.
641
- */ function _array_like_to_array$g(arr, len) {
642
- if (len == null || len > arr.length) len = arr.length;
643
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
644
- return arr2;
645
- }
646
- function _array_with_holes$9(arr) {
647
- if (Array.isArray(arr)) return arr;
648
- }
649
- function _iterable_to_array_limit$9(arr, i) {
650
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
651
- if (_i == null) return;
652
- var _arr = [];
653
- var _n = true;
654
- var _d = false;
655
- var _s, _e;
656
- try {
657
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
658
- _arr.push(_s.value);
659
- if (i && _arr.length === i) break;
660
- }
661
- } catch (err) {
662
- _d = true;
663
- _e = err;
664
- } finally{
665
- try {
666
- if (!_n && _i["return"] != null) _i["return"]();
667
- } finally{
668
- if (_d) throw _e;
669
- }
670
- }
671
- return _arr;
672
- }
673
- function _non_iterable_rest$9() {
674
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
675
- }
676
- function _sliced_to_array$9(arr, i) {
677
- return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$9();
678
- }
679
- function _unsupported_iterable_to_array$g(o, minLen) {
680
- if (!o) return;
681
- if (typeof o === "string") return _array_like_to_array$g(o, minLen);
682
- var n = Object.prototype.toString.call(o).slice(8, -1);
683
- if (n === "Object" && o.constructor) n = o.constructor.name;
684
- if (n === "Map" || n === "Set") return Array.from(n);
685
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
686
- }
687
- /**
688
- * Kebab-case slug pattern: lowercase letters/digits, words separated by single hyphens,
689
- * starts with a letter. Used to validate slug/related/skill-ref values.
690
- */ var KEBAB_SLUG_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
691
- /**
692
- * Pascal-case TypeScript identifier pattern (starts uppercase). Used for model
693
- * identifiers and other `<ModelName>` style tag values.
694
- */ var PASCAL_IDENTIFIER_PATTERN$1 = /^[A-Z][A-Za-z0-9_$]*$/;
695
- /**
696
- * Boolean tag-value vocabulary (case-insensitive). `''` and `true|yes` map to
697
- * true; `false|no` map to false. Anything else is flagged as invalid.
698
- */ var TRUE_TAG_VALUES = new Set([
699
- '',
700
- 'true',
701
- 'yes'
702
- ]);
703
- var FALSE_TAG_VALUES = new Set([
704
- 'false',
705
- 'no'
706
- ]);
707
- /**
708
- * Splits a comma-separated tag-value string into trimmed items, preserving order.
709
- *
710
- * @param value - Raw text following the tag name on a single line.
711
- * @returns Non-empty trimmed segments in declaration order.
712
- */ function splitCommaSeparated(value) {
713
- return value.split(',').map(function(item) {
714
- return item.trim();
715
- }).filter(function(item) {
716
- return item.length > 0;
717
- });
718
- }
719
- /**
720
- * Parses a boolean tag value using the workspace vocabulary
721
- * (`''`/`true`/`yes` → true; `false`/`no` → false). Other inputs return `undefined`.
722
- *
723
- * @param text - The trimmed tag value text.
724
- * @returns The parsed boolean, or `undefined` when the text is not in the vocabulary.
725
- */ function parseBooleanTagValue(text) {
726
- var lowered = text.trim().toLowerCase();
727
- var result;
728
- if (TRUE_TAG_VALUES.has(lowered)) {
729
- result = true;
730
- } else if (FALSE_TAG_VALUES.has(lowered)) {
731
- result = false;
732
- }
733
- return result;
734
- }
735
- /**
736
- * Returns the source-text offset of an offset-within-comment-value, given a Block comment node.
737
- *
738
- * @param commentNode - The ESLint Block comment AST node.
739
- * @param valueOffset - The character offset within `comment.value`.
740
- * @returns The character offset in the source file.
741
- */ function commentValueToSourceOffset(commentNode, valueOffset) {
742
- return commentNode.range[0] + 2 + valueOffset;
743
- }
744
- /**
745
- * Returns the family marker + companion tag list for the given parsed JSDoc.
746
- * Family membership is determined by tag-name prefix.
747
- *
748
- * @param parsed - The parsed JSDoc.
749
- * @param marker - The bare family marker (e.g. `'dbxPipe'`).
750
- * @returns The marker tag (if present), and all companion tags in source order.
751
- */ function findFamilyTags(parsed, marker) {
752
- var familyTags = parsed.tags.filter(function(t) {
753
- return t.tag === marker || t.tag.startsWith(marker);
754
- });
755
- var markerTag = parsed.tags.find(function(t) {
756
- return t.tag === marker;
757
- });
758
- return {
759
- markerTag: markerTag,
760
- familyTags: familyTags
761
- };
762
- }
763
- /**
764
- * Groups companion tags (those after the marker) by suffix. Marker entries are excluded.
765
- *
766
- * @param familyTags - The family tag list from {@link findFamilyTags}.
767
- * @param marker - The bare family marker.
768
- * @returns Lookup keyed by companion-suffix listing matching tags in declaration order.
769
- */ function groupCompanionsBySuffix(familyTags, marker) {
770
- var result = new Map();
771
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
772
- try {
773
- for(var _iterator = familyTags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
774
- var tag = _step.value;
775
- var _result_get;
776
- if (tag.tag === marker) continue;
777
- var suffix = tag.tag.slice(marker.length);
778
- var list = (_result_get = result.get(suffix)) !== null && _result_get !== void 0 ? _result_get : [];
779
- list.push(tag);
780
- result.set(suffix, list);
781
- }
782
- } catch (err) {
783
- _didIteratorError = true;
784
- _iteratorError = err;
785
- } finally{
786
- try {
787
- if (!_iteratorNormalCompletion && _iterator.return != null) {
788
- _iterator.return();
789
- }
790
- } finally{
791
- if (_didIteratorError) {
792
- throw _iteratorError;
793
- }
794
- }
795
- }
796
- return result;
797
- }
798
- /**
799
- * Per-format validators dispatched from {@link validateCompanionValue}. Each entry validates
800
- * a single non-empty tag value and emits zero or more violations.
801
- */ var VALUE_VALIDATORS = {
802
- marker: function marker() {
803
- return undefined;
804
- },
805
- 'free-text': function() {
806
- return undefined;
807
- },
808
- 'comma-list-free-text': function() {
809
- return undefined;
810
- },
811
- 'kebab-slug': function(param) {
812
- var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
813
- if (!KEBAB_SLUG_PATTERN.test(value)) emit({
814
- kind: 'invalid-kebab',
815
- suffix: spec.suffix,
816
- value: value,
817
- lineIndex: lineIndex
818
- });
819
- },
820
- enum: function _enum(param) {
821
- var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
822
- var format = spec.format;
823
- if (!format.values.includes(value)) emit({
824
- kind: 'invalid-enum',
825
- suffix: spec.suffix,
826
- value: value,
827
- allowed: format.values,
828
- lineIndex: lineIndex
829
- });
830
- },
831
- 'pascal-identifier': function(param) {
832
- var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
833
- if (!PASCAL_IDENTIFIER_PATTERN$1.test(value)) emit({
834
- kind: 'invalid-pascal',
835
- suffix: spec.suffix,
836
- value: value,
837
- lineIndex: lineIndex
838
- });
839
- },
840
- 'comma-list-kebab-slug': function(param) {
841
- var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
842
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
843
- try {
844
- for(var _iterator = splitCommaSeparated(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
845
- var item = _step.value;
846
- if (!KEBAB_SLUG_PATTERN.test(item)) emit({
847
- kind: 'comma-item-not-kebab',
848
- suffix: spec.suffix,
849
- value: item,
850
- lineIndex: lineIndex
851
- });
852
- }
853
- } catch (err) {
854
- _didIteratorError = true;
855
- _iteratorError = err;
856
- } finally{
857
- try {
858
- if (!_iteratorNormalCompletion && _iterator.return != null) {
859
- _iterator.return();
860
- }
861
- } finally{
862
- if (_didIteratorError) {
863
- throw _iteratorError;
864
- }
865
- }
866
- }
867
- },
868
- 'comma-list-lowercase': function(param) {
869
- var spec = param.spec, tag = param.tag, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
870
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
871
- try {
872
- for(var _iterator = splitCommaSeparated(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
873
- var item = _step.value;
874
- if (/[A-Z]/.test(item)) emit({
875
- kind: 'tags-not-lowercase',
876
- suffix: spec.suffix,
877
- value: item,
878
- lineIndex: lineIndex,
879
- raw: tag
880
- });
881
- }
882
- } catch (err) {
883
- _didIteratorError = true;
884
- _iteratorError = err;
885
- } finally{
886
- try {
887
- if (!_iteratorNormalCompletion && _iterator.return != null) {
888
- _iterator.return();
889
- }
890
- } finally{
891
- if (_didIteratorError) {
892
- throw _iteratorError;
893
- }
894
- }
895
- }
896
- },
897
- boolean: function boolean(param) {
898
- var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
899
- if (parseBooleanTagValue(value) === undefined) emit({
900
- kind: 'invalid-boolean',
901
- suffix: spec.suffix,
902
- value: value,
903
- lineIndex: lineIndex
904
- });
905
- }
906
- };
907
- /**
908
- * Validates one companion tag's value against the configured {@link DbxTagFormat}
909
- * and emits zero-or-more violations. Used by {@link checkDbxTagFamily} to keep
910
- * each rule's body small.
911
- *
912
- * @param spec - The companion spec being validated.
913
- * @param tags - All occurrences of the companion in source order.
914
- * @param emit - Callback for each violation.
915
- */ function validateCompanionValue(spec, tags, emit) {
916
- if (spec.format.kind === 'marker') return;
917
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
918
- try {
919
- for(var _iterator = tags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
920
- var tag = _step.value;
921
- var value = tag.description.trim();
922
- var lineIndex = tag.startLineIndex;
923
- if (value.length === 0) {
924
- if (spec.format.kind !== 'boolean') emit({
925
- kind: 'empty',
926
- suffix: spec.suffix,
927
- lineIndex: lineIndex
928
- });
929
- continue;
930
- }
931
- var validator = VALUE_VALIDATORS[spec.format.kind];
932
- if (validator) validator({
933
- spec: spec,
934
- tag: tag,
935
- value: value,
936
- lineIndex: lineIndex,
937
- emit: emit
938
- });
939
- }
940
- } catch (err) {
941
- _didIteratorError = true;
942
- _iteratorError = err;
943
- } finally{
944
- try {
945
- if (!_iteratorNormalCompletion && _iterator.return != null) {
946
- _iterator.return();
947
- }
948
- } finally{
949
- if (_didIteratorError) {
950
- throw _iteratorError;
951
- }
952
- }
953
- }
954
- }
955
- function emitUnknownCompanions(groups, knownSuffixes, emit) {
956
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
957
- try {
958
- for(var _iterator = groups.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
959
- var _step_value = _sliced_to_array$9(_step.value, 2), suffix = _step_value[0], instances = _step_value[1];
960
- if (knownSuffixes.has(suffix)) continue;
961
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
962
- try {
963
- for(var _iterator1 = instances[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
964
- var tag = _step1.value;
965
- emit({
966
- kind: 'unknown',
967
- suffix: suffix,
968
- lineIndex: tag.startLineIndex
969
- });
970
- }
971
- } catch (err) {
972
- _didIteratorError1 = true;
973
- _iteratorError1 = err;
974
- } finally{
975
- try {
976
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
977
- _iterator1.return();
978
- }
979
- } finally{
980
- if (_didIteratorError1) {
981
- throw _iteratorError1;
982
- }
983
- }
984
- }
985
- }
986
- } catch (err) {
987
- _didIteratorError = true;
988
- _iteratorError = err;
989
- } finally{
990
- try {
991
- if (!_iteratorNormalCompletion && _iterator.return != null) {
992
- _iterator.return();
993
- }
994
- } finally{
995
- if (_didIteratorError) {
996
- throw _iteratorError;
997
- }
998
- }
999
- }
1000
- }
1001
- function emitDuplicateCompanions(companion, instances, emit) {
1002
- for(var i = 1; i < instances.length; i += 1){
1003
- emit({
1004
- kind: 'duplicate',
1005
- suffix: companion.suffix,
1006
- lineIndex: instances[i].startLineIndex
1007
- });
1008
- }
1009
- }
1010
- function checkCompanion(input) {
1011
- var companion = input.companion, instances = input.instances, markerLineIndex = input.markerLineIndex, emit = input.emit;
1012
- if (instances.length === 0) {
1013
- if (companion.required) emit({
1014
- kind: 'missing',
1015
- suffix: companion.suffix,
1016
- lineIndex: markerLineIndex
1017
- });
1018
- return;
1019
- }
1020
- if (!companion.multiple && instances.length > 1) emitDuplicateCompanions(companion, instances, emit);
1021
- validateCompanionValue(companion, instances, emit);
1022
- }
1023
- /**
1024
- * Validates a `@dbx<Family>` marker plus its companion tags against the supplied spec.
1025
- * Reports unknown companions, missing required companions, duplicates, and per-companion
1026
- * value violations through `input.emit`.
1027
- *
1028
- * @param input - Parsed JSDoc, family spec, resolved marker/companion tags, and emit sink.
1029
- *
1030
- * @example
1031
- * ```ts
1032
- * checkDbxTagFamily({ parsed, spec, markerTag, familyTags, emit });
1033
- * ```
1034
- */ function checkDbxTagFamily(input) {
1035
- var spec = input.spec, markerTag = input.markerTag, familyTags = input.familyTags, emit = input.emit;
1036
- var knownSuffixes = new Set(spec.companions.map(function(c) {
1037
- return c.suffix;
1038
- }));
1039
- var groups = groupCompanionsBySuffix(familyTags, spec.marker);
1040
- emitUnknownCompanions(groups, knownSuffixes, emit);
1041
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1042
- try {
1043
- for(var _iterator = spec.companions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1044
- var companion = _step.value;
1045
- var _groups_get;
1046
- var instances = (_groups_get = groups.get(companion.suffix)) !== null && _groups_get !== void 0 ? _groups_get : [];
1047
- checkCompanion({
1048
- companion: companion,
1049
- instances: instances,
1050
- markerLineIndex: markerTag.startLineIndex,
1051
- emit: emit
1052
- });
1053
- }
1054
- } catch (err) {
1055
- _didIteratorError = true;
1056
- _iteratorError = err;
1057
- } finally{
1058
- try {
1059
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1060
- _iterator.return();
1061
- }
1062
- } finally{
1063
- if (_didIteratorError) {
1064
- throw _iteratorError;
1065
- }
1066
- }
1067
- }
1068
- }
1069
- /**
1070
- * Translates a JSDoc-line violation into an ESLint `context.report()` call by computing the
1071
- * source range of the offending line and attaching the supplied message + optional fixer.
1072
- *
1073
- * @param input - Reporting context (comment node, parsed JSDoc, source code, line index, message id, optional data + fixer, report sink).
1074
- *
1075
- * @example
1076
- * ```ts
1077
- * reportOnJsdocLine({ commentNode, parsed, sourceCode, lineIndex: tag.startLineIndex, messageId: 'unknown', report: context.report });
1078
- * ```
1079
- */ function reportOnJsdocLine(input) {
1080
- var _ref, _ref1;
1081
- var _line_text;
1082
- var commentNode = input.commentNode, parsed = input.parsed, sourceCode = input.sourceCode, lineIndex = input.lineIndex, messageId = input.messageId, data = input.data, report = input.report, fix = input.fix;
1083
- var line = parsed.lines[lineIndex];
1084
- var startInValue = (_ref = line === null || line === void 0 ? void 0 : line.textOffsetStart) !== null && _ref !== void 0 ? _ref : 0;
1085
- var endInValue = startInValue + ((_ref1 = line === null || line === void 0 ? void 0 : (_line_text = line.text) === null || _line_text === void 0 ? void 0 : _line_text.length) !== null && _ref1 !== void 0 ? _ref1 : 0);
1086
- var start = commentValueToSourceOffset(commentNode, startInValue);
1087
- var end = commentValueToSourceOffset(commentNode, endInValue);
1088
- report({
1089
- loc: {
1090
- type: 'SourceLocation',
1091
- start: sourceCode.getLocFromIndex(start),
1092
- end: sourceCode.getLocFromIndex(end)
1093
- },
1094
- messageId: messageId,
1095
- data: data,
1096
- fix: fix
1097
- });
1098
- }
1099
- /**
1100
- * Computes an auto-fix descriptor that lowercases every token after a `@dbx<Family>Tags` tag
1101
- * name. Returns `undefined` when the line is already canonical so the caller can short-circuit.
1102
- *
1103
- * @param input - Fix context (comment node, parsed JSDoc, source code, target tag).
1104
- * @returns Replacement range + text when a rewrite is needed; otherwise `undefined`.
1105
- *
1106
- * @example
1107
- * ```ts
1108
- * const fix = buildLowercaseTagsFix({ commentNode, parsed, sourceCode, tag });
1109
- * ```
1110
- */ function buildLowercaseTagsFix(input) {
1111
- var commentNode = input.commentNode, parsed = input.parsed, sourceCode = input.sourceCode, tag = input.tag;
1112
- var tagLine = parsed.lines[tag.startLineIndex];
1113
- var result;
1114
- if (tagLine) {
1115
- var tagLineSourceStart = commentValueToSourceOffset(commentNode, tagLine.textOffsetStart);
1116
- var tagLineSourceEnd = tagLineSourceStart + tagLine.text.length;
1117
- var sourceText = sourceCode.getText();
1118
- var lineSource = sourceText.slice(tagLineSourceStart, tagLineSourceEnd);
1119
- var lowered = lineSource.replace(/^(@[A-Za-z]+\s+)(.*)$/, function(_match, prefix, body) {
1120
- return "".concat(prefix).concat(body.toLowerCase());
1121
- });
1122
- if (lowered !== lineSource) {
1123
- result = {
1124
- startOffset: tagLineSourceStart,
1125
- endOffset: tagLineSourceEnd,
1126
- replacement: lowered
1127
- };
1128
- }
1129
- }
1130
- return result;
1131
- }
1132
-
1133
10
  function _array_like_to_array$f(arr, len) {
1134
11
  if (len == null || len > arr.length) len = arr.length;
1135
12
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -1852,10 +729,10 @@ function _unsupported_iterable_to_array$e(o, minLen) {
1852
729
  var registry = createImportRegistry();
1853
730
  var stack = [];
1854
731
  function jsdocHasMarker(anchor) {
1855
- var jsdoc = leadingJsdocFor(sourceCode, anchor);
732
+ var jsdoc = eslint.leadingJsdocFor(sourceCode, anchor);
1856
733
  var result = false;
1857
734
  if (jsdoc) {
1858
- var parsed = parseJsdocComment(jsdoc.value);
735
+ var parsed = eslint.parseJsdocComment(jsdoc.value);
1859
736
  result = parsed.tags.some(function(t) {
1860
737
  return t.tag === markerTag;
1861
738
  });
@@ -2034,10 +911,10 @@ var DEFAULT_STRIPPABLE_SUFFIXES = [
2034
911
  var allowedSuffixes = (_options_allowedSuffixes = options.allowedSuffixes) !== null && _options_allowedSuffixes !== void 0 ? _options_allowedSuffixes : [];
2035
912
  var strippableSuffixes = (_options_strippableSuffixes = options.strippableSuffixes) !== null && _options_strippableSuffixes !== void 0 ? _options_strippableSuffixes : DEFAULT_STRIPPABLE_SUFFIXES;
2036
913
  function isTagged(anchor) {
2037
- var jsdoc = leadingJsdocFor(sourceCode, anchor);
914
+ var jsdoc = eslint.leadingJsdocFor(sourceCode, anchor);
2038
915
  var result = false;
2039
916
  if (jsdoc) {
2040
- var parsed = parseJsdocComment(jsdoc.value);
917
+ var parsed = eslint.parseJsdocComment(jsdoc.value);
2041
918
  result = parsed.tags.some(function(t) {
2042
919
  return t.tag === markerTag;
2043
920
  });
@@ -2303,7 +1180,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2303
1180
  };
2304
1181
  function handleCommaItem(input) {
2305
1182
  var commentNode = input.commentNode, parsed = input.parsed, suffix = input.suffix, value = input.value, lineIndex = input.lineIndex;
2306
- if (suffix === 'Related') reportOnJsdocLine({
1183
+ if (suffix === 'Related') eslint.reportOnJsdocLine({
2307
1184
  commentNode: commentNode,
2308
1185
  parsed: parsed,
2309
1186
  sourceCode: sourceCode,
@@ -2314,7 +1191,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2314
1191
  },
2315
1192
  report: context.report
2316
1193
  });
2317
- else if (suffix === 'SkillRefs') reportOnJsdocLine({
1194
+ else if (suffix === 'SkillRefs') eslint.reportOnJsdocLine({
2318
1195
  commentNode: commentNode,
2319
1196
  parsed: parsed,
2320
1197
  sourceCode: sourceCode,
@@ -2328,7 +1205,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2328
1205
  }
2329
1206
  function handleTagsNotLowercase(commentNode, parsed, v) {
2330
1207
  if (v.suffix !== 'Tags') return;
2331
- var fix = buildLowercaseTagsFix({
1208
+ var fix = eslint.buildLowercaseTagsFix({
2332
1209
  commentNode: commentNode,
2333
1210
  parsed: parsed,
2334
1211
  sourceCode: sourceCode,
@@ -2340,7 +1217,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2340
1217
  fix.endOffset
2341
1218
  ], fix.replacement);
2342
1219
  } : undefined;
2343
- reportOnJsdocLine({
1220
+ eslint.reportOnJsdocLine({
2344
1221
  commentNode: commentNode,
2345
1222
  parsed: parsed,
2346
1223
  sourceCode: sourceCode,
@@ -2357,7 +1234,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2357
1234
  switch(v.kind){
2358
1235
  case 'missing':
2359
1236
  case 'empty':
2360
- if (v.suffix === 'Model') reportOnJsdocLine({
1237
+ if (v.suffix === 'Model') eslint.reportOnJsdocLine({
2361
1238
  commentNode: commentNode,
2362
1239
  parsed: parsed,
2363
1240
  sourceCode: sourceCode,
@@ -2367,7 +1244,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2367
1244
  });
2368
1245
  break;
2369
1246
  case 'invalid-kebab':
2370
- if (v.suffix === 'Slug') reportOnJsdocLine({
1247
+ if (v.suffix === 'Slug') eslint.reportOnJsdocLine({
2371
1248
  commentNode: commentNode,
2372
1249
  parsed: parsed,
2373
1250
  sourceCode: sourceCode,
@@ -2380,7 +1257,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2380
1257
  });
2381
1258
  break;
2382
1259
  case 'invalid-pascal':
2383
- if (v.suffix === 'Model') reportOnJsdocLine({
1260
+ if (v.suffix === 'Model') eslint.reportOnJsdocLine({
2384
1261
  commentNode: commentNode,
2385
1262
  parsed: parsed,
2386
1263
  sourceCode: sourceCode,
@@ -2393,7 +1270,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2393
1270
  });
2394
1271
  break;
2395
1272
  case 'invalid-enum':
2396
- if (v.suffix === 'Scope') reportOnJsdocLine({
1273
+ if (v.suffix === 'Scope') eslint.reportOnJsdocLine({
2397
1274
  commentNode: commentNode,
2398
1275
  parsed: parsed,
2399
1276
  sourceCode: sourceCode,
@@ -2407,7 +1284,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2407
1284
  });
2408
1285
  break;
2409
1286
  case 'invalid-boolean':
2410
- reportOnJsdocLine({
1287
+ eslint.reportOnJsdocLine({
2411
1288
  commentNode: commentNode,
2412
1289
  parsed: parsed,
2413
1290
  sourceCode: sourceCode,
@@ -2433,7 +1310,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2433
1310
  handleTagsNotLowercase(commentNode, parsed, v);
2434
1311
  break;
2435
1312
  case 'unknown':
2436
- reportOnJsdocLine({
1313
+ eslint.reportOnJsdocLine({
2437
1314
  commentNode: commentNode,
2438
1315
  parsed: parsed,
2439
1316
  sourceCode: sourceCode,
@@ -2447,7 +1324,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2447
1324
  });
2448
1325
  break;
2449
1326
  case 'duplicate':
2450
- reportOnJsdocLine({
1327
+ eslint.reportOnJsdocLine({
2451
1328
  commentNode: commentNode,
2452
1329
  parsed: parsed,
2453
1330
  sourceCode: sourceCode,
@@ -2462,10 +1339,11 @@ var DEFAULT_KNOWN_COMPANIONS = [
2462
1339
  }
2463
1340
  }
2464
1341
  function checkJsdoc(commentNode, parsed) {
2465
- var _findFamilyTags = findFamilyTags(parsed, spec.marker), markerTag = _findFamilyTags.markerTag, familyTags = _findFamilyTags.familyTags;
1342
+ var _findFamilyTags = eslint.findFamilyTags(parsed, spec.marker), markerTag = _findFamilyTags.markerTag, familyTags = _findFamilyTags.familyTags;
2466
1343
  if (familyTags.length === 0 || requireBareMarker && !markerTag) return;
2467
1344
  var triggerTag = markerTag !== null && markerTag !== void 0 ? markerTag : familyTags[0];
2468
- checkDbxTagFamily({
1345
+ eslint.checkDbxTagFamily({
1346
+ parsed: parsed,
2469
1347
  spec: spec,
2470
1348
  markerTag: triggerTag,
2471
1349
  familyTags: familyTags,
@@ -2486,7 +1364,7 @@ var DEFAULT_KNOWN_COMPANIONS = [
2486
1364
  });
2487
1365
  var result = false;
2488
1366
  if (tag) {
2489
- var value = parseBooleanTagValue(tag.description.trim());
1367
+ var value = eslint.parseBooleanTagValue(tag.description.trim());
2490
1368
  result = value === true;
2491
1369
  }
2492
1370
  return result;
@@ -2627,10 +1505,10 @@ var DEFAULT_KNOWN_COMPANIONS = [
2627
1505
  function checkFunction(node) {
2628
1506
  if (!node.body) return;
2629
1507
  var anchor = node.parent && (node.parent.type === 'ExportNamedDeclaration' || node.parent.type === 'ExportDefaultDeclaration') ? node.parent : node;
2630
- var commentNode = leadingJsdocFor(sourceCode, getStatementAnchor(anchor));
1508
+ var commentNode = eslint.leadingJsdocFor(sourceCode, eslint.getStatementAnchor(anchor));
2631
1509
  if (!commentNode) return;
2632
- var parsed = parseJsdocComment(commentNode.value);
2633
- var markerTag = findFamilyTags(parsed, spec.marker).markerTag;
1510
+ var parsed = eslint.parseJsdocComment(commentNode.value);
1511
+ var markerTag = eslint.findFamilyTags(parsed, spec.marker).markerTag;
2634
1512
  if (!markerTag && requireBareMarker) return;
2635
1513
  checkJsdoc(commentNode, parsed);
2636
1514
  checkBody(node, parsed);
@@ -2728,10 +1606,10 @@ function _type_of$8(obj) {
2728
1606
  (_options_presumedTaggedSuffix = options.presumedTaggedSuffix) !== null && _options_presumedTaggedSuffix !== void 0 ? _options_presumedTaggedSuffix : DEFAULT_PRESUMED_TAGGED_SUFFIX;
2729
1607
  var registry = createImportRegistry();
2730
1608
  function jsdocFlagsDispatcher(anchor) {
2731
- var jsdoc = leadingJsdocFor(sourceCode, anchor);
1609
+ var jsdoc = eslint.leadingJsdocFor(sourceCode, anchor);
2732
1610
  var result = false;
2733
1611
  if (jsdoc) {
2734
- var parsed = parseJsdocComment(jsdoc.value);
1612
+ var parsed = eslint.parseJsdocComment(jsdoc.value);
2735
1613
  var hasMarker = parsed.tags.some(function(t) {
2736
1614
  return t.tag === markerTag;
2737
1615
  });
@@ -2740,7 +1618,7 @@ function _type_of$8(obj) {
2740
1618
  return t.tag === dispatcherTagName;
2741
1619
  });
2742
1620
  if (dispatcherTag) {
2743
- var value = parseBooleanTagValue(dispatcherTag.description.trim());
1621
+ var value = eslint.parseBooleanTagValue(dispatcherTag.description.trim());
2744
1622
  result = value === true;
2745
1623
  }
2746
1624
  }
@@ -16174,7 +15052,7 @@ function reportModelKey(context, modelKey) {
16174
15052
  }
16175
15053
  var anchor = anchorInfo.anchor, reportNode = anchorInfo.reportNode;
16176
15054
  var exportName = (_ref = reportNode === null || reportNode === void 0 ? void 0 : reportNode.name) !== null && _ref !== void 0 ? _ref : '<anonymous>';
16177
- var jsdoc = leadingJsdocFor(sourceCode, anchor);
15055
+ var jsdoc = eslint.leadingJsdocFor(sourceCode, anchor);
16178
15056
  if (jsdoc == null) {
16179
15057
  context.report({
16180
15058
  node: reportNode,
@@ -16185,7 +15063,7 @@ function reportModelKey(context, modelKey) {
16185
15063
  });
16186
15064
  return;
16187
15065
  }
16188
- var parsed = parseJsdocComment(jsdoc.value);
15066
+ var parsed = eslint.parseJsdocComment(jsdoc.value);
16189
15067
  var matches = parsed.tags.filter(function(t) {
16190
15068
  return t.tag === tagName;
16191
15069
  });
@@ -16409,9 +15287,9 @@ var MODEL_TYPE_VALUE_PATTERN = /^[a-z][A-Za-z0-9_$]*$/;
16409
15287
  var _ref;
16410
15288
  var _node_id;
16411
15289
  var anchor = node.parent && (node.parent.type === 'ExportNamedDeclaration' || node.parent.type === 'ExportDefaultDeclaration') ? node.parent : node;
16412
- var jsdoc = leadingJsdocFor(sourceCode, anchor);
15290
+ var jsdoc = eslint.leadingJsdocFor(sourceCode, anchor);
16413
15291
  if (jsdoc == null) return;
16414
- var parsed = parseJsdocComment(jsdoc.value);
15292
+ var parsed = eslint.parseJsdocComment(jsdoc.value);
16415
15293
  var hasMarker = parsed.tags.some(function(t) {
16416
15294
  return t.tag === modelMarkerTag;
16417
15295
  });
@@ -16490,7 +15368,7 @@ function modelTypesFromFactoryComment(comment, factoryTag) {
16490
15368
  var out = [];
16491
15369
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
16492
15370
  try {
16493
- for(var _iterator = parseJsdocComment(comment.value).tags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
15371
+ for(var _iterator = eslint.parseJsdocComment(comment.value).tags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
16494
15372
  var tag = _step.value;
16495
15373
  if (tag.tag !== factoryTag) continue;
16496
15374
  var firstToken = tag.description.trim().split(/\s+/)[0];
@@ -16643,7 +15521,7 @@ function reportMutuallyExclusiveMarkers(ctx, markers) {
16643
15521
  });
16644
15522
  if (exclusiveMarkers.length <= 1) return;
16645
15523
  for(var i = 1; i < exclusiveMarkers.length; i += 1){
16646
- reportOnJsdocLine({
15524
+ eslint.reportOnJsdocLine({
16647
15525
  commentNode: ctx.commentNode,
16648
15526
  parsed: ctx.parsed,
16649
15527
  sourceCode: ctx.sourceCode,
@@ -16663,7 +15541,7 @@ function reportPropertyOnlyTags(ctx, companions) {
16663
15541
  try {
16664
15542
  for(var _iterator1 = ((_companions_get = companions.get(propOnly)) !== null && _companions_get !== void 0 ? _companions_get : [])[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
16665
15543
  var tag = _step1.value;
16666
- reportOnJsdocLine({
15544
+ eslint.reportOnJsdocLine({
16667
15545
  commentNode: ctx.commentNode,
16668
15546
  parsed: ctx.parsed,
16669
15547
  sourceCode: ctx.sourceCode,
@@ -16716,7 +15594,7 @@ function reportUnknownModelCompanions(ctx, companions, knownCompanions) {
16716
15594
  try {
16717
15595
  for(var _iterator1 = instances[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
16718
15596
  var tag = _step1.value;
16719
- reportOnJsdocLine({
15597
+ eslint.reportOnJsdocLine({
16720
15598
  commentNode: ctx.commentNode,
16721
15599
  parsed: ctx.parsed,
16722
15600
  sourceCode: ctx.sourceCode,
@@ -16769,7 +15647,7 @@ function reportModelDuplicates(ctx, companions, knownCompanions) {
16769
15647
  var instances = (_companions_get = companions.get(suffix)) !== null && _companions_get !== void 0 ? _companions_get : [];
16770
15648
  if (instances.length <= 1) continue;
16771
15649
  for(var i = 1; i < instances.length; i += 1){
16772
- reportOnJsdocLine({
15650
+ eslint.reportOnJsdocLine({
16773
15651
  commentNode: ctx.commentNode,
16774
15652
  parsed: ctx.parsed,
16775
15653
  sourceCode: ctx.sourceCode,
@@ -16803,7 +15681,7 @@ function reportArchetypeTag(ctx, tag) {
16803
15681
  var spaceIdx = text.indexOf(' ');
16804
15682
  var slug = spaceIdx >= 0 ? text.slice(0, spaceIdx).trim() : text;
16805
15683
  if (!ARCHETYPE_SLUG_PATTERN.test(slug)) {
16806
- reportOnJsdocLine({
15684
+ eslint.reportOnJsdocLine({
16807
15685
  commentNode: ctx.commentNode,
16808
15686
  parsed: ctx.parsed,
16809
15687
  sourceCode: ctx.sourceCode,
@@ -16825,7 +15703,7 @@ function reportArchetypeTag(ctx, tag) {
16825
15703
  var trimmed = pair.trim();
16826
15704
  if (trimmed.length === 0) continue;
16827
15705
  if (!ARCHETYPE_AXIS_PATTERN.test(trimmed)) {
16828
- reportOnJsdocLine({
15706
+ eslint.reportOnJsdocLine({
16829
15707
  commentNode: ctx.commentNode,
16830
15708
  parsed: ctx.parsed,
16831
15709
  sourceCode: ctx.sourceCode,
@@ -16856,7 +15734,7 @@ function reportArchetypeTag(ctx, tag) {
16856
15734
  function reportReadTag(ctx, tag) {
16857
15735
  var value = tag.description.trim();
16858
15736
  if (value.length === 0) {
16859
- reportOnJsdocLine({
15737
+ eslint.reportOnJsdocLine({
16860
15738
  commentNode: ctx.commentNode,
16861
15739
  parsed: ctx.parsed,
16862
15740
  sourceCode: ctx.sourceCode,
@@ -16871,7 +15749,7 @@ function reportReadTag(ctx, tag) {
16871
15749
  }
16872
15750
  var firstToken = value.split(/\s+/)[0];
16873
15751
  if (!READ_LEVEL_VALUES.includes(firstToken)) {
16874
- reportOnJsdocLine({
15752
+ eslint.reportOnJsdocLine({
16875
15753
  commentNode: ctx.commentNode,
16876
15754
  parsed: ctx.parsed,
16877
15755
  sourceCode: ctx.sourceCode,
@@ -16892,7 +15770,7 @@ function reportMissingRead(ctx, markers, companions) {
16892
15770
  });
16893
15771
  if (rootMarker == null) return;
16894
15772
  if (((_companions_get = companions.get('Read')) !== null && _companions_get !== void 0 ? _companions_get : []).length > 0) return;
16895
- reportOnJsdocLine({
15773
+ eslint.reportOnJsdocLine({
16896
15774
  commentNode: ctx.commentNode,
16897
15775
  parsed: ctx.parsed,
16898
15776
  sourceCode: ctx.sourceCode,
@@ -16907,7 +15785,7 @@ function reportMissingRead(ctx, markers, companions) {
16907
15785
  function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
16908
15786
  var text = tag.description.trim();
16909
15787
  if (text.length === 0) {
16910
- reportOnJsdocLine({
15788
+ eslint.reportOnJsdocLine({
16911
15789
  commentNode: ctx.commentNode,
16912
15790
  parsed: ctx.parsed,
16913
15791
  sourceCode: ctx.sourceCode,
@@ -16915,7 +15793,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
16915
15793
  messageId: 'compositeKeyMissingFrom',
16916
15794
  report: ctx.report
16917
15795
  });
16918
- reportOnJsdocLine({
15796
+ eslint.reportOnJsdocLine({
16919
15797
  commentNode: ctx.commentNode,
16920
15798
  parsed: ctx.parsed,
16921
15799
  sourceCode: ctx.sourceCode,
@@ -16953,7 +15831,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
16953
15831
  }
16954
15832
  }
16955
15833
  if (!hasFrom) {
16956
- reportOnJsdocLine({
15834
+ eslint.reportOnJsdocLine({
16957
15835
  commentNode: ctx.commentNode,
16958
15836
  parsed: ctx.parsed,
16959
15837
  sourceCode: ctx.sourceCode,
@@ -16963,7 +15841,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
16963
15841
  });
16964
15842
  }
16965
15843
  if (encoding == null) {
16966
- reportOnJsdocLine({
15844
+ eslint.reportOnJsdocLine({
16967
15845
  commentNode: ctx.commentNode,
16968
15846
  parsed: ctx.parsed,
16969
15847
  sourceCode: ctx.sourceCode,
@@ -16972,7 +15850,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
16972
15850
  report: ctx.report
16973
15851
  });
16974
15852
  } else if (!allowedEncodings.includes(encoding)) {
16975
- reportOnJsdocLine({
15853
+ eslint.reportOnJsdocLine({
16976
15854
  commentNode: ctx.commentNode,
16977
15855
  parsed: ctx.parsed,
16978
15856
  sourceCode: ctx.sourceCode,
@@ -17109,7 +15987,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
17109
15987
  var requireRead = options.requireRead !== false;
17110
15988
  function checkInterfaceJsdoc(commentNode) {
17111
15989
  var _companions_get, _companions_get1, _companions_get2, _companions_get3;
17112
- var parsed = parseJsdocComment(commentNode.value);
15990
+ var parsed = eslint.parseJsdocComment(commentNode.value);
17113
15991
  var _collectInterfaceTags = collectInterfaceTags(parsed), markers = _collectInterfaceTags.markers, companions = _collectInterfaceTags.companions;
17114
15992
  if (markers.length === 0 && companions.size === 0 || requireBareMarker && markers.length === 0) return;
17115
15993
  var ctx = {
@@ -17149,7 +16027,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
17149
16027
  var _tag_description_trim_split_;
17150
16028
  var value = (_tag_description_trim_split_ = tag1.description.trim().split(/\s+/)[0]) !== null && _tag_description_trim_split_ !== void 0 ? _tag_description_trim_split_ : '';
17151
16029
  if (value.length > 0 && !PASCAL_IDENTIFIER_PATTERN.test(value)) {
17152
- reportOnJsdocLine({
16030
+ eslint.reportOnJsdocLine({
17153
16031
  commentNode: commentNode,
17154
16032
  parsed: parsed,
17155
16033
  sourceCode: sourceCode,
@@ -17220,7 +16098,7 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
17220
16098
  }
17221
16099
  function visitInterface(node) {
17222
16100
  var anchor = node.parent && (node.parent.type === 'ExportNamedDeclaration' || node.parent.type === 'ExportDefaultDeclaration') ? node.parent : node;
17223
- var jsdoc = leadingJsdocFor(sourceCode, anchor);
16101
+ var jsdoc = eslint.leadingJsdocFor(sourceCode, anchor);
17224
16102
  if (jsdoc) checkInterfaceJsdoc(jsdoc);
17225
16103
  }
17226
16104
  return {