eslint-plugin-jsdoc
Advanced tools
Comparing version
@@ -158,2 +158,3 @@ import * as _es_joy_jsdoccomment0 from "@es-joy/jsdoccomment"; | ||
isIteratingFunction: IsIteratingFunction; | ||
isIteratingFunctionOrVariable: IsIteratingFunction; | ||
isVirtualFunction: IsVirtualFunction; | ||
@@ -160,0 +161,0 @@ stringify: Stringify; |
@@ -412,2 +412,3 @@ import { hasValueOrExecutorHasNonEmptyResolveValue } from "./utils/hasReturnValue.js"; | ||
* isIteratingFunction: IsIteratingFunction, | ||
* isIteratingFunctionOrVariable: IsIteratingFunction, | ||
* isVirtualFunction: IsVirtualFunction, | ||
@@ -580,11 +581,21 @@ * stringify: Stringify, | ||
const { augmentsExtendsReplacesDocs, ignoreReplacesDocs, implementsReplacesDocs, maxLines, minLines, mode, overrideReplacesDocs, tagNamePreference } = settings; | ||
const functionTypes = [ | ||
"ArrowFunctionExpression", | ||
"FunctionDeclaration", | ||
"FunctionExpression", | ||
"MethodDefinition" | ||
]; | ||
/** @type {IsIteratingFunction} */ | ||
utils.isIteratingFunction = () => { | ||
return !iteratingAll || [ | ||
"ArrowFunctionExpression", | ||
"FunctionDeclaration", | ||
"FunctionExpression", | ||
"MethodDefinition" | ||
].includes(String(node && node.type)); | ||
return !iteratingAll || functionTypes.includes(String(node?.type)); | ||
}; | ||
/** @type {IsIteratingFunction} */ | ||
utils.isIteratingFunctionOrVariable = () => { | ||
if (utils.isIteratingFunction()) return true; | ||
/** @type {import('estree').VariableDeclarator[]} */ | ||
const declarations = node?.type === "VariableDeclaration" ? node.declarations : node?.type === "ExportNamedDeclaration" && node.declaration?.type === "VariableDeclaration" ? node.declaration.declarations : []; | ||
return declarations.some(({ init }) => { | ||
return functionTypes.includes(String(init?.type)); | ||
}); | ||
}; | ||
/** @type {IsVirtualFunction} */ | ||
@@ -591,0 +602,0 @@ utils.isVirtualFunction = () => { |
@@ -5,3 +5,3 @@ import iterateJsdoc from "../iterateJsdoc.js"; | ||
var implementsOnClasses_default = iterateJsdoc(({ report, utils }) => { | ||
const iteratingFunction = utils.isIteratingFunction(); | ||
const iteratingFunction = utils.isIteratingFunctionOrVariable(); | ||
if (iteratingFunction) { | ||
@@ -8,0 +8,0 @@ if (utils.hasATag(["class", "constructor"]) || utils.isConstructor()) return; |
@@ -12,3 +12,3 @@ import iterateJsdoc from "../iterateJsdoc.js"; | ||
var noTypes_default = iterateJsdoc(({ node, utils }) => { | ||
if (!utils.isIteratingFunction() && !utils.isVirtualFunction()) return; | ||
if (!utils.isIteratingFunctionOrVariable() && !utils.isVirtualFunction()) return; | ||
const tags = utils.getPresentTags([ | ||
@@ -15,0 +15,0 @@ "param", |
@@ -12,3 +12,3 @@ import iterateJsdoc from "../iterateJsdoc.js"; | ||
if (!functionExamples.length) { | ||
if (exemptNoArguments && utils.isIteratingFunction() && !utils.hasParams()) return; | ||
if (exemptNoArguments && utils.isIteratingFunctionOrVariable() && !utils.hasParams()) return; | ||
utils.reportJSDoc(`Missing JSDoc @${targetTagName} declaration.`, null, () => { | ||
@@ -15,0 +15,0 @@ if (enableFixer) utils.addTag(targetTagName); |
@@ -173,3 +173,3 @@ { | ||
}, | ||
"version": "53.0.0" | ||
"version": "53.0.1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2414990
0.14%24064
0.1%0
-100%