eslint-plugin-jsdoc 55.3.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/dist/rules/typeFormatting.cjs +82 -38
- package/dist/rules/typeFormatting.cjs.map +1 -1
- package/dist/rules.d.ts +4 -7
- package/package.json +24 -13
- package/src/getJsdocProcessorPlugin.cts +3 -0
- package/src/index.cjs.cts +3 -0
- package/src/iterateJsdoc.cts +6 -0
- package/src/rules/typeFormatting.js +104 -40
- package/src/rules.d.ts +4 -7
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {JsdocVisitor} iterator
|
|
3
|
+
* @param {RuleConfig} ruleConfig
|
|
4
|
+
* @returns {import('eslint').Rule.RuleModule}
|
|
5
|
+
*/
|
|
6
|
+
export default function iterateJsdoc(iterator: JsdocVisitor, ruleConfig: RuleConfig): import("eslint").Rule.RuleModule;
|
|
7
|
+
export { parseComment } from "@es-joy/jsdoccomment";
|
|
8
|
+
export type Integer = number;
|
|
9
|
+
export type JsdocBlockWithInline = import("@es-joy/jsdoccomment").JsdocBlockWithInline;
|
|
10
|
+
export type ContextObject = {
|
|
11
|
+
disallowName?: string;
|
|
12
|
+
allowName?: string;
|
|
13
|
+
context?: string;
|
|
14
|
+
comment?: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
replacement?: string;
|
|
17
|
+
minimum?: Integer;
|
|
18
|
+
message?: string;
|
|
19
|
+
forceRequireReturn?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type Context = string | ContextObject;
|
|
22
|
+
export type CheckJsdoc = (info: {
|
|
23
|
+
lastIndex?: Integer;
|
|
24
|
+
isFunctionContext?: boolean;
|
|
25
|
+
selector?: string;
|
|
26
|
+
comment?: string;
|
|
27
|
+
}, handler: null | ((jsdoc: import("@es-joy/jsdoccomment").JsdocBlockWithInline) => boolean | undefined), node: import("eslint").Rule.Node) => void;
|
|
28
|
+
export type ForEachPreferredTag = (tagName: string, arrayHandler: (matchingJsdocTag: import("@es-joy/jsdoccomment").JsdocTagWithInline, targetTagName: string) => void, skipReportingBlockedTag?: boolean | undefined) => void;
|
|
29
|
+
export type ReportSettings = (message: string) => void;
|
|
30
|
+
export type ParseClosureTemplateTag = (tag: import("comment-parser").Spec) => string[];
|
|
31
|
+
export type GetPreferredTagNameObject = (cfg: {
|
|
32
|
+
tagName: string;
|
|
33
|
+
}) => string | false | {
|
|
34
|
+
message: string;
|
|
35
|
+
replacement?: string | undefined;
|
|
36
|
+
} | {
|
|
37
|
+
blocked: true;
|
|
38
|
+
tagName: string;
|
|
39
|
+
};
|
|
40
|
+
export type BasicUtils = {
|
|
41
|
+
forEachPreferredTag: ForEachPreferredTag;
|
|
42
|
+
reportSettings: ReportSettings;
|
|
43
|
+
parseClosureTemplateTag: ParseClosureTemplateTag;
|
|
44
|
+
getPreferredTagNameObject: GetPreferredTagNameObject;
|
|
45
|
+
pathDoesNotBeginWith: import("./jsdocUtils.js").PathDoesNotBeginWith;
|
|
46
|
+
};
|
|
47
|
+
export type IsIteratingFunction = () => boolean;
|
|
48
|
+
export type IsVirtualFunction = () => boolean;
|
|
49
|
+
export type Stringify = (tagBlock: import("comment-parser").Block, specRewire?: boolean | undefined) => string;
|
|
50
|
+
export type ReportJSDoc = (msg: string, tag?: import("comment-parser").Spec | {
|
|
51
|
+
line: Integer;
|
|
52
|
+
column?: Integer;
|
|
53
|
+
} | null | undefined, handler?: (() => void) | null | undefined, specRewire?: boolean | undefined, data?: undefined | {
|
|
54
|
+
[key: string]: string;
|
|
55
|
+
}) => any;
|
|
56
|
+
export type GetRegexFromString = (str: string, requiredFlags?: string | undefined) => RegExp;
|
|
57
|
+
export type GetTagDescription = (tg: import("comment-parser").Spec, returnArray?: boolean | undefined) => string[] | string;
|
|
58
|
+
export type SetTagDescription = (tg: import("comment-parser").Spec, matcher: RegExp, setter: (description: string) => string) => Integer;
|
|
59
|
+
export type GetDescription = () => {
|
|
60
|
+
description: string;
|
|
61
|
+
descriptions: string[];
|
|
62
|
+
lastDescriptionLine: Integer;
|
|
63
|
+
};
|
|
64
|
+
export type SetBlockDescription = (setter: (info: {
|
|
65
|
+
delimiter: string;
|
|
66
|
+
postDelimiter: string;
|
|
67
|
+
start: string;
|
|
68
|
+
}, seedTokens: (tokens?: Partial<import("comment-parser").Tokens>) => import("comment-parser").Tokens, descLines: string[]) => import("comment-parser").Line[]) => void;
|
|
69
|
+
export type SetDescriptionLines = (matcher: RegExp, setter: (description: string) => string) => Integer;
|
|
70
|
+
export type ChangeTag = (tag: import("comment-parser").Spec, ...tokens: Partial<import("comment-parser").Tokens>[]) => void;
|
|
71
|
+
export type SetTag = (tag: import("comment-parser").Spec & {
|
|
72
|
+
line: Integer;
|
|
73
|
+
}, tokens?: Partial<import("comment-parser").Tokens> | undefined) => void;
|
|
74
|
+
export type RemoveTag = (tagIndex: Integer, cfg?: {
|
|
75
|
+
removeEmptyBlock?: boolean;
|
|
76
|
+
tagSourceOffset?: Integer;
|
|
77
|
+
} | undefined) => void;
|
|
78
|
+
export type AddTag = (targetTagName: string, number?: number | undefined, tokens?: {} | import("comment-parser").Tokens | undefined) => void;
|
|
79
|
+
export type GetFirstLine = () => Integer | undefined;
|
|
80
|
+
export type SeedTokens = (tokens?: Partial<import("comment-parser").Tokens> | undefined) => import("comment-parser").Tokens;
|
|
81
|
+
/**
|
|
82
|
+
* Sets tokens to empty string.
|
|
83
|
+
*/
|
|
84
|
+
export type EmptyTokens = (tokens: import("comment-parser").Tokens) => void;
|
|
85
|
+
export type AddLine = (sourceIndex: Integer, tokens: Partial<import("comment-parser").Tokens>) => void;
|
|
86
|
+
export type AddLines = (tagIndex: Integer, tagSourceOffset: Integer, numLines: Integer) => void;
|
|
87
|
+
export type MakeMultiline = () => void;
|
|
88
|
+
export type GetFunctionParameterNames = (useDefaultObjectProperties?: boolean | undefined) => import("./jsdocUtils.js").ParamNameInfo[];
|
|
89
|
+
export type HasParams = () => Integer;
|
|
90
|
+
export type IsGenerator = () => boolean;
|
|
91
|
+
export type IsConstructor = () => boolean;
|
|
92
|
+
export type GetJsdocTagsDeep = (tagName: string) => false | {
|
|
93
|
+
idx: Integer;
|
|
94
|
+
name: string;
|
|
95
|
+
type: string;
|
|
96
|
+
}[];
|
|
97
|
+
export type GetPreferredTagName = (cfg: {
|
|
98
|
+
tagName: string;
|
|
99
|
+
skipReportingBlockedTag?: boolean;
|
|
100
|
+
allowObjectReturn?: boolean;
|
|
101
|
+
defaultMessage?: string;
|
|
102
|
+
}) => string | undefined | false | {
|
|
103
|
+
message: string;
|
|
104
|
+
replacement?: string | undefined;
|
|
105
|
+
} | {
|
|
106
|
+
blocked: true;
|
|
107
|
+
tagName: string;
|
|
108
|
+
};
|
|
109
|
+
export type IsValidTag = (name: string, definedTags: string[]) => boolean;
|
|
110
|
+
export type HasATag = (names: string[]) => boolean;
|
|
111
|
+
export type HasTag = (name: string) => boolean;
|
|
112
|
+
export type ComparePaths = (name: string) => (otherPathName: string) => boolean;
|
|
113
|
+
export type DropPathSegmentQuotes = (name: string) => string;
|
|
114
|
+
export type AvoidDocs = () => boolean;
|
|
115
|
+
export type TagMightHaveNamePositionTypePosition = (tagName: string, otherModeMaps?: import("./getDefaultTagStructureForMode.js").TagStructure[] | undefined) => boolean | {
|
|
116
|
+
otherMode: true;
|
|
117
|
+
};
|
|
118
|
+
export type TagMustHave = (tagName: string, otherModeMaps: import("./getDefaultTagStructureForMode.js").TagStructure[]) => boolean | {
|
|
119
|
+
otherMode: false;
|
|
120
|
+
};
|
|
121
|
+
export type TagMissingRequiredTypeOrNamepath = (tag: import("comment-parser").Spec, otherModeMaps: import("./getDefaultTagStructureForMode.js").TagStructure[]) => boolean | {
|
|
122
|
+
otherMode: false;
|
|
123
|
+
};
|
|
124
|
+
export type IsNamepathX = (tagName: string) => boolean;
|
|
125
|
+
export type GetTagStructureForMode = (mde: import("./jsdocUtils.js").ParserMode) => import("./getDefaultTagStructureForMode.js").TagStructure;
|
|
126
|
+
export type MayBeUndefinedTypeTag = (tag: import("comment-parser").Spec) => boolean;
|
|
127
|
+
export type HasValueOrExecutorHasNonEmptyResolveValue = (anyPromiseAsReturn: boolean, allBranches?: boolean | undefined) => boolean;
|
|
128
|
+
export type HasYieldValue = () => boolean;
|
|
129
|
+
export type HasYieldReturnValue = () => boolean;
|
|
130
|
+
export type HasThrowValue = () => boolean;
|
|
131
|
+
export type IsAsync = () => boolean | undefined;
|
|
132
|
+
export type GetTags = (tagName: string) => import("comment-parser").Spec[];
|
|
133
|
+
export type GetPresentTags = (tagList: string[]) => import("@es-joy/jsdoccomment").JsdocTagWithInline[];
|
|
134
|
+
export type FilterTags = (filter: (tag: import("@es-joy/jsdoccomment").JsdocTagWithInline) => boolean) => import("@es-joy/jsdoccomment").JsdocTagWithInline[];
|
|
135
|
+
export type FilterAllTags = (filter: (tag: (import("comment-parser").Spec | import("@es-joy/jsdoccomment").JsdocInlineTagNoType)) => boolean) => (import("comment-parser").Spec | import("@es-joy/jsdoccomment").JsdocInlineTagNoType)[];
|
|
136
|
+
export type GetTagsByType = (tags: import("comment-parser").Spec[]) => {
|
|
137
|
+
tagsWithNames: import("comment-parser").Spec[];
|
|
138
|
+
tagsWithoutNames: import("comment-parser").Spec[];
|
|
139
|
+
};
|
|
140
|
+
export type HasOptionTag = (tagName: string) => boolean;
|
|
141
|
+
export type GetClassNode = () => Node | null;
|
|
142
|
+
export type GetClassJsdoc = () => null | JsdocBlockWithInline;
|
|
143
|
+
export type ClassHasTag = (tagName: string) => boolean;
|
|
144
|
+
export type FindContext = (contexts: Context[], comment: string | undefined) => {
|
|
145
|
+
foundContext: Context | undefined;
|
|
146
|
+
contextStr: string;
|
|
147
|
+
};
|
|
148
|
+
export type Utils = BasicUtils & {
|
|
149
|
+
isIteratingFunction: IsIteratingFunction;
|
|
150
|
+
isIteratingFunctionOrVariable: IsIteratingFunction;
|
|
151
|
+
isVirtualFunction: IsVirtualFunction;
|
|
152
|
+
stringify: Stringify;
|
|
153
|
+
reportJSDoc: ReportJSDoc;
|
|
154
|
+
getRegexFromString: GetRegexFromString;
|
|
155
|
+
getTagDescription: GetTagDescription;
|
|
156
|
+
setTagDescription: SetTagDescription;
|
|
157
|
+
getDescription: GetDescription;
|
|
158
|
+
setBlockDescription: SetBlockDescription;
|
|
159
|
+
setDescriptionLines: SetDescriptionLines;
|
|
160
|
+
changeTag: ChangeTag;
|
|
161
|
+
setTag: SetTag;
|
|
162
|
+
removeTag: RemoveTag;
|
|
163
|
+
addTag: AddTag;
|
|
164
|
+
getFirstLine: GetFirstLine;
|
|
165
|
+
seedTokens: SeedTokens;
|
|
166
|
+
emptyTokens: EmptyTokens;
|
|
167
|
+
addLine: AddLine;
|
|
168
|
+
addLines: AddLines;
|
|
169
|
+
makeMultiline: MakeMultiline;
|
|
170
|
+
flattenRoots: import("./jsdocUtils.js").FlattenRoots;
|
|
171
|
+
getFunctionParameterNames: GetFunctionParameterNames;
|
|
172
|
+
hasParams: HasParams;
|
|
173
|
+
isGenerator: IsGenerator;
|
|
174
|
+
isConstructor: IsConstructor;
|
|
175
|
+
getJsdocTagsDeep: GetJsdocTagsDeep;
|
|
176
|
+
getPreferredTagName: GetPreferredTagName;
|
|
177
|
+
isValidTag: IsValidTag;
|
|
178
|
+
hasATag: HasATag;
|
|
179
|
+
hasTag: HasTag;
|
|
180
|
+
comparePaths: ComparePaths;
|
|
181
|
+
dropPathSegmentQuotes: DropPathSegmentQuotes;
|
|
182
|
+
avoidDocs: AvoidDocs;
|
|
183
|
+
tagMightHaveNamePosition: TagMightHaveNamePositionTypePosition;
|
|
184
|
+
tagMightHaveTypePosition: TagMightHaveNamePositionTypePosition;
|
|
185
|
+
tagMustHaveNamePosition: TagMustHave;
|
|
186
|
+
tagMustHaveTypePosition: TagMustHave;
|
|
187
|
+
tagMissingRequiredTypeOrNamepath: TagMissingRequiredTypeOrNamepath;
|
|
188
|
+
isNamepathDefiningTag: IsNamepathX;
|
|
189
|
+
isNamepathReferencingTag: IsNamepathX;
|
|
190
|
+
isNamepathOrUrlReferencingTag: IsNamepathX;
|
|
191
|
+
tagMightHaveNamepath: IsNamepathX;
|
|
192
|
+
getTagStructureForMode: GetTagStructureForMode;
|
|
193
|
+
mayBeUndefinedTypeTag: MayBeUndefinedTypeTag;
|
|
194
|
+
hasValueOrExecutorHasNonEmptyResolveValue: HasValueOrExecutorHasNonEmptyResolveValue;
|
|
195
|
+
hasYieldValue: HasYieldValue;
|
|
196
|
+
hasYieldReturnValue: HasYieldReturnValue;
|
|
197
|
+
hasThrowValue: HasThrowValue;
|
|
198
|
+
isAsync: IsAsync;
|
|
199
|
+
getTags: GetTags;
|
|
200
|
+
getPresentTags: GetPresentTags;
|
|
201
|
+
filterTags: FilterTags;
|
|
202
|
+
filterAllTags: FilterAllTags;
|
|
203
|
+
getTagsByType: GetTagsByType;
|
|
204
|
+
hasOptionTag: HasOptionTag;
|
|
205
|
+
getClassNode: GetClassNode;
|
|
206
|
+
getClassJsdoc: GetClassJsdoc;
|
|
207
|
+
classHasTag: ClassHasTag;
|
|
208
|
+
findContext: FindContext;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Should use ESLint rule's typing.
|
|
212
|
+
*/
|
|
213
|
+
export type EslintRuleMeta = import("eslint").Rule.RuleMetaData;
|
|
214
|
+
/**
|
|
215
|
+
* A plain object for tracking state as needed by rules across iterations.
|
|
216
|
+
*/
|
|
217
|
+
export type StateObject = {
|
|
218
|
+
globalTags: {};
|
|
219
|
+
hasDuplicates: {
|
|
220
|
+
[key: string]: boolean;
|
|
221
|
+
};
|
|
222
|
+
selectorMap: {
|
|
223
|
+
[selector: string]: {
|
|
224
|
+
[comment: string]: Integer;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
hasTag: {
|
|
228
|
+
[key: string]: boolean;
|
|
229
|
+
};
|
|
230
|
+
hasNonComment: number;
|
|
231
|
+
hasNonCommentBeforeTag: {
|
|
232
|
+
[key: string]: boolean | number;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* The Node AST as supplied by the parser.
|
|
237
|
+
*/
|
|
238
|
+
export type Node = import("eslint").Rule.Node;
|
|
239
|
+
export type Report = (message: string, fix?: import("eslint").Rule.ReportFixer | null | undefined, jsdocLoc?: {
|
|
240
|
+
line?: Integer;
|
|
241
|
+
column?: Integer;
|
|
242
|
+
} | (import("comment-parser").Spec & {
|
|
243
|
+
line?: Integer;
|
|
244
|
+
}) | null | undefined, data?: undefined | {
|
|
245
|
+
[key: string]: string;
|
|
246
|
+
}) => void;
|
|
247
|
+
export type PreferredTypes = {
|
|
248
|
+
[key: string]: false | string | {
|
|
249
|
+
message: string;
|
|
250
|
+
replacement?: false | string;
|
|
251
|
+
skipRootChecking?: boolean;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
export type StructuredTags = {
|
|
255
|
+
[key: string]: {
|
|
256
|
+
name?: "text" | "namepath-defining" | "namepath-referencing" | false;
|
|
257
|
+
type?: boolean | string[];
|
|
258
|
+
required?: ("name" | "type" | "typeOrNameRequired")[];
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Settings from ESLint types.
|
|
263
|
+
*/
|
|
264
|
+
export type Settings = {
|
|
265
|
+
maxLines: Integer;
|
|
266
|
+
minLines: Integer;
|
|
267
|
+
tagNamePreference: import("./jsdocUtils.js").TagNamePreference;
|
|
268
|
+
mode: import("./jsdocUtils.js").ParserMode;
|
|
269
|
+
preferredTypes: PreferredTypes;
|
|
270
|
+
structuredTags: StructuredTags;
|
|
271
|
+
[name: string]: any;
|
|
272
|
+
contexts?: Context[];
|
|
273
|
+
};
|
|
274
|
+
export type JSDocSettings = {
|
|
275
|
+
settings?: {
|
|
276
|
+
jsdoc?: {
|
|
277
|
+
ignorePrivate: boolean;
|
|
278
|
+
ignoreInternal: boolean;
|
|
279
|
+
maxLines: Integer;
|
|
280
|
+
minLines: Integer;
|
|
281
|
+
tagNamePreference: import("./jsdocUtils.js").TagNamePreference;
|
|
282
|
+
preferredTypes: PreferredTypes;
|
|
283
|
+
structuredTags: StructuredTags;
|
|
284
|
+
overrideReplacesDocs: boolean;
|
|
285
|
+
ignoreReplacesDocs: boolean;
|
|
286
|
+
implementsReplacesDocs: boolean;
|
|
287
|
+
augmentsExtendsReplacesDocs: boolean;
|
|
288
|
+
exemptDestructuredRootsFromChecks: boolean;
|
|
289
|
+
mode: import("./jsdocUtils.js").ParserMode;
|
|
290
|
+
contexts: Context[];
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Create the report function
|
|
296
|
+
*/
|
|
297
|
+
export type MakeReport = (context: import("eslint").Rule.RuleContext, commentNode: import("estree").Node) => Report;
|
|
298
|
+
export type JsdocVisitorBasic = (arg: {
|
|
299
|
+
context: import("eslint").Rule.RuleContext;
|
|
300
|
+
sourceCode: import("eslint").SourceCode;
|
|
301
|
+
indent?: string;
|
|
302
|
+
info?: {
|
|
303
|
+
comment?: string | undefined;
|
|
304
|
+
lastIndex?: Integer | undefined;
|
|
305
|
+
};
|
|
306
|
+
state?: StateObject;
|
|
307
|
+
globalState?: Map<string, Map<string, string>>;
|
|
308
|
+
jsdoc?: JsdocBlockWithInline;
|
|
309
|
+
jsdocNode?: import("eslint").Rule.Node & {
|
|
310
|
+
range: [number, number];
|
|
311
|
+
};
|
|
312
|
+
node?: Node;
|
|
313
|
+
allComments?: import("estree").Node[];
|
|
314
|
+
report?: Report;
|
|
315
|
+
makeReport?: MakeReport;
|
|
316
|
+
settings: Settings;
|
|
317
|
+
utils: BasicUtils;
|
|
318
|
+
}) => any;
|
|
319
|
+
export type JsdocVisitor = (arg: {
|
|
320
|
+
context: import("eslint").Rule.RuleContext;
|
|
321
|
+
sourceCode: import("eslint").SourceCode;
|
|
322
|
+
indent: string;
|
|
323
|
+
info: {
|
|
324
|
+
comment?: string | undefined;
|
|
325
|
+
lastIndex?: Integer | undefined;
|
|
326
|
+
};
|
|
327
|
+
state: StateObject;
|
|
328
|
+
globalState: Map<string, Map<string, string>>;
|
|
329
|
+
jsdoc: JsdocBlockWithInline;
|
|
330
|
+
jsdocNode: import("eslint").Rule.Node & {
|
|
331
|
+
range: [number, number];
|
|
332
|
+
};
|
|
333
|
+
node: Node | null;
|
|
334
|
+
allComments?: import("estree").Node[];
|
|
335
|
+
report: Report;
|
|
336
|
+
makeReport?: MakeReport;
|
|
337
|
+
settings: Settings;
|
|
338
|
+
utils: Utils;
|
|
339
|
+
}) => any;
|
|
340
|
+
export type NonCommentArgs = {
|
|
341
|
+
node: Node & {
|
|
342
|
+
range: [number, number];
|
|
343
|
+
};
|
|
344
|
+
state: StateObject;
|
|
345
|
+
};
|
|
346
|
+
export type RuleConfig = {
|
|
347
|
+
/**
|
|
348
|
+
* ESLint rule meta
|
|
349
|
+
*/
|
|
350
|
+
meta: EslintRuleMeta;
|
|
351
|
+
/**
|
|
352
|
+
* Any default contexts
|
|
353
|
+
*/
|
|
354
|
+
contextDefaults?: jsdocUtils.DefaultContexts | undefined;
|
|
355
|
+
/**
|
|
356
|
+
* Whether to force a `contexts` check
|
|
357
|
+
*/
|
|
358
|
+
contextSelected?: true | undefined;
|
|
359
|
+
/**
|
|
360
|
+
* Whether to iterate all JSDoc blocks by default
|
|
361
|
+
* regardless of context
|
|
362
|
+
*/
|
|
363
|
+
iterateAllJsdocs?: true | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* Whether to check `@private` blocks (normally exempted)
|
|
366
|
+
*/
|
|
367
|
+
checkPrivate?: true | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* Whether to check `@internal` blocks (normally exempted)
|
|
370
|
+
*/
|
|
371
|
+
checkInternal?: true | undefined;
|
|
372
|
+
/**
|
|
373
|
+
* Whether to iterates over all JSDoc blocks regardless of attachment
|
|
374
|
+
*/
|
|
375
|
+
checkFile?: true | undefined;
|
|
376
|
+
/**
|
|
377
|
+
* Whether to avoid relying on settings for global contexts
|
|
378
|
+
*/
|
|
379
|
+
nonGlobalSettings?: true | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* Whether to disable the tracking of visited comment nodes (as
|
|
382
|
+
* non-tracked may conduct further actions)
|
|
383
|
+
*/
|
|
384
|
+
noTracking?: true | undefined;
|
|
385
|
+
/**
|
|
386
|
+
* Whether the rule expects contexts to be based on a match option
|
|
387
|
+
*/
|
|
388
|
+
matchContext?: true | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* Handler to be executed upon exiting iteration of program AST
|
|
391
|
+
*/
|
|
392
|
+
exit?: ((args: {
|
|
393
|
+
context: import("eslint").Rule.RuleContext;
|
|
394
|
+
state: StateObject;
|
|
395
|
+
settings: Settings;
|
|
396
|
+
utils: BasicUtils;
|
|
397
|
+
}) => void) | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* Handler to be executed if rule wishes
|
|
400
|
+
* to be supplied nodes without comments
|
|
401
|
+
*/
|
|
402
|
+
nonComment?: ((nca: NonCommentArgs) => void) | undefined;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* @typedef {{
|
|
406
|
+
* [key: string]: false|string|{
|
|
407
|
+
* message: string,
|
|
408
|
+
* replacement?: false|string
|
|
409
|
+
* skipRootChecking?: boolean
|
|
410
|
+
* }
|
|
411
|
+
* }} PreferredTypes
|
|
412
|
+
*/
|
|
413
|
+
/**
|
|
414
|
+
* @typedef {{
|
|
415
|
+
* [key: string]: {
|
|
416
|
+
* name?: "text"|"namepath-defining"|"namepath-referencing"|false,
|
|
417
|
+
* type?: boolean|string[],
|
|
418
|
+
* required?: ("name"|"type"|"typeOrNameRequired")[]
|
|
419
|
+
* }
|
|
420
|
+
* }} StructuredTags
|
|
421
|
+
*/
|
|
422
|
+
/**
|
|
423
|
+
* Settings from ESLint types.
|
|
424
|
+
* @typedef {{
|
|
425
|
+
* maxLines: Integer,
|
|
426
|
+
* minLines: Integer,
|
|
427
|
+
* tagNamePreference: import('./jsdocUtils.js').TagNamePreference,
|
|
428
|
+
* mode: import('./jsdocUtils.js').ParserMode,
|
|
429
|
+
* preferredTypes: PreferredTypes,
|
|
430
|
+
* structuredTags: StructuredTags,
|
|
431
|
+
* [name: string]: any,
|
|
432
|
+
* contexts?: Context[]
|
|
433
|
+
* }} Settings
|
|
434
|
+
*/
|
|
435
|
+
/**
|
|
436
|
+
* @typedef {{
|
|
437
|
+
* settings?: {
|
|
438
|
+
* jsdoc?: {
|
|
439
|
+
* ignorePrivate: boolean,
|
|
440
|
+
* ignoreInternal: boolean,
|
|
441
|
+
* maxLines: Integer,
|
|
442
|
+
* minLines: Integer,
|
|
443
|
+
* tagNamePreference: import('./jsdocUtils.js').TagNamePreference,
|
|
444
|
+
* preferredTypes: PreferredTypes,
|
|
445
|
+
* structuredTags: StructuredTags,
|
|
446
|
+
* overrideReplacesDocs: boolean,
|
|
447
|
+
* ignoreReplacesDocs: boolean,
|
|
448
|
+
* implementsReplacesDocs: boolean,
|
|
449
|
+
* augmentsExtendsReplacesDocs: boolean,
|
|
450
|
+
* exemptDestructuredRootsFromChecks: boolean,
|
|
451
|
+
* mode: import('./jsdocUtils.js').ParserMode,
|
|
452
|
+
* contexts: Context[],
|
|
453
|
+
* }
|
|
454
|
+
* }
|
|
455
|
+
* }} JSDocSettings
|
|
456
|
+
*/
|
|
457
|
+
/**
|
|
458
|
+
* @param {import('eslint').Rule.RuleContext & JSDocSettings} context
|
|
459
|
+
* @returns {Settings|false}
|
|
460
|
+
*/
|
|
461
|
+
export function getSettings(context: import("eslint").Rule.RuleContext & JSDocSettings): Settings | false;
|
|
462
|
+
import * as jsdocUtils from './jsdocUtils.js';
|