eslint-plugin-jsdoc 63.0.0 → 63.0.2
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/jsdocUtils.d.ts +10 -0
- package/dist/jsdocUtils.cjs +30 -2
- package/dist/jsdocUtils.cjs.map +1 -1
- package/dist/jsdocUtils.d.ts +10 -0
- package/dist/rules/emptyTags.cjs +14 -1
- package/dist/rules/emptyTags.cjs.map +1 -1
- package/dist/rules/implementsOnClasses.cjs +1 -1
- package/dist/rules/implementsOnClasses.cjs.map +1 -1
- package/dist/rules/matchDescription.cjs +1 -1
- package/dist/rules/matchDescription.cjs.map +1 -1
- package/dist/rules/matchName.cjs +1 -1
- package/dist/rules/matchName.cjs.map +1 -1
- package/dist/rules/noDefaults.cjs +1 -1
- package/dist/rules/noDefaults.cjs.map +1 -1
- package/dist/rules/noMissingSyntax.cjs +1 -1
- package/dist/rules/noMissingSyntax.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.cjs +1 -1
- package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
- package/dist/rules/noTypes.cjs +1 -1
- package/dist/rules/noTypes.cjs.map +1 -1
- package/dist/rules/noUndefinedTypes.cjs +3 -12
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/requireDescription.cjs +1 -1
- package/dist/rules/requireDescription.cjs.map +1 -1
- package/dist/rules/requireExample.cjs +1 -1
- package/dist/rules/requireExample.cjs.map +1 -1
- package/dist/rules/requireJsdoc.cjs +1 -1
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireParam.cjs +1 -1
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/requireParamDescription.cjs +1 -1
- package/dist/rules/requireParamDescription.cjs.map +1 -1
- package/dist/rules/requireParamName.cjs +1 -1
- package/dist/rules/requireParamName.cjs.map +1 -1
- package/dist/rules/requireParamType.cjs +1 -1
- package/dist/rules/requireParamType.cjs.map +1 -1
- package/dist/rules/requireReturnsCheck.cjs +86 -1
- package/dist/rules/requireReturnsCheck.cjs.map +1 -1
- package/dist/rules/requireReturnsDescription.cjs +1 -1
- package/dist/rules/requireReturnsDescription.cjs.map +1 -1
- package/dist/rules/requireReturnsType.cjs +1 -1
- package/dist/rules/requireReturnsType.cjs.map +1 -1
- package/dist/rules.d.ts +16 -16
- package/package.json +13 -13
- package/src/jsdocUtils.js +38 -0
- package/src/rules/emptyTags.js +14 -0
- package/src/rules/implementsOnClasses.js +1 -1
- package/src/rules/matchDescription.js +1 -1
- package/src/rules/matchName.js +1 -1
- package/src/rules/noDefaults.js +1 -1
- package/src/rules/noMissingSyntax.js +1 -1
- package/src/rules/noRestrictedSyntax.js +1 -1
- package/src/rules/noTypes.js +1 -1
- package/src/rules/noUndefinedTypes.js +6 -21
- package/src/rules/requireDescription.js +1 -1
- package/src/rules/requireExample.js +1 -1
- package/src/rules/requireJsdoc.js +1 -1
- package/src/rules/requireParam.js +1 -1
- package/src/rules/requireParamDescription.js +1 -1
- package/src/rules/requireParamName.js +1 -1
- package/src/rules/requireParamType.js +1 -1
- package/src/rules/requireReturnsCheck.js +110 -1
- package/src/rules/requireReturnsDescription.js +1 -1
- package/src/rules/requireReturnsType.js +1 -1
- package/src/rules.d.ts +16 -16
package/dist/cjs/jsdocUtils.d.ts
CHANGED
|
@@ -173,6 +173,11 @@ export function getAllTags(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithInli
|
|
|
173
173
|
* @returns {import('eslint').Rule.RuleListener}
|
|
174
174
|
*/
|
|
175
175
|
export function getContextObject(contexts: import("./iterateJsdoc.js").Context[], checkJsdoc: import("./iterateJsdoc.js").CheckJsdoc, handler?: import("@es-joy/jsdoccomment").CommentHandler): import("eslint").Rule.RuleListener;
|
|
176
|
+
/**
|
|
177
|
+
* @param {import('eslint').SourceCode} sourceCode
|
|
178
|
+
* @returns {import('comment-parser').Spec[]}
|
|
179
|
+
*/
|
|
180
|
+
export function getDocumentNamepathDefiningTags(sourceCode: import("eslint").SourceCode): import("comment-parser").Spec[];
|
|
176
181
|
/**
|
|
177
182
|
* @param {ESTreeOrTypeScriptNode|null} functionNode
|
|
178
183
|
* @param {boolean} [checkDefaultObjects]
|
|
@@ -202,6 +207,11 @@ export function getInlineTags(jsdoc: import("./iterateJsdoc.js").JsdocBlockWithI
|
|
|
202
207
|
line?: number | undefined;
|
|
203
208
|
column?: number | undefined;
|
|
204
209
|
}))[];
|
|
210
|
+
/**
|
|
211
|
+
* @param {import('eslint').SourceCode} sourceCode
|
|
212
|
+
* @returns {import('@es-joy/jsdoccomment').JsdocBlockWithInline[]}
|
|
213
|
+
*/
|
|
214
|
+
export function getJSDocCommentBlocks(sourceCode: import("eslint").SourceCode): import("@es-joy/jsdoccomment").JsdocBlockWithInline[];
|
|
205
215
|
/**
|
|
206
216
|
* Gets all names of the target type, including those that refer to a path, e.g.
|
|
207
217
|
* `foo` or `foo.bar`.
|
package/dist/jsdocUtils.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.hasParams = exports.hasATag = exports.getTagsByType = exports.getTags = exports.getTagStructureForMode = exports.getTagDescription = exports.getRegexFromString = exports.getPreferredTagNameSimple = exports.getPreferredTagName = exports.getJsdocTagsDeep = exports.getInlineTags = exports.getIndent = exports.getFunctionParameterNames = exports.getContextObject = exports.getAllTags = exports.forEachPreferredTag = exports.flattenRoots = exports.filterTags = exports.exemptSpeciaMethods = exports.enforcedContexts = exports.dropPathSegmentQuotes = exports.comparePaths = void 0;
|
|
6
|
+
exports.hasParams = exports.hasATag = exports.getTagsByType = exports.getTags = exports.getTagStructureForMode = exports.getTagDescription = exports.getRegexFromString = exports.getPreferredTagNameSimple = exports.getPreferredTagName = exports.getJsdocTagsDeep = exports.getJSDocCommentBlocks = exports.getInlineTags = exports.getIndent = exports.getFunctionParameterNames = exports.getDocumentNamepathDefiningTags = exports.getContextObject = exports.getAllTags = exports.forEachPreferredTag = exports.flattenRoots = exports.filterTags = exports.exemptSpeciaMethods = exports.enforcedContexts = exports.dropPathSegmentQuotes = exports.comparePaths = void 0;
|
|
7
7
|
Object.defineProperty(exports, "hasReturnValue", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
@@ -869,12 +869,40 @@ const isNameOrNamepathDefiningTag = (tag, tagMap = tagStructure) => {
|
|
|
869
869
|
tagStruct.get('namepathRole'));
|
|
870
870
|
};
|
|
871
871
|
|
|
872
|
+
/**
|
|
873
|
+
* @param {import('eslint').SourceCode} sourceCode
|
|
874
|
+
* @returns {import('@es-joy/jsdoccomment').JsdocBlockWithInline[]}
|
|
875
|
+
*/
|
|
876
|
+
exports.isNameOrNamepathDefiningTag = isNameOrNamepathDefiningTag;
|
|
877
|
+
const getJSDocCommentBlocks = sourceCode => {
|
|
878
|
+
return sourceCode.getAllComments().filter(comment => {
|
|
879
|
+
return /^\*(?!\*)/v.test(comment.value);
|
|
880
|
+
}).map(commentNode => {
|
|
881
|
+
return (0, _jsdoccomment.parseComment)(commentNode, '');
|
|
882
|
+
});
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* @param {import('eslint').SourceCode} sourceCode
|
|
887
|
+
* @returns {import('comment-parser').Spec[]}
|
|
888
|
+
*/
|
|
889
|
+
exports.getJSDocCommentBlocks = getJSDocCommentBlocks;
|
|
890
|
+
const getDocumentNamepathDefiningTags = sourceCode => {
|
|
891
|
+
return getJSDocCommentBlocks(sourceCode).flatMap(doc => {
|
|
892
|
+
return doc.tags.filter(({
|
|
893
|
+
tag
|
|
894
|
+
}) => {
|
|
895
|
+
return isNameOrNamepathDefiningTag(tag) && !['arg', 'argument', 'param', 'prop', 'property'].includes(tag);
|
|
896
|
+
});
|
|
897
|
+
});
|
|
898
|
+
};
|
|
899
|
+
|
|
872
900
|
/**
|
|
873
901
|
* @param {string} tag
|
|
874
902
|
* @param {import('./getDefaultTagStructureForMode.js').TagStructure} tagMap
|
|
875
903
|
* @returns {boolean}
|
|
876
904
|
*/
|
|
877
|
-
exports.
|
|
905
|
+
exports.getDocumentNamepathDefiningTags = getDocumentNamepathDefiningTags;
|
|
878
906
|
const isNamepathReferencingTag = (tag, tagMap = tagStructure) => {
|
|
879
907
|
const tagStruct = ensureMap(tagMap, tag);
|
|
880
908
|
return tagStruct.get('namepathRole') === 'namepath-referencing';
|