eslint-plugin-jsdoc 55.4.0 → 56.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/WarnSettings.d.ts +16 -0
- package/dist/cjs/WarnSettings.js +30 -0
- package/dist/cjs/alignTransform.d.ts +33 -0
- package/dist/cjs/alignTransform.js +285 -0
- package/dist/cjs/defaultTagOrder.d.ts +4 -0
- package/dist/cjs/defaultTagOrder.js +152 -0
- package/dist/cjs/exportParser.d.ts +40 -0
- package/dist/cjs/exportParser.js +754 -0
- package/dist/cjs/getDefaultTagStructureForMode.d.ts +10 -0
- package/dist/cjs/getDefaultTagStructureForMode.js +840 -0
- package/dist/cjs/getJsdocProcessorPlugin.cjs +4 -0
- package/dist/cjs/getJsdocProcessorPlugin.d.cts +1 -0
- package/dist/cjs/getJsdocProcessorPlugin.d.ts +66 -0
- package/dist/cjs/getJsdocProcessorPlugin.js +553 -0
- package/dist/cjs/index-cjs.d.ts +16 -0
- package/dist/cjs/index-cjs.js +492 -0
- package/dist/cjs/index.cjs.cjs +6 -0
- package/dist/cjs/index.cjs.d.cts +2 -0
- package/dist/cjs/iterateJsdoc.cjs +38 -0
- package/dist/cjs/iterateJsdoc.d.cts +2 -0
- package/dist/cjs/iterateJsdoc.d.ts +462 -0
- package/dist/cjs/iterateJsdoc.js +1981 -0
- package/dist/cjs/jsdocUtils.d.ts +454 -0
- package/dist/cjs/jsdocUtils.js +1470 -0
- package/dist/cjs/rules/checkAccess.d.ts +2 -0
- package/dist/cjs/rules/checkAccess.js +35 -0
- package/dist/cjs/rules/checkAlignment.d.ts +2 -0
- package/dist/cjs/rules/checkAlignment.js +63 -0
- package/dist/cjs/rules/checkExamples.d.ts +3 -0
- package/dist/cjs/rules/checkExamples.js +486 -0
- package/dist/cjs/rules/checkIndentation.d.ts +2 -0
- package/dist/cjs/rules/checkIndentation.js +66 -0
- package/dist/cjs/rules/checkLineAlignment.d.ts +9 -0
- package/dist/cjs/rules/checkLineAlignment.js +297 -0
- package/dist/cjs/rules/checkParamNames.d.ts +2 -0
- package/dist/cjs/rules/checkParamNames.js +320 -0
- package/dist/cjs/rules/checkPropertyNames.d.ts +2 -0
- package/dist/cjs/rules/checkPropertyNames.js +105 -0
- package/dist/cjs/rules/checkSyntax.d.ts +2 -0
- package/dist/cjs/rules/checkSyntax.js +27 -0
- package/dist/cjs/rules/checkTagNames.d.ts +2 -0
- package/dist/cjs/rules/checkTagNames.js +252 -0
- package/dist/cjs/rules/checkTemplateNames.d.ts +2 -0
- package/dist/cjs/rules/checkTemplateNames.js +189 -0
- package/dist/cjs/rules/checkTypes.d.ts +2 -0
- package/dist/cjs/rules/checkTypes.js +421 -0
- package/dist/cjs/rules/checkValues.d.ts +2 -0
- package/dist/cjs/rules/checkValues.js +163 -0
- package/dist/cjs/rules/convertToJsdocComments.d.ts +251 -0
- package/dist/cjs/rules/convertToJsdocComments.js +313 -0
- package/dist/cjs/rules/emptyTags.d.ts +2 -0
- package/dist/cjs/rules/emptyTags.js +79 -0
- package/dist/cjs/rules/implementsOnClasses.d.ts +2 -0
- package/dist/cjs/rules/implementsOnClasses.js +63 -0
- package/dist/cjs/rules/importsAsDependencies.d.ts +2 -0
- package/dist/cjs/rules/importsAsDependencies.js +105 -0
- package/dist/cjs/rules/informativeDocs.d.ts +2 -0
- package/dist/cjs/rules/informativeDocs.js +153 -0
- package/dist/cjs/rules/linesBeforeBlock.d.ts +2 -0
- package/dist/cjs/rules/linesBeforeBlock.js +106 -0
- package/dist/cjs/rules/matchDescription.d.ts +2 -0
- package/dist/cjs/rules/matchDescription.js +240 -0
- package/dist/cjs/rules/matchName.d.ts +2 -0
- package/dist/cjs/rules/matchName.js +122 -0
- package/dist/cjs/rules/multilineBlocks.d.ts +2 -0
- package/dist/cjs/rules/multilineBlocks.js +339 -0
- package/dist/cjs/rules/noBadBlocks.d.ts +2 -0
- package/dist/cjs/rules/noBadBlocks.js +88 -0
- package/dist/cjs/rules/noBlankBlockDescriptions.d.ts +2 -0
- package/dist/cjs/rules/noBlankBlockDescriptions.js +56 -0
- package/dist/cjs/rules/noBlankBlocks.d.ts +2 -0
- package/dist/cjs/rules/noBlankBlocks.js +41 -0
- package/dist/cjs/rules/noDefaults.d.ts +2 -0
- package/dist/cjs/rules/noDefaults.js +84 -0
- package/dist/cjs/rules/noMissingSyntax.d.ts +9 -0
- package/dist/cjs/rules/noMissingSyntax.js +164 -0
- package/dist/cjs/rules/noMultiAsterisks.d.ts +2 -0
- package/dist/cjs/rules/noMultiAsterisks.js +83 -0
- package/dist/cjs/rules/noRestrictedSyntax.d.ts +2 -0
- package/dist/cjs/rules/noRestrictedSyntax.js +75 -0
- package/dist/cjs/rules/noTypes.d.ts +2 -0
- package/dist/cjs/rules/noTypes.js +88 -0
- package/dist/cjs/rules/noUndefinedTypes.d.ts +2 -0
- package/dist/cjs/rules/noUndefinedTypes.js +451 -0
- package/dist/cjs/rules/requireAsteriskPrefix.d.ts +2 -0
- package/dist/cjs/rules/requireAsteriskPrefix.js +144 -0
- package/dist/cjs/rules/requireDescription.d.ts +2 -0
- package/dist/cjs/rules/requireDescription.js +136 -0
- package/dist/cjs/rules/requireDescriptionCompleteSentence.d.ts +2 -0
- package/dist/cjs/rules/requireDescriptionCompleteSentence.js +258 -0
- package/dist/cjs/rules/requireExample.d.ts +2 -0
- package/dist/cjs/rules/requireExample.js +103 -0
- package/dist/cjs/rules/requireFileOverview.d.ts +2 -0
- package/dist/cjs/rules/requireFileOverview.js +117 -0
- package/dist/cjs/rules/requireHyphenBeforeParamDescription.d.ts +2 -0
- package/dist/cjs/rules/requireHyphenBeforeParamDescription.js +144 -0
- package/dist/cjs/rules/requireJsdoc.d.ts +25 -0
- package/dist/cjs/rules/requireJsdoc.js +629 -0
- package/dist/cjs/rules/requireParam.d.ts +3 -0
- package/dist/cjs/rules/requireParam.js +480 -0
- package/dist/cjs/rules/requireParamDescription.d.ts +2 -0
- package/dist/cjs/rules/requireParamDescription.js +77 -0
- package/dist/cjs/rules/requireParamName.d.ts +2 -0
- package/dist/cjs/rules/requireParamName.js +52 -0
- package/dist/cjs/rules/requireParamType.d.ts +2 -0
- package/dist/cjs/rules/requireParamType.js +77 -0
- package/dist/cjs/rules/requireProperty.d.ts +2 -0
- package/dist/cjs/rules/requireProperty.js +44 -0
- package/dist/cjs/rules/requirePropertyDescription.d.ts +2 -0
- package/dist/cjs/rules/requirePropertyDescription.js +22 -0
- package/dist/cjs/rules/requirePropertyName.d.ts +2 -0
- package/dist/cjs/rules/requirePropertyName.js +22 -0
- package/dist/cjs/rules/requirePropertyType.d.ts +2 -0
- package/dist/cjs/rules/requirePropertyType.js +22 -0
- package/dist/cjs/rules/requireReturns.d.ts +2 -0
- package/dist/cjs/rules/requireReturns.js +197 -0
- package/dist/cjs/rules/requireReturnsCheck.d.ts +2 -0
- package/dist/cjs/rules/requireReturnsCheck.js +108 -0
- package/dist/cjs/rules/requireReturnsDescription.d.ts +2 -0
- package/dist/cjs/rules/requireReturnsDescription.js +58 -0
- package/dist/cjs/rules/requireReturnsType.d.ts +2 -0
- package/dist/cjs/rules/requireReturnsType.js +52 -0
- package/dist/cjs/rules/requireTemplate.d.ts +2 -0
- package/dist/cjs/rules/requireTemplate.js +173 -0
- package/dist/cjs/rules/requireThrows.d.ts +2 -0
- package/dist/cjs/rules/requireThrows.js +101 -0
- package/dist/cjs/rules/requireYields.d.ts +2 -0
- package/dist/cjs/rules/requireYields.js +172 -0
- package/dist/cjs/rules/requireYieldsCheck.d.ts +2 -0
- package/dist/cjs/rules/requireYieldsCheck.js +164 -0
- package/dist/cjs/rules/sortTags.d.ts +2 -0
- package/dist/cjs/rules/sortTags.js +392 -0
- package/dist/cjs/rules/tagLines.d.ts +2 -0
- package/dist/cjs/rules/tagLines.js +259 -0
- package/dist/cjs/rules/textEscaping.d.ts +2 -0
- package/dist/cjs/rules/textEscaping.js +125 -0
- package/dist/cjs/rules/typeFormatting.d.ts +2 -0
- package/dist/cjs/rules/typeFormatting.js +328 -0
- package/dist/cjs/rules/validTypes.d.ts +2 -0
- package/dist/cjs/rules/validTypes.js +333 -0
- package/dist/cjs/tagNames.d.ts +15 -0
- package/dist/cjs/tagNames.js +209 -0
- package/dist/cjs/utils/hasReturnValue.d.ts +19 -0
- package/dist/cjs/utils/hasReturnValue.js +469 -0
- package/dist/getJsdocProcessorPlugin.cts +3 -0
- package/dist/index.cjs.cts +3 -0
- package/dist/iterateJsdoc.cts +6 -0
- package/package.json +21 -10
- package/src/getJsdocProcessorPlugin.cts +3 -0
- package/src/index.cjs.cts +3 -0
- package/src/iterateJsdoc.cts +6 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
export type Integer = number;
|
|
2
|
+
export type ESTreeOrTypeScriptNode = import("./utils/hasReturnValue.js").ESTreeOrTypeScriptNode;
|
|
3
|
+
export type ParserMode = "jsdoc" | "typescript" | "closure" | "permissive";
|
|
4
|
+
export type ParamCommon = undefined | string | {
|
|
5
|
+
name: Integer;
|
|
6
|
+
restElement: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
isRestProperty: boolean | undefined;
|
|
9
|
+
name: string;
|
|
10
|
+
restElement: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
name: string;
|
|
13
|
+
restElement: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type ParamNameInfo = ParamCommon | [string | undefined, (FlattendRootInfo & {
|
|
16
|
+
annotationParamName?: string;
|
|
17
|
+
})] | NestedParamInfo;
|
|
18
|
+
export type FlattendRootInfo = {
|
|
19
|
+
hasPropertyRest: boolean;
|
|
20
|
+
hasRestElement: boolean;
|
|
21
|
+
names: string[];
|
|
22
|
+
rests: boolean[];
|
|
23
|
+
};
|
|
24
|
+
export type NestedParamInfo = [string, (string[] | ParamInfo[])];
|
|
25
|
+
export type ParamInfo = ParamCommon | [string | undefined, (FlattendRootInfo & {
|
|
26
|
+
annotationParamName?: string;
|
|
27
|
+
})] | NestedParamInfo;
|
|
28
|
+
/**
|
|
29
|
+
* Given a nested array of property names, reduce them to a single array,
|
|
30
|
+
* appending the name of the root element along the way if present.
|
|
31
|
+
*/
|
|
32
|
+
export type FlattenRoots = (params: ParamInfo[], root?: string | undefined) => FlattendRootInfo;
|
|
33
|
+
export type Reporter = {
|
|
34
|
+
report: (descriptor: import("eslint").Rule.ReportDescriptor) => void;
|
|
35
|
+
};
|
|
36
|
+
export type DefaultContexts = true | string[];
|
|
37
|
+
export type TagNamePreference = {
|
|
38
|
+
[key: string]: false | string | {
|
|
39
|
+
message: string;
|
|
40
|
+
replacement?: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type PathDoesNotBeginWith = (name: string, otherPathName: string) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @param {string} name
|
|
46
|
+
* @returns {(otherPathName: string) => boolean}
|
|
47
|
+
*/
|
|
48
|
+
export function comparePaths(name: string): (otherPathName: string) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Since path segments may be unquoted (if matching a reserved word,
|
|
51
|
+
* identifier or numeric literal) or single or double quoted, in either
|
|
52
|
+
* the `@param` or in source, we need to strip the quotes to give a fair
|
|
53
|
+
* comparison.
|
|
54
|
+
* @param {string} str
|
|
55
|
+
* @returns {string}
|
|
56
|
+
*/
|
|
57
|
+
export function dropPathSegmentQuotes(str: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* @typedef {true|string[]} DefaultContexts
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Checks user option for `contexts` array, defaulting to
|
|
63
|
+
* contexts designated by the rule. Returns an array of
|
|
64
|
+
* ESTree AST types, indicating allowable contexts.
|
|
65
|
+
* @param {import('eslint').Rule.RuleContext} context
|
|
66
|
+
* @param {DefaultContexts|undefined} defaultContexts
|
|
67
|
+
* @param {{
|
|
68
|
+
* contexts?: import('./iterateJsdoc.js').Context[]
|
|
69
|
+
* }} settings
|
|
70
|
+
* @returns {(string|import('./iterateJsdoc.js').ContextObject)[]}
|
|
71
|
+
*/
|
|
72
|
+
export function enforcedContexts(context: import("eslint").Rule.RuleContext, defaultContexts: DefaultContexts | undefined, settings: {
|
|
73
|
+
contexts?: import("./iterateJsdoc.js").Context[];
|
|
74
|
+
}): (string | import("./iterateJsdoc.js").ContextObject)[];
|
|
75
|
+
/**
|
|
76
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
77
|
+
* @param {import('eslint').Rule.Node|null} node
|
|
78
|
+
* @param {import('eslint').Rule.RuleContext} context
|
|
79
|
+
* @param {import('json-schema').JSONSchema4} schema
|
|
80
|
+
* @returns {boolean}
|
|
81
|
+
*/
|
|
82
|
+
export function exemptSpeciaMethods(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, node: import("eslint").Rule.Node | null, context: import("eslint").Rule.RuleContext, schema: import("json-schema").JSONSchema4): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
85
|
+
* @param {(tag: import('@es-joy/jsdoccomment').JsdocTagWithInline) => boolean} filter
|
|
86
|
+
* @returns {import('@es-joy/jsdoccomment').JsdocTagWithInline[]}
|
|
87
|
+
*/
|
|
88
|
+
export function filterTags(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, filter: (tag: import("@es-joy/jsdoccomment").JsdocTagWithInline) => boolean): import("@es-joy/jsdoccomment").JsdocTagWithInline[];
|
|
89
|
+
/**
|
|
90
|
+
* @typedef {undefined|string|{
|
|
91
|
+
* name: Integer,
|
|
92
|
+
* restElement: boolean
|
|
93
|
+
* }|{
|
|
94
|
+
* isRestProperty: boolean|undefined,
|
|
95
|
+
* name: string,
|
|
96
|
+
* restElement: boolean
|
|
97
|
+
* }|{
|
|
98
|
+
* name: string,
|
|
99
|
+
* restElement: boolean
|
|
100
|
+
* }} ParamCommon
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* @typedef {ParamCommon|[string|undefined, (FlattendRootInfo & {
|
|
104
|
+
* annotationParamName?: string,
|
|
105
|
+
* })]|NestedParamInfo} ParamNameInfo
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* @typedef {{
|
|
109
|
+
* hasPropertyRest: boolean,
|
|
110
|
+
* hasRestElement: boolean,
|
|
111
|
+
* names: string[],
|
|
112
|
+
* rests: boolean[],
|
|
113
|
+
* }} FlattendRootInfo
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* @typedef {[string, (string[]|ParamInfo[])]} NestedParamInfo
|
|
117
|
+
*/
|
|
118
|
+
/**
|
|
119
|
+
* @typedef {ParamCommon|
|
|
120
|
+
* [string|undefined, (FlattendRootInfo & {
|
|
121
|
+
* annotationParamName?: string
|
|
122
|
+
* })]|
|
|
123
|
+
* NestedParamInfo} ParamInfo
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
* Given a nested array of property names, reduce them to a single array,
|
|
127
|
+
* appending the name of the root element along the way if present.
|
|
128
|
+
* @callback FlattenRoots
|
|
129
|
+
* @param {ParamInfo[]} params
|
|
130
|
+
* @param {string} [root]
|
|
131
|
+
* @returns {FlattendRootInfo}
|
|
132
|
+
*/
|
|
133
|
+
/** @type {FlattenRoots} */
|
|
134
|
+
export const flattenRoots: FlattenRoots;
|
|
135
|
+
/**
|
|
136
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
137
|
+
* @param {string} tagName
|
|
138
|
+
* @param {(
|
|
139
|
+
* matchingJsdocTag: import('@es-joy/jsdoccomment').JsdocTagWithInline,
|
|
140
|
+
* targetTagName: string
|
|
141
|
+
* ) => void} arrayHandler
|
|
142
|
+
* @param {object} cfg
|
|
143
|
+
* @param {import('eslint').Rule.RuleContext} [cfg.context]
|
|
144
|
+
* @param {ParserMode} [cfg.mode]
|
|
145
|
+
* @param {import('./iterateJsdoc.js').Report} [cfg.report]
|
|
146
|
+
* @param {TagNamePreference} [cfg.tagNamePreference]
|
|
147
|
+
* @param {boolean} [cfg.skipReportingBlockedTag]
|
|
148
|
+
* @returns {void}
|
|
149
|
+
*/
|
|
150
|
+
export function forEachPreferredTag(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, tagName: string, arrayHandler: (matchingJsdocTag: import("@es-joy/jsdoccomment").JsdocTagWithInline, targetTagName: string) => void, { context, mode, report, skipReportingBlockedTag, tagNamePreference, }?: {
|
|
151
|
+
context?: import("eslint").Rule.RuleContext | undefined;
|
|
152
|
+
mode?: ParserMode | undefined;
|
|
153
|
+
report?: import("./iterateJsdoc.js").Report | undefined;
|
|
154
|
+
tagNamePreference?: TagNamePreference | undefined;
|
|
155
|
+
skipReportingBlockedTag?: boolean | undefined;
|
|
156
|
+
}): void;
|
|
157
|
+
/**
|
|
158
|
+
* Get all tags, inline tags and inline tags in tags
|
|
159
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
160
|
+
* @returns {(import('comment-parser').Spec|
|
|
161
|
+
* import('@es-joy/jsdoccomment').JsdocInlineTagNoType)[]}
|
|
162
|
+
*/
|
|
163
|
+
export function getAllTags(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline): (import("comment-parser").Spec | import("@es-joy/jsdoccomment").JsdocInlineTagNoType)[];
|
|
164
|
+
/**
|
|
165
|
+
* @param {import('./iterateJsdoc.js').Context[]} contexts
|
|
166
|
+
* @param {import('./iterateJsdoc.js').CheckJsdoc} checkJsdoc
|
|
167
|
+
* @param {import('@es-joy/jsdoccomment').CommentHandler} [handler]
|
|
168
|
+
* @returns {import('eslint').Rule.RuleListener}
|
|
169
|
+
*/
|
|
170
|
+
export function getContextObject(contexts: import("./iterateJsdoc.js").Context[], checkJsdoc: import("./iterateJsdoc.js").CheckJsdoc, handler?: import("@es-joy/jsdoccomment").CommentHandler): import("eslint").Rule.RuleListener;
|
|
171
|
+
/**
|
|
172
|
+
* @param {ESTreeOrTypeScriptNode|null} functionNode
|
|
173
|
+
* @param {boolean} [checkDefaultObjects]
|
|
174
|
+
* @throws {Error}
|
|
175
|
+
* @returns {ParamNameInfo[]}
|
|
176
|
+
*/
|
|
177
|
+
export function getFunctionParameterNames(functionNode: ESTreeOrTypeScriptNode | null, checkDefaultObjects?: boolean): ParamNameInfo[];
|
|
178
|
+
/**
|
|
179
|
+
* @param {import('eslint').SourceCode|{
|
|
180
|
+
* text: string
|
|
181
|
+
* }} sourceCode
|
|
182
|
+
* @returns {string}
|
|
183
|
+
*/
|
|
184
|
+
export function getIndent(sourceCode: import("eslint").SourceCode | {
|
|
185
|
+
text: string;
|
|
186
|
+
}): string;
|
|
187
|
+
/**
|
|
188
|
+
* Gets all names of the target type, including those that refer to a path, e.g.
|
|
189
|
+
* `foo` or `foo.bar`.
|
|
190
|
+
* @param {import('comment-parser').Block} jsdoc
|
|
191
|
+
* @param {string} targetTagName
|
|
192
|
+
* @returns {{
|
|
193
|
+
* idx: Integer,
|
|
194
|
+
* name: string,
|
|
195
|
+
* type: string
|
|
196
|
+
* }[]}
|
|
197
|
+
*/
|
|
198
|
+
export function getJsdocTagsDeep(jsdoc: import("comment-parser").Block, targetTagName: string): {
|
|
199
|
+
idx: Integer;
|
|
200
|
+
name: string;
|
|
201
|
+
type: string;
|
|
202
|
+
}[];
|
|
203
|
+
/**
|
|
204
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
205
|
+
* @param {{
|
|
206
|
+
* tagName: string,
|
|
207
|
+
* context?: import('eslint').Rule.RuleContext,
|
|
208
|
+
* mode?: ParserMode,
|
|
209
|
+
* report?: import('./iterateJsdoc.js').Report
|
|
210
|
+
* tagNamePreference?: TagNamePreference
|
|
211
|
+
* skipReportingBlockedTag?: boolean,
|
|
212
|
+
* allowObjectReturn?: boolean,
|
|
213
|
+
* defaultMessage?: string,
|
|
214
|
+
* }} cfg
|
|
215
|
+
* @returns {string|undefined|false|{
|
|
216
|
+
* message: string;
|
|
217
|
+
* replacement?: string|undefined;
|
|
218
|
+
* }|{
|
|
219
|
+
* blocked: true,
|
|
220
|
+
* tagName: string
|
|
221
|
+
* }}
|
|
222
|
+
*/
|
|
223
|
+
export function getPreferredTagName(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, { allowObjectReturn, context, tagName, defaultMessage, mode, report, skipReportingBlockedTag, tagNamePreference, }: {
|
|
224
|
+
tagName: string;
|
|
225
|
+
context?: import("eslint").Rule.RuleContext;
|
|
226
|
+
mode?: ParserMode;
|
|
227
|
+
report?: import("./iterateJsdoc.js").Report;
|
|
228
|
+
tagNamePreference?: TagNamePreference;
|
|
229
|
+
skipReportingBlockedTag?: boolean;
|
|
230
|
+
allowObjectReturn?: boolean;
|
|
231
|
+
defaultMessage?: string;
|
|
232
|
+
}): string | undefined | false | {
|
|
233
|
+
message: string;
|
|
234
|
+
replacement?: string | undefined;
|
|
235
|
+
} | {
|
|
236
|
+
blocked: true;
|
|
237
|
+
tagName: string;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* @typedef {{
|
|
241
|
+
* report: (descriptor: import('eslint').Rule.ReportDescriptor) => void
|
|
242
|
+
* }} Reporter
|
|
243
|
+
*/
|
|
244
|
+
/**
|
|
245
|
+
* @param {string} name
|
|
246
|
+
* @param {ParserMode|undefined} mode
|
|
247
|
+
* @param {TagNamePreference} tagPreference
|
|
248
|
+
* @param {Reporter} context
|
|
249
|
+
* @returns {string|false|{
|
|
250
|
+
* message: string;
|
|
251
|
+
* replacement?: string|undefined;
|
|
252
|
+
* }}
|
|
253
|
+
*/
|
|
254
|
+
export function getPreferredTagNameSimple(name: string, mode: ParserMode | undefined, tagPreference?: TagNamePreference, context?: Reporter): string | false | {
|
|
255
|
+
message: string;
|
|
256
|
+
replacement?: string | undefined;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* @param {string} regexString
|
|
260
|
+
* @param {string} [requiredFlags]
|
|
261
|
+
* @returns {RegExp}
|
|
262
|
+
*/
|
|
263
|
+
export function getRegexFromString(regexString: string, requiredFlags?: string): RegExp;
|
|
264
|
+
/**
|
|
265
|
+
* @param {import('comment-parser').Spec} tg
|
|
266
|
+
* @param {boolean} [returnArray]
|
|
267
|
+
* @returns {string[]|string}
|
|
268
|
+
*/
|
|
269
|
+
export function getTagDescription(tg: import("comment-parser").Spec, returnArray?: boolean): string[] | string;
|
|
270
|
+
/**
|
|
271
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
272
|
+
* @param {string} tagName
|
|
273
|
+
* @returns {import('comment-parser').Spec[]}
|
|
274
|
+
*/
|
|
275
|
+
export function getTags(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, tagName: string): import("comment-parser").Spec[];
|
|
276
|
+
/**
|
|
277
|
+
* @typedef {{
|
|
278
|
+
* [key: string]: false|string|
|
|
279
|
+
* {message: string, replacement?: string}
|
|
280
|
+
* }} TagNamePreference
|
|
281
|
+
*/
|
|
282
|
+
/**
|
|
283
|
+
* @param {import('eslint').Rule.RuleContext} context
|
|
284
|
+
* @param {ParserMode|undefined} mode
|
|
285
|
+
* @param {import('comment-parser').Spec[]} tags
|
|
286
|
+
* @returns {{
|
|
287
|
+
* tagsWithNames: import('comment-parser').Spec[],
|
|
288
|
+
* tagsWithoutNames: import('comment-parser').Spec[]
|
|
289
|
+
* }}
|
|
290
|
+
*/
|
|
291
|
+
export function getTagsByType(context: import("eslint").Rule.RuleContext, mode: ParserMode | undefined, tags: import("comment-parser").Spec[]): {
|
|
292
|
+
tagsWithNames: import("comment-parser").Spec[];
|
|
293
|
+
tagsWithoutNames: import("comment-parser").Spec[];
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* @param {ParserMode} mode
|
|
297
|
+
* @param {import('./iterateJsdoc.js').StructuredTags} structuredTags
|
|
298
|
+
* @returns {import('./getDefaultTagStructureForMode.js').TagStructure}
|
|
299
|
+
*/
|
|
300
|
+
export function getTagStructureForMode(mode: ParserMode, structuredTags: import("./iterateJsdoc.js").StructuredTags): import("./getDefaultTagStructureForMode.js").TagStructure;
|
|
301
|
+
/**
|
|
302
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
303
|
+
* @param {string[]} targetTagNames
|
|
304
|
+
* @returns {boolean}
|
|
305
|
+
*/
|
|
306
|
+
export function hasATag(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, targetTagNames: string[]): boolean;
|
|
307
|
+
/**
|
|
308
|
+
* @param {ESTreeOrTypeScriptNode} functionNode
|
|
309
|
+
* @returns {Integer}
|
|
310
|
+
*/
|
|
311
|
+
export function hasParams(functionNode: ESTreeOrTypeScriptNode): Integer;
|
|
312
|
+
/**
|
|
313
|
+
* @param {import('./iterateJsdoc.js').JsdocBlockWithInline} jsdoc
|
|
314
|
+
* @param {string} targetTagName
|
|
315
|
+
* @returns {boolean}
|
|
316
|
+
*/
|
|
317
|
+
export function hasTag(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInline, targetTagName: string): boolean;
|
|
318
|
+
/**
|
|
319
|
+
* Checks if a node has a throws statement.
|
|
320
|
+
* @param {ESTreeOrTypeScriptNode|null|undefined} node
|
|
321
|
+
* @param {boolean} [innerFunction]
|
|
322
|
+
* @returns {boolean}
|
|
323
|
+
*/
|
|
324
|
+
export function hasThrowValue(node: ESTreeOrTypeScriptNode | null | undefined, innerFunction?: boolean): boolean;
|
|
325
|
+
/**
|
|
326
|
+
* Checks if a node has a return statement. Void return does not count.
|
|
327
|
+
* @param {ESTreeOrTypeScriptNode} node
|
|
328
|
+
* @param {boolean} [checkYieldReturnValue]
|
|
329
|
+
* @returns {boolean}
|
|
330
|
+
*/
|
|
331
|
+
export function hasYieldValue(node: ESTreeOrTypeScriptNode, checkYieldReturnValue?: boolean): boolean;
|
|
332
|
+
/**
|
|
333
|
+
* @param {import('eslint').Rule.Node|null} node
|
|
334
|
+
* @returns {boolean}
|
|
335
|
+
*/
|
|
336
|
+
export function isConstructor(node: import("eslint").Rule.Node | null): boolean;
|
|
337
|
+
/**
|
|
338
|
+
* @param {import('eslint').Rule.Node|null} node
|
|
339
|
+
* @returns {boolean}
|
|
340
|
+
*/
|
|
341
|
+
export function isGetter(node: import("eslint").Rule.Node | null): boolean;
|
|
342
|
+
/**
|
|
343
|
+
* @param {string} tag
|
|
344
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
345
|
+
* @returns {boolean}
|
|
346
|
+
*/
|
|
347
|
+
export function isNamepathDefiningTag(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* @param {string} tag
|
|
350
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
351
|
+
* @returns {boolean}
|
|
352
|
+
*/
|
|
353
|
+
export function isNamepathOrUrlReferencingTag(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean;
|
|
354
|
+
/**
|
|
355
|
+
* @param {string} tag
|
|
356
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
357
|
+
* @returns {boolean}
|
|
358
|
+
*/
|
|
359
|
+
export function isNamepathReferencingTag(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean;
|
|
360
|
+
/**
|
|
361
|
+
* @param {import('eslint').Rule.Node|null} node
|
|
362
|
+
* @returns {boolean}
|
|
363
|
+
*/
|
|
364
|
+
export function isSetter(node: import("eslint").Rule.Node | null): boolean;
|
|
365
|
+
/**
|
|
366
|
+
* @param {import('eslint').Rule.RuleContext} context
|
|
367
|
+
* @param {ParserMode|undefined} mode
|
|
368
|
+
* @param {string} name
|
|
369
|
+
* @param {string[]} definedTags
|
|
370
|
+
* @returns {boolean}
|
|
371
|
+
*/
|
|
372
|
+
export function isValidTag(context: import("eslint").Rule.RuleContext, mode: ParserMode | undefined, name: string, definedTags: string[]): boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Checks if the JSDoc comment has an undefined type.
|
|
375
|
+
* @param {import('comment-parser').Spec|null|undefined} tag
|
|
376
|
+
* the tag which should be checked.
|
|
377
|
+
* @param {ParserMode} mode
|
|
378
|
+
* @returns {boolean}
|
|
379
|
+
* true in case a defined type is undeclared; otherwise false.
|
|
380
|
+
*/
|
|
381
|
+
export function mayBeUndefinedTypeTag(tag: import("comment-parser").Spec | null | undefined, mode: ParserMode): boolean;
|
|
382
|
+
/**
|
|
383
|
+
* @param {import('./iterateJsdoc.js').StructuredTags} structuredTags
|
|
384
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
385
|
+
* @returns {void}
|
|
386
|
+
*/
|
|
387
|
+
export function overrideTagStructure(structuredTags: import("./iterateJsdoc.js").StructuredTags, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): void;
|
|
388
|
+
/**
|
|
389
|
+
* @param {string} tag
|
|
390
|
+
*/
|
|
391
|
+
/**
|
|
392
|
+
* Parses GCC Generic/Template types
|
|
393
|
+
* @see {@link https://github.com/google/closure-compiler/wiki/Generic-Types}
|
|
394
|
+
* @see {@link https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#template}
|
|
395
|
+
* @param {import('comment-parser').Spec} tag
|
|
396
|
+
* @returns {string[]}
|
|
397
|
+
*/
|
|
398
|
+
export function parseClosureTemplateTag(tag: import("comment-parser").Spec): string[];
|
|
399
|
+
/**
|
|
400
|
+
* @callback PathDoesNotBeginWith
|
|
401
|
+
* @param {string} name
|
|
402
|
+
* @param {string} otherPathName
|
|
403
|
+
* @returns {boolean}
|
|
404
|
+
*/
|
|
405
|
+
/** @type {PathDoesNotBeginWith} */
|
|
406
|
+
export const pathDoesNotBeginWith: PathDoesNotBeginWith;
|
|
407
|
+
/**
|
|
408
|
+
* @param {ParserMode} mode
|
|
409
|
+
* @returns {void}
|
|
410
|
+
*/
|
|
411
|
+
export function setTagStructure(mode: ParserMode): void;
|
|
412
|
+
/**
|
|
413
|
+
* @param {string} tag
|
|
414
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
415
|
+
* @returns {boolean}
|
|
416
|
+
*/
|
|
417
|
+
export function tagMightHaveEitherTypeOrNamePosition(tag: string, tagMap: import("./getDefaultTagStructureForMode.js").TagStructure): boolean;
|
|
418
|
+
/**
|
|
419
|
+
* @param {string} tag
|
|
420
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
421
|
+
* @returns {boolean}
|
|
422
|
+
*/
|
|
423
|
+
export function tagMightHaveNamepath(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean;
|
|
424
|
+
/**
|
|
425
|
+
* @param {string} tag
|
|
426
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
427
|
+
* @returns {boolean}
|
|
428
|
+
*/
|
|
429
|
+
export function tagMightHaveNamePosition(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean;
|
|
430
|
+
/**
|
|
431
|
+
* @param {string} tag
|
|
432
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
433
|
+
* @returns {boolean|string}
|
|
434
|
+
*/
|
|
435
|
+
export function tagMightHaveTypePosition(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean | string;
|
|
436
|
+
/**
|
|
437
|
+
* @param {import('comment-parser').Spec} tag
|
|
438
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
439
|
+
* @returns {boolean|undefined}
|
|
440
|
+
*/
|
|
441
|
+
export function tagMissingRequiredTypeOrNamepath(tag: import("comment-parser").Spec, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* @param {string} tag
|
|
444
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
445
|
+
* @returns {boolean|undefined}
|
|
446
|
+
*/
|
|
447
|
+
export function tagMustHaveNamePosition(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean | undefined;
|
|
448
|
+
/**
|
|
449
|
+
* @param {string} tag
|
|
450
|
+
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
451
|
+
* @returns {boolean|undefined}
|
|
452
|
+
*/
|
|
453
|
+
export function tagMustHaveTypePosition(tag: string, tagMap?: import("./getDefaultTagStructureForMode.js").TagStructure): boolean | undefined;
|
|
454
|
+
export { hasReturnValue, hasValueOrExecutorHasNonEmptyResolveValue } from "./utils/hasReturnValue.js";
|