eslint-plugin-jsdoc 46.4.6 → 46.5.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/README.md +31 -0
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/jsdocUtils.js +1 -1
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/matchDescription.js +1 -1
- package/dist/rules/matchDescription.js.map +1 -1
- package/package.json +14 -12
- package/dist/WarnSettings.d.ts +0 -17
- package/dist/WarnSettings.d.ts.map +0 -1
- package/dist/alignTransform.d.ts +0 -32
- package/dist/alignTransform.d.ts.map +0 -1
- package/dist/defaultTagOrder.d.ts +0 -5
- package/dist/defaultTagOrder.d.ts.map +0 -1
- package/dist/exportParser.d.ts +0 -41
- package/dist/exportParser.d.ts.map +0 -1
- package/dist/getDefaultTagStructureForMode.d.ts +0 -11
- package/dist/getDefaultTagStructureForMode.d.ts.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/iterateJsdoc.d.ts +0 -460
- package/dist/iterateJsdoc.d.ts.map +0 -1
- package/dist/jsdocUtils.d.ts +0 -421
- package/dist/jsdocUtils.d.ts.map +0 -1
- package/dist/rules/checkAccess.d.ts +0 -3
- package/dist/rules/checkAccess.d.ts.map +0 -1
- package/dist/rules/checkAlignment.d.ts +0 -3
- package/dist/rules/checkAlignment.d.ts.map +0 -1
- package/dist/rules/checkExamples.d.ts +0 -4
- package/dist/rules/checkExamples.d.ts.map +0 -1
- package/dist/rules/checkIndentation.d.ts +0 -3
- package/dist/rules/checkIndentation.d.ts.map +0 -1
- package/dist/rules/checkLineAlignment.d.ts +0 -10
- package/dist/rules/checkLineAlignment.d.ts.map +0 -1
- package/dist/rules/checkParamNames.d.ts +0 -3
- package/dist/rules/checkParamNames.d.ts.map +0 -1
- package/dist/rules/checkPropertyNames.d.ts +0 -3
- package/dist/rules/checkPropertyNames.d.ts.map +0 -1
- package/dist/rules/checkSyntax.d.ts +0 -3
- package/dist/rules/checkSyntax.d.ts.map +0 -1
- package/dist/rules/checkTagNames.d.ts +0 -3
- package/dist/rules/checkTagNames.d.ts.map +0 -1
- package/dist/rules/checkTypes.d.ts +0 -3
- package/dist/rules/checkTypes.d.ts.map +0 -1
- package/dist/rules/checkValues.d.ts +0 -3
- package/dist/rules/checkValues.d.ts.map +0 -1
- package/dist/rules/emptyTags.d.ts +0 -3
- package/dist/rules/emptyTags.d.ts.map +0 -1
- package/dist/rules/implementsOnClasses.d.ts +0 -3
- package/dist/rules/implementsOnClasses.d.ts.map +0 -1
- package/dist/rules/importsAsDependencies.d.ts +0 -3
- package/dist/rules/importsAsDependencies.d.ts.map +0 -1
- package/dist/rules/informativeDocs.d.ts +0 -3
- package/dist/rules/informativeDocs.d.ts.map +0 -1
- package/dist/rules/matchDescription.d.ts +0 -3
- package/dist/rules/matchDescription.d.ts.map +0 -1
- package/dist/rules/matchName.d.ts +0 -3
- package/dist/rules/matchName.d.ts.map +0 -1
- package/dist/rules/multilineBlocks.d.ts +0 -3
- package/dist/rules/multilineBlocks.d.ts.map +0 -1
- package/dist/rules/noBadBlocks.d.ts +0 -3
- package/dist/rules/noBadBlocks.d.ts.map +0 -1
- package/dist/rules/noBlankBlockDescriptions.d.ts +0 -3
- package/dist/rules/noBlankBlockDescriptions.d.ts.map +0 -1
- package/dist/rules/noBlankBlocks.d.ts +0 -3
- package/dist/rules/noBlankBlocks.d.ts.map +0 -1
- package/dist/rules/noDefaults.d.ts +0 -3
- package/dist/rules/noDefaults.d.ts.map +0 -1
- package/dist/rules/noMissingSyntax.d.ts +0 -10
- package/dist/rules/noMissingSyntax.d.ts.map +0 -1
- package/dist/rules/noMultiAsterisks.d.ts +0 -3
- package/dist/rules/noMultiAsterisks.d.ts.map +0 -1
- package/dist/rules/noRestrictedSyntax.d.ts +0 -3
- package/dist/rules/noRestrictedSyntax.d.ts.map +0 -1
- package/dist/rules/noTypes.d.ts +0 -3
- package/dist/rules/noTypes.d.ts.map +0 -1
- package/dist/rules/noUndefinedTypes.d.ts +0 -3
- package/dist/rules/noUndefinedTypes.d.ts.map +0 -1
- package/dist/rules/requireAsteriskPrefix.d.ts +0 -3
- package/dist/rules/requireAsteriskPrefix.d.ts.map +0 -1
- package/dist/rules/requireDescription.d.ts +0 -3
- package/dist/rules/requireDescription.d.ts.map +0 -1
- package/dist/rules/requireDescriptionCompleteSentence.d.ts +0 -3
- package/dist/rules/requireDescriptionCompleteSentence.d.ts.map +0 -1
- package/dist/rules/requireExample.d.ts +0 -3
- package/dist/rules/requireExample.d.ts.map +0 -1
- package/dist/rules/requireFileOverview.d.ts +0 -3
- package/dist/rules/requireFileOverview.d.ts.map +0 -1
- package/dist/rules/requireHyphenBeforeParamDescription.d.ts +0 -3
- package/dist/rules/requireHyphenBeforeParamDescription.d.ts.map +0 -1
- package/dist/rules/requireJsdoc.d.ts +0 -9
- package/dist/rules/requireJsdoc.d.ts.map +0 -1
- package/dist/rules/requireParam.d.ts +0 -4
- package/dist/rules/requireParam.d.ts.map +0 -1
- package/dist/rules/requireParamDescription.d.ts +0 -3
- package/dist/rules/requireParamDescription.d.ts.map +0 -1
- package/dist/rules/requireParamName.d.ts +0 -3
- package/dist/rules/requireParamName.d.ts.map +0 -1
- package/dist/rules/requireParamType.d.ts +0 -3
- package/dist/rules/requireParamType.d.ts.map +0 -1
- package/dist/rules/requireProperty.d.ts +0 -3
- package/dist/rules/requireProperty.d.ts.map +0 -1
- package/dist/rules/requirePropertyDescription.d.ts +0 -3
- package/dist/rules/requirePropertyDescription.d.ts.map +0 -1
- package/dist/rules/requirePropertyName.d.ts +0 -3
- package/dist/rules/requirePropertyName.d.ts.map +0 -1
- package/dist/rules/requirePropertyType.d.ts +0 -3
- package/dist/rules/requirePropertyType.d.ts.map +0 -1
- package/dist/rules/requireReturns.d.ts +0 -3
- package/dist/rules/requireReturns.d.ts.map +0 -1
- package/dist/rules/requireReturnsCheck.d.ts +0 -3
- package/dist/rules/requireReturnsCheck.d.ts.map +0 -1
- package/dist/rules/requireReturnsDescription.d.ts +0 -3
- package/dist/rules/requireReturnsDescription.d.ts.map +0 -1
- package/dist/rules/requireReturnsType.d.ts +0 -3
- package/dist/rules/requireReturnsType.d.ts.map +0 -1
- package/dist/rules/requireThrows.d.ts +0 -3
- package/dist/rules/requireThrows.d.ts.map +0 -1
- package/dist/rules/requireYields.d.ts +0 -3
- package/dist/rules/requireYields.d.ts.map +0 -1
- package/dist/rules/requireYieldsCheck.d.ts +0 -3
- package/dist/rules/requireYieldsCheck.d.ts.map +0 -1
- package/dist/rules/sortTags.d.ts +0 -3
- package/dist/rules/sortTags.d.ts.map +0 -1
- package/dist/rules/tagLines.d.ts +0 -3
- package/dist/rules/tagLines.d.ts.map +0 -1
- package/dist/rules/textEscaping.d.ts +0 -3
- package/dist/rules/textEscaping.d.ts.map +0 -1
- package/dist/rules/validTypes.d.ts +0 -3
- package/dist/rules/validTypes.d.ts.map +0 -1
- package/dist/tagNames.d.ts +0 -16
- package/dist/tagNames.d.ts.map +0 -1
- package/dist/utils/hasReturnValue.d.ts +0 -20
- package/dist/utils/hasReturnValue.d.ts.map +0 -1
- package/docs/advanced.md +0 -102
- package/docs/rules/check-access.md +0 -193
- package/docs/rules/check-alignment.md +0 -169
- package/docs/rules/check-examples.md +0 -784
- package/docs/rules/check-indentation.md +0 -296
- package/docs/rules/check-line-alignment.md +0 -1002
- package/docs/rules/check-param-names.md +0 -1035
- package/docs/rules/check-property-names.md +0 -244
- package/docs/rules/check-syntax.md +0 -80
- package/docs/rules/check-tag-names.md +0 -1132
- package/docs/rules/check-types.md +0 -1198
- package/docs/rules/check-values.md +0 -409
- package/docs/rules/empty-tags.md +0 -220
- package/docs/rules/implements-on-classes.md +0 -219
- package/docs/rules/imports-as-dependencies.md +0 -99
- package/docs/rules/informative-docs.md +0 -400
- package/docs/rules/match-description.md +0 -1008
- package/docs/rules/match-name.md +0 -249
- package/docs/rules/multiline-blocks.md +0 -398
- package/docs/rules/no-bad-blocks.md +0 -174
- package/docs/rules/no-blank-block-descriptions.md +0 -91
- package/docs/rules/no-blank-blocks.md +0 -98
- package/docs/rules/no-defaults.md +0 -207
- package/docs/rules/no-missing-syntax.md +0 -275
- package/docs/rules/no-multi-asterisks.md +0 -278
- package/docs/rules/no-restricted-syntax.md +0 -383
- package/docs/rules/no-types.md +0 -168
- package/docs/rules/no-undefined-types.md +0 -789
- package/docs/rules/require-asterisk-prefix.md +0 -297
- package/docs/rules/require-description-complete-sentence.md +0 -820
- package/docs/rules/require-description.md +0 -585
- package/docs/rules/require-example.md +0 -390
- package/docs/rules/require-file-overview.md +0 -324
- package/docs/rules/require-hyphen-before-param-description.md +0 -281
- package/docs/rules/require-jsdoc.md +0 -1857
- package/docs/rules/require-param-description.md +0 -238
- package/docs/rules/require-param-name.md +0 -163
- package/docs/rules/require-param-type.md +0 -227
- package/docs/rules/require-param.md +0 -1820
- package/docs/rules/require-property-description.md +0 -88
- package/docs/rules/require-property-name.md +0 -79
- package/docs/rules/require-property-type.md +0 -79
- package/docs/rules/require-property.md +0 -128
- package/docs/rules/require-returns-check.md +0 -1053
- package/docs/rules/require-returns-description.md +0 -181
- package/docs/rules/require-returns-type.md +0 -144
- package/docs/rules/require-returns.md +0 -1191
- package/docs/rules/require-throws.md +0 -326
- package/docs/rules/require-yields-check.md +0 -544
- package/docs/rules/require-yields.md +0 -823
- package/docs/rules/sort-tags.md +0 -635
- package/docs/rules/tag-lines.md +0 -551
- package/docs/rules/text-escaping.md +0 -177
- package/docs/rules/valid-types.md +0 -881
- package/docs/settings.md +0 -362
- package/tsconfig-prod.json +0 -20
- package/tsconfig.json +0 -21
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noMultiAsterisks.d.ts","sourceRoot":"","sources":["../../src/rules/noMultiAsterisks.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noRestrictedSyntax.d.ts","sourceRoot":"","sources":["../../src/rules/noRestrictedSyntax.js"],"names":[],"mappings":""}
|
package/dist/rules/noTypes.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noTypes.d.ts","sourceRoot":"","sources":["../../src/rules/noTypes.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noUndefinedTypes.d.ts","sourceRoot":"","sources":["../../src/rules/noUndefinedTypes.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireAsteriskPrefix.d.ts","sourceRoot":"","sources":["../../src/rules/requireAsteriskPrefix.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireDescription.d.ts","sourceRoot":"","sources":["../../src/rules/requireDescription.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireDescriptionCompleteSentence.d.ts","sourceRoot":"","sources":["../../src/rules/requireDescriptionCompleteSentence.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireExample.d.ts","sourceRoot":"","sources":["../../src/rules/requireExample.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireFileOverview.d.ts","sourceRoot":"","sources":["../../src/rules/requireFileOverview.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireHyphenBeforeParamDescription.d.ts","sourceRoot":"","sources":["../../src/rules/requireHyphenBeforeParamDescription.js"],"names":[],"mappings":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const _default: import('eslint').Rule.RuleModule;
|
|
2
|
-
export default _default;
|
|
3
|
-
export type RequireJsdocOpts = {
|
|
4
|
-
ancestorsOnly: boolean;
|
|
5
|
-
esm: boolean;
|
|
6
|
-
initModuleExports: boolean;
|
|
7
|
-
initWindow: boolean;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=requireJsdoc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireJsdoc.d.ts","sourceRoot":"","sources":["../../src/rules/requireJsdoc.js"],"names":[],"mappings":"wBA+RW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU;;+BAnR9B;IACZ,aAAiB,EAAE,OAAO,CAAC;IAC3B,GAAO,EAAE,OAAO,CAAC;IACjB,iBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAc,EAAE,OAAO,CAAA;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireParam.d.ts","sourceRoot":"","sources":["../../src/rules/requireParam.js"],"names":[],"mappings":";;8BAGa,CAAC,MAAM,EAAE,OAAO,EAAE,8CAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireParamDescription.d.ts","sourceRoot":"","sources":["../../src/rules/requireParamDescription.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireParamName.d.ts","sourceRoot":"","sources":["../../src/rules/requireParamName.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireParamType.d.ts","sourceRoot":"","sources":["../../src/rules/requireParamType.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireProperty.d.ts","sourceRoot":"","sources":["../../src/rules/requireProperty.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requirePropertyDescription.d.ts","sourceRoot":"","sources":["../../src/rules/requirePropertyDescription.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requirePropertyName.d.ts","sourceRoot":"","sources":["../../src/rules/requirePropertyName.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requirePropertyType.d.ts","sourceRoot":"","sources":["../../src/rules/requirePropertyType.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireReturns.d.ts","sourceRoot":"","sources":["../../src/rules/requireReturns.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireReturnsCheck.d.ts","sourceRoot":"","sources":["../../src/rules/requireReturnsCheck.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireReturnsDescription.d.ts","sourceRoot":"","sources":["../../src/rules/requireReturnsDescription.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireReturnsType.d.ts","sourceRoot":"","sources":["../../src/rules/requireReturnsType.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireThrows.d.ts","sourceRoot":"","sources":["../../src/rules/requireThrows.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireYields.d.ts","sourceRoot":"","sources":["../../src/rules/requireYields.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requireYieldsCheck.d.ts","sourceRoot":"","sources":["../../src/rules/requireYieldsCheck.js"],"names":[],"mappings":""}
|
package/dist/rules/sortTags.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sortTags.d.ts","sourceRoot":"","sources":["../../src/rules/sortTags.js"],"names":[],"mappings":""}
|
package/dist/rules/tagLines.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tagLines.d.ts","sourceRoot":"","sources":["../../src/rules/tagLines.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textEscaping.d.ts","sourceRoot":"","sources":["../../src/rules/textEscaping.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validTypes.d.ts","sourceRoot":"","sources":["../../src/rules/validTypes.js"],"names":[],"mappings":""}
|
package/dist/tagNames.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type AliasedTags = {
|
|
2
|
-
[key: string]: string[];
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* @type {AliasedTags}
|
|
6
|
-
*/
|
|
7
|
-
export const closureTags: AliasedTags;
|
|
8
|
-
/**
|
|
9
|
-
* @type {AliasedTags}
|
|
10
|
-
*/
|
|
11
|
-
export const jsdocTags: AliasedTags;
|
|
12
|
-
/**
|
|
13
|
-
* @type {AliasedTags}
|
|
14
|
-
*/
|
|
15
|
-
export const typeScriptTags: AliasedTags;
|
|
16
|
-
//# sourceMappingURL=tagNames.d.ts.map
|
package/dist/tagNames.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tagNames.d.ts","sourceRoot":"","sources":["../src/tagNames.js"],"names":[],"mappings":";;;AAyLA;;GAEG;AACH,0BAFU,WAAW,CAyCnB;AAnNF;;GAEG;AACH,wBAFU,WAAW,CAiHnB;AAEF;;GAEG;AACH,6BAFU,WAAW,CAiBnB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type ESTreeOrTypeScriptNode = import('estree').Node | any;
|
|
2
|
-
export type PromiseFilter = (node: ESTreeOrTypeScriptNode | undefined) => boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Checks if a node has a return statement. Void return does not count.
|
|
5
|
-
* @param {ESTreeOrTypeScriptNode|undefined|null} node
|
|
6
|
-
* @param {boolean} [throwOnNullReturn]
|
|
7
|
-
* @param {PromiseFilter} [promFilter]
|
|
8
|
-
* @returns {boolean|undefined}
|
|
9
|
-
*/
|
|
10
|
-
export function hasReturnValue(node: ESTreeOrTypeScriptNode | undefined | null, throwOnNullReturn?: boolean | undefined, promFilter?: PromiseFilter | undefined): boolean | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Checks if a Promise executor has no resolve value or an empty value.
|
|
13
|
-
* An `undefined` resolve does not count.
|
|
14
|
-
* @param {ESTreeOrTypeScriptNode} node
|
|
15
|
-
* @param {boolean} anyPromiseAsReturn
|
|
16
|
-
* @param {boolean} [allBranches]
|
|
17
|
-
* @returns {boolean}
|
|
18
|
-
*/
|
|
19
|
-
export function hasValueOrExecutorHasNonEmptyResolveValue(node: ESTreeOrTypeScriptNode, anyPromiseAsReturn: boolean, allBranches?: boolean | undefined): boolean;
|
|
20
|
-
//# sourceMappingURL=hasReturnValue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasReturnValue.d.ts","sourceRoot":"","sources":["../../src/utils/hasReturnValue.js"],"names":[],"mappings":"qCACa,OAAO,QAAQ,EAAE,IAAI,MACmB;mCA0P1C,sBAAsB,GAAC,SAAS,KAC9B,OAAO;AA/NpB;;;;;;GAMG;AAEH,qCANW,sBAAsB,GAAC,SAAS,GAAC,IAAI,oFAGnC,OAAO,GAAC,SAAS,CAuF7B;AA4VD;;;;;;;GAOG;AACH,gEALW,sBAAsB,sBACtB,OAAO,sCAEL,OAAO,CAsEnB"}
|
package/docs/advanced.md
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<a name="user-content-advanced"></a>
|
|
2
|
-
<a name="advanced"></a>
|
|
3
|
-
## Advanced
|
|
4
|
-
|
|
5
|
-
* [AST and Selectors](#user-content-advanced-ast-and-selectors)
|
|
6
|
-
* [`contexts` format](#user-content-advanced-ast-and-selectors-contexts-format)
|
|
7
|
-
* [Discovering available AST definitions](#user-content-advanced-ast-and-selectors-discovering-available-ast-definitions)
|
|
8
|
-
* [Uses/Tips for AST](#user-content-advanced-ast-and-selectors-uses-tips-for-ast)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<a name="user-content-advanced-ast-and-selectors"></a>
|
|
12
|
-
<a name="advanced-ast-and-selectors"></a>
|
|
13
|
-
### AST and Selectors
|
|
14
|
-
|
|
15
|
-
For various rules, one can add to the environments to which the rule applies
|
|
16
|
-
by using the `contexts` option.
|
|
17
|
-
|
|
18
|
-
This option works with [ESLint's selectors](https://eslint.org/docs/developer-guide/selectors) which are [esquery](https://github.com/estools/esquery/#readme)
|
|
19
|
-
expressions one may use to target a specific node type or types, including
|
|
20
|
-
subsets of the type(s) such as nodes with certain children or attributes.
|
|
21
|
-
|
|
22
|
-
These expressions are used within ESLint plugins to find those parts of
|
|
23
|
-
your files' code which are of interest to check. However, in
|
|
24
|
-
`eslint-plugin-jsdoc`, we also allow you to use these selectors to define
|
|
25
|
-
additional contexts where you wish our own rules to be applied.
|
|
26
|
-
|
|
27
|
-
<a name="user-content-advanced-ast-and-selectors-contexts-format"></a>
|
|
28
|
-
<a name="advanced-ast-and-selectors-contexts-format"></a>
|
|
29
|
-
#### <code>contexts</code> format
|
|
30
|
-
|
|
31
|
-
While at their simplest, these can be an array of string selectors, one can
|
|
32
|
-
also supply an object with `context` (in place of the string) and one of two
|
|
33
|
-
properties:
|
|
34
|
-
|
|
35
|
-
1. For `require-jsdoc`, there are also `inlineCommentBlock` and
|
|
36
|
-
`minLineCount` properties. See that rule for details.
|
|
37
|
-
1. For `no-missing-syntax` and `no-restricted-syntax`, there is also a
|
|
38
|
-
`message` property which allows customization of the message to be shown
|
|
39
|
-
when the rule is triggered.
|
|
40
|
-
1. For `no-missing-syntax`, there is also a `minimum` property. See that rule.
|
|
41
|
-
1. For other rules, there is a `comment` property which adds to the `context`
|
|
42
|
-
in requiring that the `comment` AST condition is also met, e.g., to
|
|
43
|
-
require that certain tags are present and/or or types and type operators
|
|
44
|
-
are in use. Note that this AST (either for `Jsdoc*` or `JsdocType*` AST)
|
|
45
|
-
has not been standardized and should be considered experimental.
|
|
46
|
-
Note that this property might also become obsolete if parsers begin to
|
|
47
|
-
include JSDoc-structured AST. A
|
|
48
|
-
[parser](https://github.com/brettz9/jsdoc-eslint-parser/) is available
|
|
49
|
-
which aims to support comment AST as
|
|
50
|
-
a first class citizen where comment/comment types can be used anywhere
|
|
51
|
-
within a normal AST selector but this should only be considered
|
|
52
|
-
experimental. When using such a parser, you need not use `comment` and
|
|
53
|
-
can just use a plain string context. The determination of the node on
|
|
54
|
-
which the comment is attached is based more on actual location than
|
|
55
|
-
semantics (e.g., it will be attached to a `VariableDeclaration` if above
|
|
56
|
-
that rather than to the `FunctionExpression` it is fundamentally
|
|
57
|
-
describing). See
|
|
58
|
-
[@es-joy/jsdoccomment](https://github.com/es-joy/jsdoccomment)
|
|
59
|
-
for the precise structure of the comment (and comment type) nodes.
|
|
60
|
-
|
|
61
|
-
<a name="user-content-advanced-ast-and-selectors-discovering-available-ast-definitions"></a>
|
|
62
|
-
<a name="advanced-ast-and-selectors-discovering-available-ast-definitions"></a>
|
|
63
|
-
#### Discovering available AST definitions
|
|
64
|
-
|
|
65
|
-
To know all of the AST definitions one may target, it will depend on the
|
|
66
|
-
[parser](https://eslint.org/docs/user-guide/configuring#specifying-parser)
|
|
67
|
-
you are using with ESLint (e.g., `espree` is the default parser for ESLint,
|
|
68
|
-
and this follows [EStree AST](https://github.com/estree/estree) but
|
|
69
|
-
to support the the latest experimental features of JavaScript, one may use
|
|
70
|
-
`@babel/eslint-parser` or to be able to have one's rules (including JSDoc rules)
|
|
71
|
-
apply to TypeScript, one may use `@typescript-eslint/parser`, etc.
|
|
72
|
-
|
|
73
|
-
So you can look up a particular parser to see its rules, e.g., browse through
|
|
74
|
-
the [ESTree docs](https://github.com/estree/estree) as used by Espree or see
|
|
75
|
-
ESLint's [overview of the structure of AST](https://eslint.org/docs/developer-guide/working-with-custom-parsers#the-ast-specification).
|
|
76
|
-
|
|
77
|
-
However, it can sometimes be even more helpful to get an idea of AST by just
|
|
78
|
-
providing some of your JavaScript to the wonderful
|
|
79
|
-
[AST Explorer](https://astexplorer.net/) tool and see what AST is built out
|
|
80
|
-
of your code. You can set the tool to the specific parser which you are using.
|
|
81
|
-
|
|
82
|
-
<a name="user-content-advanced-ast-and-selectors-uses-tips-for-ast"></a>
|
|
83
|
-
<a name="advanced-ast-and-selectors-uses-tips-for-ast"></a>
|
|
84
|
-
#### Uses/Tips for AST
|
|
85
|
-
|
|
86
|
-
And if you wish to introspect on the AST of code within your projects, you can
|
|
87
|
-
use [eslint-plugin-query](https://github.com/brettz9/eslint-plugin-query).
|
|
88
|
-
Though it also works as a plugin, you can use it with its own CLI, e.g.,
|
|
89
|
-
to search your files for matching esquery selectors, optionally showing
|
|
90
|
-
it as AST JSON.
|
|
91
|
-
|
|
92
|
-
Tip: If you want to more deeply understand not just the resulting AST tree
|
|
93
|
-
structures for any given code but also the syntax for esquery selectors so
|
|
94
|
-
that you can, for example, find only those nodes with a child of a certain
|
|
95
|
-
type, you can set the "Transform" feature to ESLint and test out
|
|
96
|
-
esquery selectors in place of the selector expression (e.g., replace
|
|
97
|
-
`'VariableDeclaration > VariableDeclarator > Identifier[name="someVar"]'` as
|
|
98
|
-
we have
|
|
99
|
-
[here](https://astexplorer.net/#/gist/71a93130c19599d6f197bddb29c13a59/latest))
|
|
100
|
-
to the selector you wish so as to get messages reported in the bottom right
|
|
101
|
-
pane which match your [esquery](https://github.com/estools/esquery/#readme)
|
|
102
|
-
selector).
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
<a name="user-content-check-access"></a>
|
|
2
|
-
<a name="check-access"></a>
|
|
3
|
-
# <code>check-access</code>
|
|
4
|
-
|
|
5
|
-
* [Context and settings](#user-content-check-access-context-and-settings)
|
|
6
|
-
* [Failing examples](#user-content-check-access-failing-examples)
|
|
7
|
-
* [Passing examples](#user-content-check-access-passing-examples)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Checks that `@access` tags use one of the following values:
|
|
11
|
-
|
|
12
|
-
- "package", "private", "protected", "public"
|
|
13
|
-
|
|
14
|
-
Also reports:
|
|
15
|
-
|
|
16
|
-
- Mixing of `@access` with `@public`, `@private`, `@protected`, or `@package`
|
|
17
|
-
on the same doc block.
|
|
18
|
-
- Use of multiple instances of `@access` (or the `@public`, etc. style tags)
|
|
19
|
-
on the same doc block.
|
|
20
|
-
|
|
21
|
-
<a name="user-content-check-access-context-and-settings"></a>
|
|
22
|
-
<a name="check-access-context-and-settings"></a>
|
|
23
|
-
## Context and settings
|
|
24
|
-
|
|
25
|
-
|||
|
|
26
|
-
|---|---|
|
|
27
|
-
|Context|everywhere|
|
|
28
|
-
|Tags|`@access`|
|
|
29
|
-
|Recommended|false|
|
|
30
|
-
|Settings||
|
|
31
|
-
|Options||
|
|
32
|
-
|
|
33
|
-
<a name="user-content-check-access-failing-examples"></a>
|
|
34
|
-
<a name="check-access-failing-examples"></a>
|
|
35
|
-
## Failing examples
|
|
36
|
-
|
|
37
|
-
The following patterns are considered problems:
|
|
38
|
-
|
|
39
|
-
````js
|
|
40
|
-
/**
|
|
41
|
-
* @access foo
|
|
42
|
-
*/
|
|
43
|
-
function quux (foo) {
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
// Message: Missing valid JSDoc @access level.
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @access foo
|
|
50
|
-
*/
|
|
51
|
-
function quux (foo) {
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
// Settings: {"jsdoc":{"ignorePrivate":true}}
|
|
55
|
-
// Message: Missing valid JSDoc @access level.
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @accessLevel foo
|
|
59
|
-
*/
|
|
60
|
-
function quux (foo) {
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"access":"accessLevel"}}}
|
|
64
|
-
// Message: Missing valid JSDoc @accessLevel level.
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @access
|
|
68
|
-
*/
|
|
69
|
-
function quux (foo) {
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"access":false}}}
|
|
73
|
-
// Message: Unexpected tag `@access`
|
|
74
|
-
|
|
75
|
-
class MyClass {
|
|
76
|
-
/**
|
|
77
|
-
* @access
|
|
78
|
-
*/
|
|
79
|
-
myClassField = 1
|
|
80
|
-
}
|
|
81
|
-
// Message: Missing valid JSDoc @access level.
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @access public
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
function quux (foo) {
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
// Message: The @access tag may not be used with specific access-control tags (@package, @private, @protected, or @public).
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @access public
|
|
94
|
-
* @access private
|
|
95
|
-
*/
|
|
96
|
-
function quux (foo) {
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
// Message: At most one access-control tag may be present on a jsdoc block.
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @access public
|
|
103
|
-
* @access private
|
|
104
|
-
*/
|
|
105
|
-
function quux (foo) {
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
// Settings: {"jsdoc":{"ignorePrivate":true}}
|
|
109
|
-
// Message: At most one access-control tag may be present on a jsdoc block.
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @public
|
|
113
|
-
* @private
|
|
114
|
-
*/
|
|
115
|
-
function quux (foo) {
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
// Message: At most one access-control tag may be present on a jsdoc block.
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* @public
|
|
122
|
-
* @private
|
|
123
|
-
*/
|
|
124
|
-
function quux (foo) {
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
// Settings: {"jsdoc":{"ignorePrivate":true}}
|
|
128
|
-
// Message: At most one access-control tag may be present on a jsdoc block.
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @public
|
|
132
|
-
* @public
|
|
133
|
-
*/
|
|
134
|
-
function quux (foo) {
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
// Message: At most one access-control tag may be present on a jsdoc block.
|
|
138
|
-
````
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<a name="user-content-check-access-passing-examples"></a>
|
|
143
|
-
<a name="check-access-passing-examples"></a>
|
|
144
|
-
## Passing examples
|
|
145
|
-
|
|
146
|
-
The following patterns are not considered problems:
|
|
147
|
-
|
|
148
|
-
````js
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
151
|
-
*/
|
|
152
|
-
function quux (foo) {
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @access public
|
|
158
|
-
*/
|
|
159
|
-
function quux (foo) {
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* @accessLevel package
|
|
165
|
-
*/
|
|
166
|
-
function quux (foo) {
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
// Settings: {"jsdoc":{"tagNamePreference":{"access":"accessLevel"}}}
|
|
170
|
-
|
|
171
|
-
class MyClass {
|
|
172
|
-
/**
|
|
173
|
-
* @access private
|
|
174
|
-
*/
|
|
175
|
-
myClassField = 1
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @public
|
|
180
|
-
*/
|
|
181
|
-
function quux (foo) {
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @private
|
|
187
|
-
*/
|
|
188
|
-
function quux (foo) {
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
// Settings: {"jsdoc":{"ignorePrivate":true}}
|
|
192
|
-
````
|
|
193
|
-
|