eslint-plugin-jsdoc 37.7.1 → 37.9.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/README.md +385 -15
- package/dist/defaultTagOrder.js +26 -0
- package/dist/defaultTagOrder.js.map +1 -0
- package/dist/getDefaultTagStructureForMode.js +12 -5
- package/dist/getDefaultTagStructureForMode.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/iterateJsdoc.js +33 -5
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/rules/checkValues.js +11 -0
- package/dist/rules/checkValues.js.map +1 -1
- package/dist/rules/emptyTags.js +2 -1
- package/dist/rules/emptyTags.js.map +1 -1
- package/dist/rules/sortTags.js +165 -0
- package/dist/rules/sortTags.js.map +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ JSDoc linting rules for ESLint.
|
|
|
70
70
|
* [`require-throws`](#eslint-plugin-jsdoc-rules-require-throws)
|
|
71
71
|
* [`require-yields`](#eslint-plugin-jsdoc-rules-require-yields)
|
|
72
72
|
* [`require-yields-check`](#eslint-plugin-jsdoc-rules-require-yields-check)
|
|
73
|
+
* [`sort-tags`](#eslint-plugin-jsdoc-rules-sort-tags)
|
|
73
74
|
* [`tag-lines`](#eslint-plugin-jsdoc-rules-tag-lines)
|
|
74
75
|
* [`valid-types`](#eslint-plugin-jsdoc-rules-valid-types)
|
|
75
76
|
|
|
@@ -1258,33 +1259,33 @@ function quux () {}
|
|
|
1258
1259
|
// Message: @example error (semi): Missing semicolon.
|
|
1259
1260
|
|
|
1260
1261
|
/**
|
|
1261
|
-
* @example const
|
|
1262
|
-
* quux2()
|
|
1262
|
+
* @example const j = 5;
|
|
1263
|
+
* quux2();
|
|
1263
1264
|
*/
|
|
1264
1265
|
function quux2 () {
|
|
1265
1266
|
|
|
1266
1267
|
}
|
|
1267
1268
|
// "jsdoc/check-examples": ["error"|"warn", {"matchingFileName":"../../jsdocUtils.js"}]
|
|
1268
|
-
// Message: @example warning (id-length): Identifier name '
|
|
1269
|
+
// Message: @example warning (id-length): Identifier name 'j' is too short (< 2).
|
|
1269
1270
|
|
|
1270
1271
|
/**
|
|
1271
|
-
* @example const
|
|
1272
|
-
* quux2()
|
|
1272
|
+
* @example const k = 5;
|
|
1273
|
+
* quux2();
|
|
1273
1274
|
*/
|
|
1274
1275
|
function quux2 () {
|
|
1275
1276
|
|
|
1276
1277
|
}
|
|
1277
1278
|
// "jsdoc/check-examples": ["error"|"warn", {"configFile":".eslintrc.json","matchingFileName":"../../jsdocUtils.js"}]
|
|
1278
|
-
// Message: @example warning (id-length): Identifier name '
|
|
1279
|
+
// Message: @example warning (id-length): Identifier name 'k' is too short (< 2).
|
|
1279
1280
|
|
|
1280
1281
|
/**
|
|
1281
|
-
* @example const
|
|
1282
|
-
* quux2()
|
|
1282
|
+
* @example const m = 5;
|
|
1283
|
+
* quux2();
|
|
1283
1284
|
*/
|
|
1284
1285
|
function quux2 () {
|
|
1285
1286
|
|
|
1286
1287
|
}
|
|
1287
|
-
// Message: @example warning (id-length): Identifier name '
|
|
1288
|
+
// Message: @example warning (id-length): Identifier name 'm' is too short (< 2).
|
|
1288
1289
|
|
|
1289
1290
|
/**
|
|
1290
1291
|
* @example const i = 5;
|
|
@@ -5817,6 +5818,9 @@ This rule checks the values for a handful of tags:
|
|
|
5817
5818
|
5. `@variation` - If `numericOnlyVariation` is set, will checks that there
|
|
5818
5819
|
is a value present, and that it is an integer (otherwise, jsdoc allows any
|
|
5819
5820
|
value).
|
|
5821
|
+
6. `@kind` - Insists that it be one of the allowed values: 'class',
|
|
5822
|
+
'constant', 'event', 'external', 'file', 'function', 'member', 'mixin',
|
|
5823
|
+
'module', 'namespace', 'typedef',
|
|
5820
5824
|
|
|
5821
5825
|
<a name="eslint-plugin-jsdoc-rules-check-values-options-8"></a>
|
|
5822
5826
|
#### Options
|
|
@@ -5856,7 +5860,7 @@ Whether to enable validation that `@variation` must be a number. Defaults to
|
|
|
5856
5860
|
|||
|
|
5857
5861
|
|---|---|
|
|
5858
5862
|
|Context|everywhere|
|
|
5859
|
-
|Tags|`@version`, `@since`, `@license`, `@author`, `@variation`|
|
|
5863
|
+
|Tags|`@version`, `@since`, `@kind`, `@license`, `@author`, `@variation`|
|
|
5860
5864
|
|Recommended|true|
|
|
5861
5865
|
|Options|`allowedAuthors`, `allowedLicenses`, `licensePattern`|
|
|
5862
5866
|
|Settings|`tagNamePreference`|
|
|
@@ -5880,6 +5884,22 @@ function quux (foo) {
|
|
|
5880
5884
|
}
|
|
5881
5885
|
// Message: Invalid JSDoc @version: "3.1".
|
|
5882
5886
|
|
|
5887
|
+
/**
|
|
5888
|
+
* @kind
|
|
5889
|
+
*/
|
|
5890
|
+
function quux (foo) {
|
|
5891
|
+
|
|
5892
|
+
}
|
|
5893
|
+
// Message: Missing JSDoc @kind value.
|
|
5894
|
+
|
|
5895
|
+
/**
|
|
5896
|
+
* @kind -3
|
|
5897
|
+
*/
|
|
5898
|
+
function quux (foo) {
|
|
5899
|
+
|
|
5900
|
+
}
|
|
5901
|
+
// Message: Invalid JSDoc @kind: "-3"; must be one of: class, constant, event, external, file, function, member, mixin, module, namespace, typedef.
|
|
5902
|
+
|
|
5883
5903
|
/**
|
|
5884
5904
|
* @variation -3
|
|
5885
5905
|
*/
|
|
@@ -6107,6 +6127,13 @@ function quux (foo) {
|
|
|
6107
6127
|
* @license MIT
|
|
6108
6128
|
*/
|
|
6109
6129
|
'use strict';
|
|
6130
|
+
|
|
6131
|
+
/**
|
|
6132
|
+
* @kind function
|
|
6133
|
+
*/
|
|
6134
|
+
function quux (foo) {
|
|
6135
|
+
|
|
6136
|
+
}
|
|
6110
6137
|
````
|
|
6111
6138
|
|
|
6112
6139
|
|
|
@@ -6176,6 +6203,12 @@ function quux () {
|
|
|
6176
6203
|
}
|
|
6177
6204
|
// Message: @abstract should be empty.
|
|
6178
6205
|
|
|
6206
|
+
/**
|
|
6207
|
+
* @interface extra text
|
|
6208
|
+
*/
|
|
6209
|
+
// Settings: {"jsdoc":{"mode":"closure"}}
|
|
6210
|
+
// Message: @interface should be empty.
|
|
6211
|
+
|
|
6179
6212
|
class Test {
|
|
6180
6213
|
/**
|
|
6181
6214
|
* @abstract extra text
|
|
@@ -20056,12 +20089,349 @@ function * quux (foo) {
|
|
|
20056
20089
|
````
|
|
20057
20090
|
|
|
20058
20091
|
|
|
20092
|
+
<a name="eslint-plugin-jsdoc-rules-sort-tags"></a>
|
|
20093
|
+
### <code>sort-tags</code>
|
|
20094
|
+
|
|
20095
|
+
Sorts tags by a specified sequence according to tag name.
|
|
20096
|
+
|
|
20097
|
+
(Default order originally inspired by [`@homer0/prettier-plugin-jsdoc`](https://github.com/homer0/packages/tree/main/packages/public/prettier-plugin-jsdoc).)
|
|
20098
|
+
|
|
20099
|
+
<a name="eslint-plugin-jsdoc-rules-sort-tags-options-40"></a>
|
|
20100
|
+
#### Options
|
|
20101
|
+
|
|
20102
|
+
<a name="eslint-plugin-jsdoc-rules-sort-tags-options-40-tagsequence"></a>
|
|
20103
|
+
##### <code>tagSequence</code>
|
|
20104
|
+
|
|
20105
|
+
An array of tag names indicating the preferred sequence for sorting tags.
|
|
20106
|
+
|
|
20107
|
+
Tag names earlier in the list will be arranged first. The relative position of
|
|
20108
|
+
tags of the same name will not be changed.
|
|
20109
|
+
|
|
20110
|
+
Tags not in the list will be sorted alphabetically at the end (or in place of
|
|
20111
|
+
the pseudo-tag `-other` placed within `tagSequence`) if `alphabetizeExtras` is
|
|
20112
|
+
enabled and in their order of appearance otherwise (so if you want all your
|
|
20113
|
+
tags alphabetized, supply an empty array with `alphabetizeExtras` enabled).
|
|
20114
|
+
|
|
20115
|
+
Defaults to the array below.
|
|
20116
|
+
|
|
20117
|
+
Please note that this order is still experimental, so if you want to retain
|
|
20118
|
+
a fixed order that doesn't change into the future, supply your own
|
|
20119
|
+
`tagSequence`.
|
|
20120
|
+
|
|
20121
|
+
```js
|
|
20122
|
+
[
|
|
20123
|
+
// Brief descriptions
|
|
20124
|
+
'summary',
|
|
20125
|
+
'typeSummary',
|
|
20126
|
+
|
|
20127
|
+
// Module/file-level
|
|
20128
|
+
'module',
|
|
20129
|
+
'exports',
|
|
20130
|
+
'file',
|
|
20131
|
+
'fileoverview',
|
|
20132
|
+
'overview',
|
|
20133
|
+
|
|
20134
|
+
// Identifying (name, type)
|
|
20135
|
+
'typedef',
|
|
20136
|
+
'interface',
|
|
20137
|
+
'record',
|
|
20138
|
+
'template',
|
|
20139
|
+
'name',
|
|
20140
|
+
'kind',
|
|
20141
|
+
'type',
|
|
20142
|
+
'alias',
|
|
20143
|
+
'external',
|
|
20144
|
+
'host',
|
|
20145
|
+
'callback',
|
|
20146
|
+
'func',
|
|
20147
|
+
'function',
|
|
20148
|
+
'method',
|
|
20149
|
+
'class',
|
|
20150
|
+
'constructor',
|
|
20151
|
+
|
|
20152
|
+
// Relationships
|
|
20153
|
+
'modifies',
|
|
20154
|
+
'mixes',
|
|
20155
|
+
'mixin',
|
|
20156
|
+
'mixinClass',
|
|
20157
|
+
'mixinFunction',
|
|
20158
|
+
'namespace',
|
|
20159
|
+
'borrows',
|
|
20160
|
+
'constructs',
|
|
20161
|
+
'lends',
|
|
20162
|
+
'implements',
|
|
20163
|
+
'requires',
|
|
20164
|
+
|
|
20165
|
+
// Long descriptions
|
|
20166
|
+
'desc',
|
|
20167
|
+
'description',
|
|
20168
|
+
'classdesc',
|
|
20169
|
+
'tutorial',
|
|
20170
|
+
'copyright',
|
|
20171
|
+
'license',
|
|
20172
|
+
|
|
20173
|
+
// Simple annotations
|
|
20174
|
+
'const',
|
|
20175
|
+
'constant',
|
|
20176
|
+
'final',
|
|
20177
|
+
'global',
|
|
20178
|
+
'readonly',
|
|
20179
|
+
'abstract',
|
|
20180
|
+
'virtual',
|
|
20181
|
+
'var',
|
|
20182
|
+
'member',
|
|
20183
|
+
'memberof',
|
|
20184
|
+
'memberof!',
|
|
20185
|
+
'inner',
|
|
20186
|
+
'instance',
|
|
20187
|
+
'inheritdoc',
|
|
20188
|
+
'inheritDoc',
|
|
20189
|
+
'override',
|
|
20190
|
+
'hideconstructor',
|
|
20191
|
+
|
|
20192
|
+
// Core function/object info
|
|
20193
|
+
'param',
|
|
20194
|
+
'arg',
|
|
20195
|
+
'argument',
|
|
20196
|
+
'prop',
|
|
20197
|
+
'property',
|
|
20198
|
+
'return',
|
|
20199
|
+
'returns',
|
|
20200
|
+
|
|
20201
|
+
// Important behavior details
|
|
20202
|
+
'async',
|
|
20203
|
+
'generator',
|
|
20204
|
+
'default',
|
|
20205
|
+
'defaultvalue',
|
|
20206
|
+
'enum',
|
|
20207
|
+
'augments',
|
|
20208
|
+
'extends',
|
|
20209
|
+
'throws',
|
|
20210
|
+
'exception',
|
|
20211
|
+
'yield',
|
|
20212
|
+
'yields',
|
|
20213
|
+
'event',
|
|
20214
|
+
'fires',
|
|
20215
|
+
'emits',
|
|
20216
|
+
'listens',
|
|
20217
|
+
'this',
|
|
20218
|
+
|
|
20219
|
+
// Access
|
|
20220
|
+
'static',
|
|
20221
|
+
'private',
|
|
20222
|
+
'protected',
|
|
20223
|
+
'public',
|
|
20224
|
+
'access',
|
|
20225
|
+
'package',
|
|
20226
|
+
|
|
20227
|
+
'-other',
|
|
20228
|
+
|
|
20229
|
+
// Supplementary descriptions
|
|
20230
|
+
'see',
|
|
20231
|
+
'example',
|
|
20232
|
+
|
|
20233
|
+
// METADATA
|
|
20234
|
+
|
|
20235
|
+
// Other Closure (undocumented) metadata
|
|
20236
|
+
'closurePrimitive',
|
|
20237
|
+
'customElement',
|
|
20238
|
+
'expose',
|
|
20239
|
+
'hidden',
|
|
20240
|
+
'idGenerator',
|
|
20241
|
+
'meaning',
|
|
20242
|
+
'ngInject',
|
|
20243
|
+
'owner',
|
|
20244
|
+
'wizaction',
|
|
20245
|
+
|
|
20246
|
+
// Other Closure (documented) metadata
|
|
20247
|
+
'define',
|
|
20248
|
+
'dict',
|
|
20249
|
+
'export',
|
|
20250
|
+
'externs',
|
|
20251
|
+
'implicitCast',
|
|
20252
|
+
'noalias',
|
|
20253
|
+
'nocollapse',
|
|
20254
|
+
'nocompile',
|
|
20255
|
+
'noinline',
|
|
20256
|
+
'nosideeffects',
|
|
20257
|
+
'polymer',
|
|
20258
|
+
'polymerBehavior',
|
|
20259
|
+
'preserve',
|
|
20260
|
+
'struct',
|
|
20261
|
+
'suppress',
|
|
20262
|
+
'unrestricted',
|
|
20263
|
+
|
|
20264
|
+
// @homer0/prettier-plugin-jsdoc metadata
|
|
20265
|
+
'category',
|
|
20266
|
+
|
|
20267
|
+
// Non-Closure metadata
|
|
20268
|
+
'ignore',
|
|
20269
|
+
'author',
|
|
20270
|
+
'version',
|
|
20271
|
+
'variation',
|
|
20272
|
+
'since',
|
|
20273
|
+
'deprecated',
|
|
20274
|
+
'todo',
|
|
20275
|
+
];
|
|
20276
|
+
```
|
|
20277
|
+
|
|
20278
|
+
<a name="eslint-plugin-jsdoc-rules-sort-tags-options-40-alphabetizeextras"></a>
|
|
20279
|
+
##### <code>alphabetizeExtras</code>
|
|
20280
|
+
|
|
20281
|
+
Defaults to `false`. Alphabetizes any items not within `tagSequence` after any
|
|
20282
|
+
items within `tagSequence` (or in place of the special `-other` pseudo-tag)
|
|
20283
|
+
are sorted.
|
|
20284
|
+
|
|
20285
|
+
|||
|
|
20286
|
+
|---|---|
|
|
20287
|
+
|Context|everywhere|
|
|
20288
|
+
|Tags|any|
|
|
20289
|
+
|Recommended|false|
|
|
20290
|
+
|Settings||
|
|
20291
|
+
|Options|`tagSequence`, `alphabetizeExtras`|
|
|
20292
|
+
|
|
20293
|
+
The following patterns are considered problems:
|
|
20294
|
+
|
|
20295
|
+
````js
|
|
20296
|
+
/**
|
|
20297
|
+
* @returns {string}
|
|
20298
|
+
* @param b
|
|
20299
|
+
* @param a
|
|
20300
|
+
*/
|
|
20301
|
+
function quux () {}
|
|
20302
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20303
|
+
|
|
20304
|
+
/**
|
|
20305
|
+
* Some description
|
|
20306
|
+
* @returns {string}
|
|
20307
|
+
* @param b
|
|
20308
|
+
* @param a
|
|
20309
|
+
*/
|
|
20310
|
+
function quux () {}
|
|
20311
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20312
|
+
|
|
20313
|
+
/**
|
|
20314
|
+
* @returns {string}
|
|
20315
|
+
* @param b A long
|
|
20316
|
+
* description
|
|
20317
|
+
* @param a
|
|
20318
|
+
*/
|
|
20319
|
+
function quux () {}
|
|
20320
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20321
|
+
|
|
20322
|
+
/**
|
|
20323
|
+
* Some description
|
|
20324
|
+
* @returns {string}
|
|
20325
|
+
* @param b A long
|
|
20326
|
+
* description
|
|
20327
|
+
* @param a
|
|
20328
|
+
*/
|
|
20329
|
+
function quux () {}
|
|
20330
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20331
|
+
|
|
20332
|
+
/**
|
|
20333
|
+
* @param b A long
|
|
20334
|
+
* description
|
|
20335
|
+
* @returns {string}
|
|
20336
|
+
* @param a
|
|
20337
|
+
*/
|
|
20338
|
+
function quux () {}
|
|
20339
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20340
|
+
|
|
20341
|
+
/**
|
|
20342
|
+
* @def
|
|
20343
|
+
* @xyz
|
|
20344
|
+
* @abc
|
|
20345
|
+
*/
|
|
20346
|
+
function quux () {}
|
|
20347
|
+
// "jsdoc/sort-tags": ["error"|"warn", {"alphabetizeExtras":true}]
|
|
20348
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20349
|
+
|
|
20350
|
+
/**
|
|
20351
|
+
* @xyz
|
|
20352
|
+
* @def
|
|
20353
|
+
* @abc
|
|
20354
|
+
*/
|
|
20355
|
+
function quux () {}
|
|
20356
|
+
// "jsdoc/sort-tags": ["error"|"warn", {"tagSequence":["def","xyz","abc"]}]
|
|
20357
|
+
// Message: Tags are not in the prescribed order: def, xyz, abc
|
|
20358
|
+
|
|
20359
|
+
/**
|
|
20360
|
+
* @returns {string}
|
|
20361
|
+
* @ignore
|
|
20362
|
+
* @param b A long
|
|
20363
|
+
* description
|
|
20364
|
+
* @param a
|
|
20365
|
+
* @module
|
|
20366
|
+
*/
|
|
20367
|
+
function quux () {}
|
|
20368
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20369
|
+
|
|
20370
|
+
/**
|
|
20371
|
+
* @xyz
|
|
20372
|
+
* @abc
|
|
20373
|
+
* @abc
|
|
20374
|
+
* @def
|
|
20375
|
+
* @xyz
|
|
20376
|
+
*/
|
|
20377
|
+
function quux () {}
|
|
20378
|
+
// "jsdoc/sort-tags": ["error"|"warn", {"alphabetizeExtras":true}]
|
|
20379
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20380
|
+
|
|
20381
|
+
/**
|
|
20382
|
+
* @param b A long
|
|
20383
|
+
* description
|
|
20384
|
+
* @module
|
|
20385
|
+
*/
|
|
20386
|
+
function quux () {}
|
|
20387
|
+
// Message: Tags are not in the prescribed order: summary, typeSummary, module, exports, file, fileoverview, overview, typedef, interface, record, template, name, kind, type, alias, external, host, callback, func, function, method, class, constructor, modifies, mixes, mixin, mixinClass, mixinFunction, namespace, borrows, constructs, lends, implements, requires, desc, description, classdesc, tutorial, copyright, license, const, constant, final, global, readonly, abstract, virtual, var, member, memberof, memberof!, inner, instance, inheritdoc, inheritDoc, override, hideconstructor, param, arg, argument, prop, property, return, returns, async, generator, default, defaultvalue, enum, augments, extends, throws, exception, yield, yields, event, fires, emits, listens, this, static, private, protected, public, access, package, -other, see, example, closurePrimitive, customElement, expose, hidden, idGenerator, meaning, ngInject, owner, wizaction, define, dict, export, externs, implicitCast, noalias, nocollapse, nocompile, noinline, nosideeffects, polymer, polymerBehavior, preserve, struct, suppress, unrestricted, category, ignore, author, version, variation, since, deprecated, todo
|
|
20388
|
+
````
|
|
20389
|
+
|
|
20390
|
+
The following patterns are not considered problems:
|
|
20391
|
+
|
|
20392
|
+
````js
|
|
20393
|
+
/**
|
|
20394
|
+
* @param b
|
|
20395
|
+
* @param a
|
|
20396
|
+
* @returns {string}
|
|
20397
|
+
*/
|
|
20398
|
+
function quux () {}
|
|
20399
|
+
|
|
20400
|
+
/**
|
|
20401
|
+
* @abc
|
|
20402
|
+
* @def
|
|
20403
|
+
* @xyz
|
|
20404
|
+
*/
|
|
20405
|
+
function quux () {}
|
|
20406
|
+
// "jsdoc/sort-tags": ["error"|"warn", {"alphabetizeExtras":true}]
|
|
20407
|
+
|
|
20408
|
+
/**
|
|
20409
|
+
* @def
|
|
20410
|
+
* @xyz
|
|
20411
|
+
* @abc
|
|
20412
|
+
*/
|
|
20413
|
+
function quux () {}
|
|
20414
|
+
// "jsdoc/sort-tags": ["error"|"warn", {"alphabetizeExtras":false}]
|
|
20415
|
+
|
|
20416
|
+
/**
|
|
20417
|
+
* @def
|
|
20418
|
+
* @xyz
|
|
20419
|
+
* @abc
|
|
20420
|
+
*/
|
|
20421
|
+
function quux () {}
|
|
20422
|
+
// "jsdoc/sort-tags": ["error"|"warn", {"tagSequence":["def","xyz","abc"]}]
|
|
20423
|
+
|
|
20424
|
+
/** @def */
|
|
20425
|
+
function quux () {}
|
|
20426
|
+
````
|
|
20427
|
+
|
|
20428
|
+
|
|
20059
20429
|
<a name="eslint-plugin-jsdoc-rules-tag-lines"></a>
|
|
20060
20430
|
### <code>tag-lines</code>
|
|
20061
20431
|
|
|
20062
20432
|
Enforces lines (or no lines) between tags.
|
|
20063
20433
|
|
|
20064
|
-
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-
|
|
20434
|
+
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-41"></a>
|
|
20065
20435
|
#### Options
|
|
20066
20436
|
|
|
20067
20437
|
The first option is a single string set to "always", "never", or "any"
|
|
@@ -20072,18 +20442,18 @@ for particular tags).
|
|
|
20072
20442
|
|
|
20073
20443
|
The second option is an object with the following optional properties.
|
|
20074
20444
|
|
|
20075
|
-
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-
|
|
20445
|
+
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-41-count-defaults-to-1"></a>
|
|
20076
20446
|
##### <code>count</code> (defaults to 1)
|
|
20077
20447
|
|
|
20078
20448
|
Use with "always" to indicate the number of lines to require be present.
|
|
20079
20449
|
|
|
20080
|
-
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-
|
|
20450
|
+
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-41-noendlines-defaults-to-false"></a>
|
|
20081
20451
|
##### <code>noEndLines</code> (defaults to <code>false</code>)
|
|
20082
20452
|
|
|
20083
20453
|
Use with "always" to indicate the normal lines to be added after tags should
|
|
20084
20454
|
not be added after the final tag.
|
|
20085
20455
|
|
|
20086
|
-
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-
|
|
20456
|
+
<a name="eslint-plugin-jsdoc-rules-tag-lines-options-41-tags-default-to-empty-object"></a>
|
|
20087
20457
|
##### <code>tags</code> (default to empty object)
|
|
20088
20458
|
|
|
20089
20459
|
Overrides the default behavior depending on specific tags.
|
|
@@ -20479,7 +20849,7 @@ for valid types (based on the tag's `type` value), and either portion checked
|
|
|
20479
20849
|
for presence (based on `false` `name` or `type` values or their `required`
|
|
20480
20850
|
value). See the setting for more details.
|
|
20481
20851
|
|
|
20482
|
-
<a name="eslint-plugin-jsdoc-rules-valid-types-options-
|
|
20852
|
+
<a name="eslint-plugin-jsdoc-rules-valid-types-options-42"></a>
|
|
20483
20853
|
#### Options
|
|
20484
20854
|
|
|
20485
20855
|
- `allowEmptyNamepaths` (default: true) - Set to `false` to bulk disallow
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const defaultTagOrder = [// Brief descriptions
|
|
8
|
+
'summary', 'typeSummary', // Module/file-level
|
|
9
|
+
'module', 'exports', 'file', 'fileoverview', 'overview', // Identifying (name, type)
|
|
10
|
+
'typedef', 'interface', 'record', 'template', 'name', 'kind', 'type', 'alias', 'external', 'host', 'callback', 'func', 'function', 'method', 'class', 'constructor', // Relationships
|
|
11
|
+
'modifies', 'mixes', 'mixin', 'mixinClass', 'mixinFunction', 'namespace', 'borrows', 'constructs', 'lends', 'implements', 'requires', // Long descriptions
|
|
12
|
+
'desc', 'description', 'classdesc', 'tutorial', 'copyright', 'license', // Simple annotations
|
|
13
|
+
'const', 'constant', 'final', 'global', 'readonly', 'abstract', 'virtual', 'var', 'member', 'memberof', 'memberof!', 'inner', 'instance', 'inheritdoc', 'inheritDoc', 'override', 'hideconstructor', // Core function/object info
|
|
14
|
+
'param', 'arg', 'argument', 'prop', 'property', 'return', 'returns', // Important behavior details
|
|
15
|
+
'async', 'generator', 'default', 'defaultvalue', 'enum', 'augments', 'extends', 'throws', 'exception', 'yield', 'yields', 'event', 'fires', 'emits', 'listens', 'this', // Access
|
|
16
|
+
'static', 'private', 'protected', 'public', 'access', 'package', '-other', // Supplementary descriptions
|
|
17
|
+
'see', 'example', // METADATA
|
|
18
|
+
// Other Closure (undocumented) metadata
|
|
19
|
+
'closurePrimitive', 'customElement', 'expose', 'hidden', 'idGenerator', 'meaning', 'ngInject', 'owner', 'wizaction', // Other Closure (documented) metadata
|
|
20
|
+
'define', 'dict', 'export', 'externs', 'implicitCast', 'noalias', 'nocollapse', 'nocompile', 'noinline', 'nosideeffects', 'polymer', 'polymerBehavior', 'preserve', 'struct', 'suppress', 'unrestricted', // @homer0/prettier-plugin-jsdoc metadata
|
|
21
|
+
'category', // Non-Closure metadata
|
|
22
|
+
'ignore', 'author', 'version', 'variation', 'since', 'deprecated', 'todo'];
|
|
23
|
+
var _default = defaultTagOrder;
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
module.exports = exports.default;
|
|
26
|
+
//# sourceMappingURL=defaultTagOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/defaultTagOrder.js"],"names":["defaultTagOrder"],"mappings":";;;;;;AAAA,MAAMA,eAAe,GAAG,CACtB;AACA,SAFsB,EAGtB,aAHsB,EAKtB;AACA,QANsB,EAOtB,SAPsB,EAQtB,MARsB,EAStB,cATsB,EAUtB,UAVsB,EAYtB;AACA,SAbsB,EActB,WAdsB,EAetB,QAfsB,EAgBtB,UAhBsB,EAiBtB,MAjBsB,EAkBtB,MAlBsB,EAmBtB,MAnBsB,EAoBtB,OApBsB,EAqBtB,UArBsB,EAsBtB,MAtBsB,EAuBtB,UAvBsB,EAwBtB,MAxBsB,EAyBtB,UAzBsB,EA0BtB,QA1BsB,EA2BtB,OA3BsB,EA4BtB,aA5BsB,EA8BtB;AACA,UA/BsB,EAgCtB,OAhCsB,EAiCtB,OAjCsB,EAkCtB,YAlCsB,EAmCtB,eAnCsB,EAoCtB,WApCsB,EAqCtB,SArCsB,EAsCtB,YAtCsB,EAuCtB,OAvCsB,EAwCtB,YAxCsB,EAyCtB,UAzCsB,EA2CtB;AACA,MA5CsB,EA6CtB,aA7CsB,EA8CtB,WA9CsB,EA+CtB,UA/CsB,EAgDtB,WAhDsB,EAiDtB,SAjDsB,EAmDtB;AACA,OApDsB,EAqDtB,UArDsB,EAsDtB,OAtDsB,EAuDtB,QAvDsB,EAwDtB,UAxDsB,EAyDtB,UAzDsB,EA0DtB,SA1DsB,EA2DtB,KA3DsB,EA4DtB,QA5DsB,EA6DtB,UA7DsB,EA8DtB,WA9DsB,EA+DtB,OA/DsB,EAgEtB,UAhEsB,EAiEtB,YAjEsB,EAkEtB,YAlEsB,EAmEtB,UAnEsB,EAoEtB,iBApEsB,EAsEtB;AACA,OAvEsB,EAwEtB,KAxEsB,EAyEtB,UAzEsB,EA0EtB,MA1EsB,EA2EtB,UA3EsB,EA4EtB,QA5EsB,EA6EtB,SA7EsB,EA+EtB;AACA,OAhFsB,EAiFtB,WAjFsB,EAkFtB,SAlFsB,EAmFtB,cAnFsB,EAoFtB,MApFsB,EAqFtB,UArFsB,EAsFtB,SAtFsB,EAuFtB,QAvFsB,EAwFtB,WAxFsB,EAyFtB,OAzFsB,EA0FtB,QA1FsB,EA2FtB,OA3FsB,EA4FtB,OA5FsB,EA6FtB,OA7FsB,EA8FtB,SA9FsB,EA+FtB,MA/FsB,EAiGtB;AACA,QAlGsB,EAmGtB,SAnGsB,EAoGtB,WApGsB,EAqGtB,QArGsB,EAsGtB,QAtGsB,EAuGtB,SAvGsB,EAyGtB,QAzGsB,EA2GtB;AACA,KA5GsB,EA6GtB,SA7GsB,EA+GtB;AAEA;AACA,kBAlHsB,EAmHtB,eAnHsB,EAoHtB,QApHsB,EAqHtB,QArHsB,EAsHtB,aAtHsB,EAuHtB,SAvHsB,EAwHtB,UAxHsB,EAyHtB,OAzHsB,EA0HtB,WA1HsB,EA4HtB;AACA,QA7HsB,EA8HtB,MA9HsB,EA+HtB,QA/HsB,EAgItB,SAhIsB,EAiItB,cAjIsB,EAkItB,SAlIsB,EAmItB,YAnIsB,EAoItB,WApIsB,EAqItB,UArIsB,EAsItB,eAtIsB,EAuItB,SAvIsB,EAwItB,iBAxIsB,EAyItB,UAzIsB,EA0ItB,QA1IsB,EA2ItB,UA3IsB,EA4ItB,cA5IsB,EA8ItB;AACA,UA/IsB,EAiJtB;AACA,QAlJsB,EAmJtB,QAnJsB,EAoJtB,SApJsB,EAqJtB,WArJsB,EAsJtB,OAtJsB,EAuJtB,YAvJsB,EAwJtB,MAxJsB,CAAxB;eA2JeA,e","sourcesContent":["const defaultTagOrder = [\n // Brief descriptions\n 'summary',\n 'typeSummary',\n\n // Module/file-level\n 'module',\n 'exports',\n 'file',\n 'fileoverview',\n 'overview',\n\n // Identifying (name, type)\n 'typedef',\n 'interface',\n 'record',\n 'template',\n 'name',\n 'kind',\n 'type',\n 'alias',\n 'external',\n 'host',\n 'callback',\n 'func',\n 'function',\n 'method',\n 'class',\n 'constructor',\n\n // Relationships\n 'modifies',\n 'mixes',\n 'mixin',\n 'mixinClass',\n 'mixinFunction',\n 'namespace',\n 'borrows',\n 'constructs',\n 'lends',\n 'implements',\n 'requires',\n\n // Long descriptions\n 'desc',\n 'description',\n 'classdesc',\n 'tutorial',\n 'copyright',\n 'license',\n\n // Simple annotations\n 'const',\n 'constant',\n 'final',\n 'global',\n 'readonly',\n 'abstract',\n 'virtual',\n 'var',\n 'member',\n 'memberof',\n 'memberof!',\n 'inner',\n 'instance',\n 'inheritdoc',\n 'inheritDoc',\n 'override',\n 'hideconstructor',\n\n // Core function/object info\n 'param',\n 'arg',\n 'argument',\n 'prop',\n 'property',\n 'return',\n 'returns',\n\n // Important behavior details\n 'async',\n 'generator',\n 'default',\n 'defaultvalue',\n 'enum',\n 'augments',\n 'extends',\n 'throws',\n 'exception',\n 'yield',\n 'yields',\n 'event',\n 'fires',\n 'emits',\n 'listens',\n 'this',\n\n // Access\n 'static',\n 'private',\n 'protected',\n 'public',\n 'access',\n 'package',\n\n '-other',\n\n // Supplementary descriptions\n 'see',\n 'example',\n\n // METADATA\n\n // Other Closure (undocumented) metadata\n 'closurePrimitive',\n 'customElement',\n 'expose',\n 'hidden',\n 'idGenerator',\n 'meaning',\n 'ngInject',\n 'owner',\n 'wizaction',\n\n // Other Closure (documented) metadata\n 'define',\n 'dict',\n 'export',\n 'externs',\n 'implicitCast',\n 'noalias',\n 'nocollapse',\n 'nocompile',\n 'noinline',\n 'nosideeffects',\n 'polymer',\n 'polymerBehavior',\n 'preserve',\n 'struct',\n 'suppress',\n 'unrestricted',\n\n // @homer0/prettier-plugin-jsdoc metadata\n 'category',\n\n // Non-Closure metadata\n 'ignore',\n 'author',\n 'version',\n 'variation',\n 'since',\n 'deprecated',\n 'todo',\n];\n\nexport default defaultTagOrder;\n"],"file":"defaultTagOrder.js"}
|
|
@@ -10,6 +10,7 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
10
10
|
const isClosure = mode === 'closure';
|
|
11
11
|
const isTypescript = mode === 'typescript';
|
|
12
12
|
const isPermissive = mode === 'permissive';
|
|
13
|
+
const isJsdocOrPermissive = isJsdoc || isPermissive;
|
|
13
14
|
const isJsdocOrTypescript = isJsdoc || isTypescript;
|
|
14
15
|
const isTypescriptOrClosure = isTypescript || isClosure;
|
|
15
16
|
const isClosureOrPermissive = isClosure || isPermissive;
|
|
@@ -53,7 +54,8 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
53
54
|
// seems to require both, and as "namepath"'s
|
|
54
55
|
['nameContents', 'namepath-referencing'], // "namepath"
|
|
55
56
|
['typeOrNameRequired', true]])], ['callback', new Map([// Seems to require a "namepath" in the signature (with no
|
|
56
|
-
// counter-examples)
|
|
57
|
+
// counter-examples); TypeScript does not enforce but seems
|
|
58
|
+
// problematic as not attached so presumably not useable without it
|
|
57
59
|
['nameContents', 'namepath-defining'], // "namepath"
|
|
58
60
|
['nameRequired', true]])], ['class', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
59
61
|
['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['const', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
@@ -151,10 +153,15 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
151
153
|
// "typeName"
|
|
152
154
|
['typeRequired', true]])], ['typedef', new Map([// Seems to require a "namepath" in the signature (with no
|
|
153
155
|
// counter-examples)
|
|
154
|
-
['nameContents', 'namepath-defining'], //
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
['
|
|
156
|
+
['nameContents', 'namepath-defining'], // TypeScript may allow it to be dropped if followed by @property or @member;
|
|
157
|
+
// also shown as missing in Closure
|
|
158
|
+
// "namepath"
|
|
159
|
+
['nameRequired', isJsdocOrPermissive], // Is not `typeRequired` for TypeScript because it gives an error:
|
|
160
|
+
// JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.
|
|
161
|
+
// Has example showing curly brackets but not in doc signature
|
|
162
|
+
['typeAllowed', true], // TypeScript may allow it to be dropped if followed by @property or @member
|
|
163
|
+
// "namepath"
|
|
164
|
+
['typeOrNameRequired', !isTypescript]])], ['var', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
158
165
|
['nameContents', 'namepath-defining'], // Has example showing curly brackets but not in doc signature
|
|
159
166
|
['typeAllowed', true]])], ['yields', new Map([// Shows curly brackets in the signature and in the examples
|
|
160
167
|
['typeAllowed', true]])], ['yield', new Map([// Shows curly brackets in the signature and in the examples
|