eslint-plugin-jsdoc 56.0.0 → 56.0.1
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/package.json +4 -4
- package/dist/cjs/WarnSettings.js +0 -30
- package/dist/cjs/alignTransform.js +0 -285
- package/dist/cjs/defaultTagOrder.js +0 -152
- package/dist/cjs/exportParser.js +0 -754
- package/dist/cjs/getDefaultTagStructureForMode.js +0 -840
- package/dist/cjs/getJsdocProcessorPlugin.cjs +0 -4
- package/dist/cjs/getJsdocProcessorPlugin.js +0 -553
- package/dist/cjs/index-cjs.js +0 -492
- package/dist/cjs/index.cjs.cjs +0 -6
- package/dist/cjs/iterateJsdoc.cjs +0 -38
- package/dist/cjs/iterateJsdoc.js +0 -1981
- package/dist/cjs/jsdocUtils.js +0 -1470
- package/dist/cjs/rules/checkAccess.js +0 -35
- package/dist/cjs/rules/checkAlignment.js +0 -63
- package/dist/cjs/rules/checkExamples.js +0 -486
- package/dist/cjs/rules/checkIndentation.js +0 -66
- package/dist/cjs/rules/checkLineAlignment.js +0 -297
- package/dist/cjs/rules/checkParamNames.js +0 -320
- package/dist/cjs/rules/checkPropertyNames.js +0 -105
- package/dist/cjs/rules/checkSyntax.js +0 -27
- package/dist/cjs/rules/checkTagNames.js +0 -252
- package/dist/cjs/rules/checkTemplateNames.js +0 -189
- package/dist/cjs/rules/checkTypes.js +0 -421
- package/dist/cjs/rules/checkValues.js +0 -163
- package/dist/cjs/rules/convertToJsdocComments.js +0 -313
- package/dist/cjs/rules/emptyTags.js +0 -79
- package/dist/cjs/rules/implementsOnClasses.js +0 -63
- package/dist/cjs/rules/importsAsDependencies.js +0 -105
- package/dist/cjs/rules/informativeDocs.js +0 -153
- package/dist/cjs/rules/linesBeforeBlock.js +0 -106
- package/dist/cjs/rules/matchDescription.js +0 -240
- package/dist/cjs/rules/matchName.js +0 -122
- package/dist/cjs/rules/multilineBlocks.js +0 -339
- package/dist/cjs/rules/noBadBlocks.js +0 -88
- package/dist/cjs/rules/noBlankBlockDescriptions.js +0 -56
- package/dist/cjs/rules/noBlankBlocks.js +0 -41
- package/dist/cjs/rules/noDefaults.js +0 -84
- package/dist/cjs/rules/noMissingSyntax.js +0 -164
- package/dist/cjs/rules/noMultiAsterisks.js +0 -83
- package/dist/cjs/rules/noRestrictedSyntax.js +0 -75
- package/dist/cjs/rules/noTypes.js +0 -88
- package/dist/cjs/rules/noUndefinedTypes.js +0 -451
- package/dist/cjs/rules/requireAsteriskPrefix.js +0 -144
- package/dist/cjs/rules/requireDescription.js +0 -136
- package/dist/cjs/rules/requireDescriptionCompleteSentence.js +0 -258
- package/dist/cjs/rules/requireExample.js +0 -103
- package/dist/cjs/rules/requireFileOverview.js +0 -117
- package/dist/cjs/rules/requireHyphenBeforeParamDescription.js +0 -144
- package/dist/cjs/rules/requireJsdoc.js +0 -629
- package/dist/cjs/rules/requireParam.js +0 -480
- package/dist/cjs/rules/requireParamDescription.js +0 -77
- package/dist/cjs/rules/requireParamName.js +0 -52
- package/dist/cjs/rules/requireParamType.js +0 -77
- package/dist/cjs/rules/requireProperty.js +0 -44
- package/dist/cjs/rules/requirePropertyDescription.js +0 -22
- package/dist/cjs/rules/requirePropertyName.js +0 -22
- package/dist/cjs/rules/requirePropertyType.js +0 -22
- package/dist/cjs/rules/requireReturns.js +0 -197
- package/dist/cjs/rules/requireReturnsCheck.js +0 -108
- package/dist/cjs/rules/requireReturnsDescription.js +0 -58
- package/dist/cjs/rules/requireReturnsType.js +0 -52
- package/dist/cjs/rules/requireTemplate.js +0 -173
- package/dist/cjs/rules/requireThrows.js +0 -101
- package/dist/cjs/rules/requireYields.js +0 -172
- package/dist/cjs/rules/requireYieldsCheck.js +0 -164
- package/dist/cjs/rules/sortTags.js +0 -392
- package/dist/cjs/rules/tagLines.js +0 -259
- package/dist/cjs/rules/textEscaping.js +0 -125
- package/dist/cjs/rules/typeFormatting.js +0 -328
- package/dist/cjs/rules/validTypes.js +0 -333
- package/dist/cjs/tagNames.js +0 -209
- package/dist/cjs/utils/hasReturnValue.js +0 -469
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const iterateJsdoc_js_1 = __importDefault(require("../iterateJsdoc.js"));
|
|
7
|
-
const jsdoccomment_1 = require("@es-joy/jsdoccomment");
|
|
8
|
-
const inlineTags = new Set([
|
|
9
|
-
'link', 'linkcode', 'linkplain',
|
|
10
|
-
'tutorial',
|
|
11
|
-
]);
|
|
12
|
-
const jsdocTypePrattKeywords = new Set([
|
|
13
|
-
'extends',
|
|
14
|
-
'import',
|
|
15
|
-
'is',
|
|
16
|
-
'readonly',
|
|
17
|
-
'typeof',
|
|
18
|
-
]);
|
|
19
|
-
const asExpression = /as\s+/v;
|
|
20
|
-
const suppressTypes = new Set([
|
|
21
|
-
// https://github.com/google/closure-compiler/wiki/@suppress-annotations
|
|
22
|
-
// https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/ParserConfig.properties#L154
|
|
23
|
-
'accessControls',
|
|
24
|
-
'checkDebuggerStatement',
|
|
25
|
-
'checkEs5InheritanceCorrectnessConditions',
|
|
26
|
-
'checkPrototypalTypes',
|
|
27
|
-
'checkRegExp',
|
|
28
|
-
'checkTypes',
|
|
29
|
-
'checkVars',
|
|
30
|
-
'closureClassChecks',
|
|
31
|
-
'closureDepMethodUsageChecks',
|
|
32
|
-
'const',
|
|
33
|
-
'constantProperty',
|
|
34
|
-
'dangerousUnrecognizedTypeError',
|
|
35
|
-
'deprecated',
|
|
36
|
-
'duplicate',
|
|
37
|
-
'es5Strict',
|
|
38
|
-
'externsValidation',
|
|
39
|
-
'extraProvide',
|
|
40
|
-
'extraRequire',
|
|
41
|
-
'globalThis',
|
|
42
|
-
'invalidCasts',
|
|
43
|
-
'lateProvide',
|
|
44
|
-
'legacyGoogScopeRequire',
|
|
45
|
-
'lintChecks',
|
|
46
|
-
'lintVarDeclarations',
|
|
47
|
-
'messageConventions',
|
|
48
|
-
'misplacedTypeAnnotation',
|
|
49
|
-
'missingOverride',
|
|
50
|
-
'missingPolyfill',
|
|
51
|
-
'missingProperties',
|
|
52
|
-
'missingProvide',
|
|
53
|
-
'missingRequire',
|
|
54
|
-
'missingReturn',
|
|
55
|
-
'missingSourcesWarnings',
|
|
56
|
-
'moduleLoad',
|
|
57
|
-
'msgDescriptions',
|
|
58
|
-
'nonStandardJsDocs',
|
|
59
|
-
'partialAlias',
|
|
60
|
-
'polymer',
|
|
61
|
-
'reportUnknownTypes',
|
|
62
|
-
'strictCheckTypes',
|
|
63
|
-
'strictMissingProperties',
|
|
64
|
-
'strictModuleDepCheck',
|
|
65
|
-
'strictPrimitiveOperators',
|
|
66
|
-
'suspiciousCode',
|
|
67
|
-
// Not documented in enum
|
|
68
|
-
'switch',
|
|
69
|
-
'transitionalSuspiciousCodeWarnings',
|
|
70
|
-
'undefinedNames',
|
|
71
|
-
'undefinedVars',
|
|
72
|
-
'underscore',
|
|
73
|
-
'unknownDefines',
|
|
74
|
-
'untranspilableFeatures',
|
|
75
|
-
'unusedLocalVariables',
|
|
76
|
-
// Not documented?
|
|
77
|
-
'unusedPrivateMembers',
|
|
78
|
-
'uselessCode',
|
|
79
|
-
'useOfGoogProvide',
|
|
80
|
-
'visibility',
|
|
81
|
-
'with',
|
|
82
|
-
]);
|
|
83
|
-
/**
|
|
84
|
-
* @param {string} path
|
|
85
|
-
* @returns {boolean}
|
|
86
|
-
*/
|
|
87
|
-
const tryParsePathIgnoreError = (path) => {
|
|
88
|
-
try {
|
|
89
|
-
(0, jsdoccomment_1.tryParse)(path);
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
// Keep the original error for including the whole type
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
};
|
|
97
|
-
// eslint-disable-next-line complexity
|
|
98
|
-
exports.default = (0, iterateJsdoc_js_1.default)(({ context, jsdoc, report, settings, utils, }) => {
|
|
99
|
-
const { allowEmptyNamepaths = false, } = context.options[0] || {};
|
|
100
|
-
const { mode, } = settings;
|
|
101
|
-
for (const tag of jsdoc.tags) {
|
|
102
|
-
/**
|
|
103
|
-
* @param {string} namepath
|
|
104
|
-
* @param {string} [tagName]
|
|
105
|
-
* @returns {boolean}
|
|
106
|
-
*/
|
|
107
|
-
const validNamepathParsing = function (namepath, tagName) {
|
|
108
|
-
if (tryParsePathIgnoreError(namepath) ||
|
|
109
|
-
jsdocTypePrattKeywords.has(namepath)) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
let handled = false;
|
|
113
|
-
if (tagName) {
|
|
114
|
-
switch (tagName) {
|
|
115
|
-
case 'memberof':
|
|
116
|
-
case 'memberof!': {
|
|
117
|
-
const endChar = namepath.slice(-1);
|
|
118
|
-
if ([
|
|
119
|
-
'#', '.', '~',
|
|
120
|
-
].includes(endChar)) {
|
|
121
|
-
handled = tryParsePathIgnoreError(namepath.slice(0, -1));
|
|
122
|
-
}
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
case 'module':
|
|
126
|
-
case 'requires': {
|
|
127
|
-
if (!namepath.startsWith('module:')) {
|
|
128
|
-
handled = tryParsePathIgnoreError(`module:${namepath}`);
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case 'borrows': {
|
|
133
|
-
const startChar = namepath.charAt(0);
|
|
134
|
-
if ([
|
|
135
|
-
'#', '.', '~',
|
|
136
|
-
].includes(startChar)) {
|
|
137
|
-
handled = tryParsePathIgnoreError(namepath.slice(1));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (!handled) {
|
|
143
|
-
report(`Syntax error in namepath: ${namepath}`, null, tag);
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
return true;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* @param {string} type
|
|
150
|
-
* @returns {boolean}
|
|
151
|
-
*/
|
|
152
|
-
const validTypeParsing = function (type) {
|
|
153
|
-
let parsedTypes;
|
|
154
|
-
try {
|
|
155
|
-
if (mode === 'permissive') {
|
|
156
|
-
parsedTypes = (0, jsdoccomment_1.tryParse)(type);
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
parsedTypes = (0, jsdoccomment_1.parse)(type, mode);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch {
|
|
163
|
-
report(`Syntax error in type: ${type}`, null, tag);
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
if (mode === 'closure' || mode === 'typescript') {
|
|
167
|
-
(0, jsdoccomment_1.traverse)(parsedTypes, (node) => {
|
|
168
|
-
const { type: typ, } = node;
|
|
169
|
-
if ((typ === 'JsdocTypeObjectField' || typ === 'JsdocTypeKeyValue') &&
|
|
170
|
-
node.right?.type === 'JsdocTypeNullable' &&
|
|
171
|
-
node.right?.meta?.position === 'suffix') {
|
|
172
|
-
report(`Syntax error in type: ${node.right.type}`, null, tag);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
return true;
|
|
177
|
-
};
|
|
178
|
-
if (tag.problems.length) {
|
|
179
|
-
const msg = tag.problems.reduce((str, { message, }) => {
|
|
180
|
-
return str + '; ' + message;
|
|
181
|
-
}, '').slice(2);
|
|
182
|
-
report(`Invalid name: ${msg}`, null, tag);
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
if (tag.tag === 'import') {
|
|
186
|
-
// A named import will look like a type, but not be valid; we also don't
|
|
187
|
-
// need to check the name/namepath
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
if (tag.tag === 'borrows') {
|
|
191
|
-
const thisNamepath = /** @type {string} */ (utils.getTagDescription(tag)).replace(asExpression, '')
|
|
192
|
-
.trim();
|
|
193
|
-
if (!asExpression.test(/** @type {string} */ (utils.getTagDescription(tag))) || !thisNamepath) {
|
|
194
|
-
report(`@borrows must have an "as" expression. Found "${utils.getTagDescription(tag)}"`, null, tag);
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
if (validNamepathParsing(thisNamepath, 'borrows')) {
|
|
198
|
-
const thatNamepath = tag.name;
|
|
199
|
-
validNamepathParsing(thatNamepath);
|
|
200
|
-
}
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
if (tag.tag === 'suppress' && mode === 'closure') {
|
|
204
|
-
let parsedTypes;
|
|
205
|
-
try {
|
|
206
|
-
parsedTypes = (0, jsdoccomment_1.tryParse)(tag.type);
|
|
207
|
-
}
|
|
208
|
-
catch {
|
|
209
|
-
// Ignore
|
|
210
|
-
}
|
|
211
|
-
if (parsedTypes) {
|
|
212
|
-
(0, jsdoccomment_1.traverse)(parsedTypes, (node) => {
|
|
213
|
-
let type;
|
|
214
|
-
if ('value' in node && typeof node.value === 'string') {
|
|
215
|
-
type = node.value;
|
|
216
|
-
}
|
|
217
|
-
if (type !== undefined && !suppressTypes.has(type)) {
|
|
218
|
-
report(`Syntax error in suppress type: ${type}`, null, tag);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
const otherModeMaps = /** @type {import('../jsdocUtils.js').ParserMode[]} */ ([
|
|
224
|
-
'jsdoc', 'typescript', 'closure', 'permissive',
|
|
225
|
-
]).filter((mde) => {
|
|
226
|
-
return mde !== mode;
|
|
227
|
-
}).map((mde) => {
|
|
228
|
-
return utils.getTagStructureForMode(mde);
|
|
229
|
-
});
|
|
230
|
-
const tagMightHaveNamePosition = utils.tagMightHaveNamePosition(tag.tag, otherModeMaps);
|
|
231
|
-
if (tagMightHaveNamePosition !== true && tag.name) {
|
|
232
|
-
const modeInfo = tagMightHaveNamePosition === false ? '' : ` in "${mode}" mode`;
|
|
233
|
-
report(`@${tag.tag} should not have a name${modeInfo}.`, null, tag);
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
// Documentation like `@returns {@link SomeType}` is technically ambiguous. Specifically it
|
|
237
|
-
// could either be intepreted as a type `"@link SomeType"` or a description `"{@link SomeType}"`.
|
|
238
|
-
// However this is a good heuristic.
|
|
239
|
-
if (tag.type.trim().startsWith('@')) {
|
|
240
|
-
tag.description = `{${tag.type}} ${tag.description}`;
|
|
241
|
-
tag.type = '';
|
|
242
|
-
}
|
|
243
|
-
const mightHaveTypePosition = utils.tagMightHaveTypePosition(tag.tag, otherModeMaps);
|
|
244
|
-
if (mightHaveTypePosition !== true && tag.type) {
|
|
245
|
-
const modeInfo = mightHaveTypePosition === false ? '' : ` in "${mode}" mode`;
|
|
246
|
-
report(`@${tag.tag} should not have a bracketed type${modeInfo}.`, null, tag);
|
|
247
|
-
continue;
|
|
248
|
-
}
|
|
249
|
-
// REQUIRED NAME
|
|
250
|
-
const tagMustHaveNamePosition = utils.tagMustHaveNamePosition(tag.tag, otherModeMaps);
|
|
251
|
-
// Don't handle `@param` here though it does require name as handled by
|
|
252
|
-
// `require-param-name` (`@property` would similarly seem to require one,
|
|
253
|
-
// but is handled by `require-property-name`)
|
|
254
|
-
if (tagMustHaveNamePosition !== false && !tag.name && !allowEmptyNamepaths && ![
|
|
255
|
-
'arg', 'argument', 'param',
|
|
256
|
-
'prop', 'property',
|
|
257
|
-
].includes(tag.tag) &&
|
|
258
|
-
(tag.tag !== 'see' || !utils.getTagDescription(tag).includes('{@link'))) {
|
|
259
|
-
const modeInfo = tagMustHaveNamePosition === true ? '' : ` in "${mode}" mode`;
|
|
260
|
-
report(`Tag @${tag.tag} must have a name/namepath${modeInfo}.`, null, tag);
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
// REQUIRED TYPE
|
|
264
|
-
const mustHaveTypePosition = utils.tagMustHaveTypePosition(tag.tag, otherModeMaps);
|
|
265
|
-
if (mustHaveTypePosition !== false && !tag.type) {
|
|
266
|
-
const modeInfo = mustHaveTypePosition === true ? '' : ` in "${mode}" mode`;
|
|
267
|
-
report(`Tag @${tag.tag} must have a type${modeInfo}.`, null, tag);
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
// REQUIRED TYPE OR NAME/NAMEPATH
|
|
271
|
-
const tagMissingRequiredTypeOrNamepath = utils.tagMissingRequiredTypeOrNamepath(tag, otherModeMaps);
|
|
272
|
-
if (tagMissingRequiredTypeOrNamepath !== false && !allowEmptyNamepaths) {
|
|
273
|
-
const modeInfo = tagMissingRequiredTypeOrNamepath === true ? '' : ` in "${mode}" mode`;
|
|
274
|
-
report(`Tag @${tag.tag} must have either a type or namepath${modeInfo}.`, null, tag);
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
// VALID TYPE
|
|
278
|
-
const hasTypePosition = mightHaveTypePosition === true && Boolean(tag.type);
|
|
279
|
-
if (hasTypePosition) {
|
|
280
|
-
validTypeParsing(tag.type);
|
|
281
|
-
}
|
|
282
|
-
// VALID NAME/NAMEPATH
|
|
283
|
-
const hasNameOrNamepathPosition = (tagMustHaveNamePosition !== false ||
|
|
284
|
-
utils.tagMightHaveNamepath(tag.tag)) && Boolean(tag.name);
|
|
285
|
-
if (hasNameOrNamepathPosition) {
|
|
286
|
-
if (mode !== 'jsdoc' && tag.tag === 'template') {
|
|
287
|
-
if (!tryParsePathIgnoreError(
|
|
288
|
-
// May be an issue with the commas of
|
|
289
|
-
// `utils.parseClosureTemplateTag`, so first try a raw
|
|
290
|
-
// value; we really need a proper parser instead, however.
|
|
291
|
-
tag.name.trim().replace(/^\[?(?<name>.*?)=.*$/v, '$<name>'))) {
|
|
292
|
-
for (const namepath of utils.parseClosureTemplateTag(tag)) {
|
|
293
|
-
validNamepathParsing(namepath);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
validNamepathParsing(tag.name, tag.tag);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
for (const inlineTag of tag.inlineTags) {
|
|
302
|
-
if (inlineTags.has(inlineTag.tag) && !inlineTag.text && !inlineTag.namepathOrURL) {
|
|
303
|
-
report(`Inline tag "${inlineTag.tag}" missing content`, null, tag);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
for (const inlineTag of jsdoc.inlineTags) {
|
|
308
|
-
if (inlineTags.has(inlineTag.tag) && !inlineTag.text && !inlineTag.namepathOrURL) {
|
|
309
|
-
report(`Inline tag "${inlineTag.tag}" missing content`);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}, {
|
|
313
|
-
iterateAllJsdocs: true,
|
|
314
|
-
meta: {
|
|
315
|
-
docs: {
|
|
316
|
-
description: 'Requires all types to be valid JSDoc or Closure compiler types without syntax errors.',
|
|
317
|
-
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/valid-types.md#repos-sticky-header',
|
|
318
|
-
},
|
|
319
|
-
schema: [
|
|
320
|
-
{
|
|
321
|
-
additionalProperties: false,
|
|
322
|
-
properties: {
|
|
323
|
-
allowEmptyNamepaths: {
|
|
324
|
-
default: false,
|
|
325
|
-
type: 'boolean',
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
|
-
type: 'object',
|
|
329
|
-
},
|
|
330
|
-
],
|
|
331
|
-
type: 'suggestion',
|
|
332
|
-
},
|
|
333
|
-
});
|
package/dist/cjs/tagNames.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {{
|
|
4
|
-
* [key: string]: string[]
|
|
5
|
-
* }} AliasedTags
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.typeScriptTags = exports.jsdocTags = exports.closureTags = void 0;
|
|
9
|
-
/**
|
|
10
|
-
* @type {AliasedTags}
|
|
11
|
-
*/
|
|
12
|
-
const jsdocTagsUndocumented = {
|
|
13
|
-
// Undocumented but present; see
|
|
14
|
-
// https://github.com/jsdoc/jsdoc/issues/1283#issuecomment-516816802
|
|
15
|
-
// https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594
|
|
16
|
-
modifies: [],
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* @type {AliasedTags}
|
|
20
|
-
*/
|
|
21
|
-
const jsdocTags = {
|
|
22
|
-
...jsdocTagsUndocumented,
|
|
23
|
-
abstract: [
|
|
24
|
-
'virtual',
|
|
25
|
-
],
|
|
26
|
-
access: [],
|
|
27
|
-
alias: [],
|
|
28
|
-
async: [],
|
|
29
|
-
augments: [
|
|
30
|
-
'extends',
|
|
31
|
-
],
|
|
32
|
-
author: [],
|
|
33
|
-
borrows: [],
|
|
34
|
-
callback: [],
|
|
35
|
-
class: [
|
|
36
|
-
'constructor',
|
|
37
|
-
],
|
|
38
|
-
classdesc: [],
|
|
39
|
-
constant: [
|
|
40
|
-
'const',
|
|
41
|
-
],
|
|
42
|
-
constructs: [],
|
|
43
|
-
copyright: [],
|
|
44
|
-
default: [
|
|
45
|
-
'defaultvalue',
|
|
46
|
-
],
|
|
47
|
-
deprecated: [],
|
|
48
|
-
description: [
|
|
49
|
-
'desc',
|
|
50
|
-
],
|
|
51
|
-
enum: [],
|
|
52
|
-
event: [],
|
|
53
|
-
example: [],
|
|
54
|
-
exports: [],
|
|
55
|
-
external: [
|
|
56
|
-
'host',
|
|
57
|
-
],
|
|
58
|
-
file: [
|
|
59
|
-
'fileoverview',
|
|
60
|
-
'overview',
|
|
61
|
-
],
|
|
62
|
-
fires: [
|
|
63
|
-
'emits',
|
|
64
|
-
],
|
|
65
|
-
function: [
|
|
66
|
-
'func',
|
|
67
|
-
'method',
|
|
68
|
-
],
|
|
69
|
-
generator: [],
|
|
70
|
-
global: [],
|
|
71
|
-
hideconstructor: [],
|
|
72
|
-
ignore: [],
|
|
73
|
-
implements: [],
|
|
74
|
-
inheritdoc: [],
|
|
75
|
-
// Allowing casing distinct from jsdoc `definitions.js` (required in Closure)
|
|
76
|
-
inheritDoc: [],
|
|
77
|
-
inner: [],
|
|
78
|
-
instance: [],
|
|
79
|
-
interface: [],
|
|
80
|
-
kind: [],
|
|
81
|
-
lends: [],
|
|
82
|
-
license: [],
|
|
83
|
-
listens: [],
|
|
84
|
-
member: [
|
|
85
|
-
'var',
|
|
86
|
-
],
|
|
87
|
-
memberof: [],
|
|
88
|
-
'memberof!': [],
|
|
89
|
-
mixes: [],
|
|
90
|
-
mixin: [],
|
|
91
|
-
module: [],
|
|
92
|
-
name: [],
|
|
93
|
-
namespace: [],
|
|
94
|
-
override: [],
|
|
95
|
-
package: [],
|
|
96
|
-
param: [
|
|
97
|
-
'arg',
|
|
98
|
-
'argument',
|
|
99
|
-
],
|
|
100
|
-
private: [],
|
|
101
|
-
property: [
|
|
102
|
-
'prop',
|
|
103
|
-
],
|
|
104
|
-
protected: [],
|
|
105
|
-
public: [],
|
|
106
|
-
readonly: [],
|
|
107
|
-
requires: [],
|
|
108
|
-
returns: [
|
|
109
|
-
'return',
|
|
110
|
-
],
|
|
111
|
-
see: [],
|
|
112
|
-
since: [],
|
|
113
|
-
static: [],
|
|
114
|
-
summary: [],
|
|
115
|
-
this: [],
|
|
116
|
-
throws: [
|
|
117
|
-
'exception',
|
|
118
|
-
],
|
|
119
|
-
todo: [],
|
|
120
|
-
tutorial: [],
|
|
121
|
-
type: [],
|
|
122
|
-
typedef: [],
|
|
123
|
-
variation: [],
|
|
124
|
-
version: [],
|
|
125
|
-
yields: [
|
|
126
|
-
'yield',
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
exports.jsdocTags = jsdocTags;
|
|
130
|
-
/**
|
|
131
|
-
* @type {AliasedTags}
|
|
132
|
-
*/
|
|
133
|
-
const typeScriptTags = {
|
|
134
|
-
...jsdocTags,
|
|
135
|
-
// https://github.com/microsoft/TypeScript/issues/22160
|
|
136
|
-
// https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#the-jsdoc-import-tag
|
|
137
|
-
import: [],
|
|
138
|
-
// https://www.typescriptlang.org/tsconfig/#stripInternal
|
|
139
|
-
internal: [],
|
|
140
|
-
// https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#overload-support-in-jsdoc
|
|
141
|
-
overload: [],
|
|
142
|
-
// https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#satisfies-support-in-jsdoc
|
|
143
|
-
satisfies: [],
|
|
144
|
-
// `@template` is also in TypeScript per:
|
|
145
|
-
// https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc
|
|
146
|
-
template: [],
|
|
147
|
-
};
|
|
148
|
-
exports.typeScriptTags = typeScriptTags;
|
|
149
|
-
/**
|
|
150
|
-
* @type {AliasedTags}
|
|
151
|
-
*/
|
|
152
|
-
const undocumentedClosureTags = {
|
|
153
|
-
// These are in Closure source but not in jsdoc source nor in the Closure
|
|
154
|
-
// docs: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java
|
|
155
|
-
closurePrimitive: [],
|
|
156
|
-
customElement: [],
|
|
157
|
-
expose: [],
|
|
158
|
-
hidden: [],
|
|
159
|
-
idGenerator: [],
|
|
160
|
-
meaning: [],
|
|
161
|
-
mixinClass: [],
|
|
162
|
-
mixinFunction: [],
|
|
163
|
-
ngInject: [],
|
|
164
|
-
owner: [],
|
|
165
|
-
typeSummary: [],
|
|
166
|
-
wizaction: [],
|
|
167
|
-
};
|
|
168
|
-
const {
|
|
169
|
-
/* eslint-disable no-unused-vars */
|
|
170
|
-
inheritdoc, internal, overload,
|
|
171
|
-
// Will be inverted to prefer `return`
|
|
172
|
-
returns, satisfies,
|
|
173
|
-
/* eslint-enable no-unused-vars */
|
|
174
|
-
...typeScriptTagsInClosure } = typeScriptTags;
|
|
175
|
-
/**
|
|
176
|
-
* @type {AliasedTags}
|
|
177
|
-
*/
|
|
178
|
-
const closureTags = {
|
|
179
|
-
...typeScriptTagsInClosure,
|
|
180
|
-
...undocumentedClosureTags,
|
|
181
|
-
// From https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler
|
|
182
|
-
// These are all recognized in https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js
|
|
183
|
-
// except for the experimental `noinline` and the casing differences noted below
|
|
184
|
-
// Defined as a synonym of `const` in jsdoc `definitions.js`
|
|
185
|
-
define: [],
|
|
186
|
-
dict: [],
|
|
187
|
-
export: [],
|
|
188
|
-
externs: [],
|
|
189
|
-
final: [],
|
|
190
|
-
// With casing distinct from jsdoc `definitions.js`
|
|
191
|
-
implicitCast: [],
|
|
192
|
-
noalias: [],
|
|
193
|
-
nocollapse: [],
|
|
194
|
-
nocompile: [],
|
|
195
|
-
noinline: [],
|
|
196
|
-
nosideeffects: [],
|
|
197
|
-
polymer: [],
|
|
198
|
-
polymerBehavior: [],
|
|
199
|
-
preserve: [],
|
|
200
|
-
// Defined as a synonym of `interface` in jsdoc `definitions.js`
|
|
201
|
-
record: [],
|
|
202
|
-
return: [
|
|
203
|
-
'returns',
|
|
204
|
-
],
|
|
205
|
-
struct: [],
|
|
206
|
-
suppress: [],
|
|
207
|
-
unrestricted: [],
|
|
208
|
-
};
|
|
209
|
-
exports.closureTags = closureTags;
|