mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
1 line
38 KiB
Plaintext
1 line
38 KiB
Plaintext
{"version":3,"sources":["../src/iterateJsdoc.js"],"names":["globalState","Map","skipSeeLink","parser","str","data","tag","match","parseComment","commentNode","indent","trim","value","parsers","commentParser","PARSERS","parse_tag","includes","parse_type","parse_name","errors","length","result","description","undefined","source","getBasicUtils","context","tagNamePreference","mode","utils","reportSettings","message","report","loc","start","column","line","getPreferredTagNameObject","tagName","ret","jsdocUtils","getPreferredTagName","isObject","replacement","blocked","getUtils","node","jsdoc","jsdocNode","settings","iteratingAll","ancestors","getAncestors","sourceCode","getSourceCode","overrideReplacesDocs","implementsReplacesDocs","augmentsExtendsReplacesDocs","maxLines","minLines","isIteratingFunction","type","isVirtualFunction","hasATag","stringify","tagBlock","getIndent","slice","reportJSDoc","msg","handler","fixer","replaceText","getFunctionParameterNames","isConstructor","parent","kind","isGetter","isSetter","getJsdocTagsDeep","name","getJsdocTags","skipReportingBlockedTag","allowObjectReturn","defaultMessage","hasTag","getTags","isValidTag","definedTags","avoidDocs","classHasTag","exemptedBy","_","get","getPresentTags","tagMustHaveEitherTypeOrNamePosition","tagMightHaveEitherTypeOrNamePosition","tagMustHaveNamePosition","tagMightHaveNamePosition","tagMustHaveTypePosition","tagMightHaveTypePosition","isNamepathDefiningTag","hasDefinedTypeReturnTag","hasReturnValue","isAsync","async","filterTags","item","tagList","filter","tags","getTagsByType","hasOptionTag","Boolean","getClassNode","reverse","find","getClassJsdoc","classNode","classJsdocNode","repeat","classJsdoc","forEachPreferredTag","arrayHandler","targetTagName","matchingJsdocTags","forEach","matchingJsdocTag","getSettings","ignorePrivate","Number","preferredTypes","makeReport","fix","jsdocLoc","lineNumber","end","colNumber","iterate","ruleConfig","lines","iterator","state","sourceLine","charAt","noTrim","checkPrivate","some","iterateAllJsdocs","trackedJsdocs","callIterator","jsdocNodes","lastCall","test","getText","exit","create","reducedNode","comment","nonComment","push","allComments","getAllComments","untrackedJSdoc","meta","checkFile","iterateJsdoc","metaType","TypeError","contexts","contextDefaults","enforcedContexts","checkJsdoc","getContextObject","ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"],"mappings":";;;;;;;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAJA;AAMA,MAAMA,WAAW,GAAG,IAAIC,GAAJ,EAApB;;AAEA,MAAMC,WAAW,GAAIC,MAAD,IAAY;AAC9B,SAAO,CAACC,GAAD,EAAMC,IAAN,KAAe;AACpB,QAAIA,IAAI,CAACC,GAAL,KAAa,KAAb,IAAsBF,GAAG,CAACG,KAAJ,CAAU,eAAV,CAA1B,EAAsD;AACpD,aAAO,IAAP;AACD;;AAED,WAAOJ,MAAM,CAACC,GAAD,EAAMC,IAAN,CAAb;AACD,GAND;AAOD,CARD;AAUA;;;;;;;;;AAOA,MAAMG,YAAY,GAAG,CAACC,WAAD,EAAcC,MAAd,EAAsBC,IAAI,GAAG,IAA7B,KAAsC;AACzD;AACA,SAAO,4BAAe,GAAED,MAAO,KAAID,WAAW,CAACG,KAAM,GAAEF,MAAO,IAAvD,EAA4D;AACjE;AACAG,IAAAA,OAAO,EAAE,CACPC,uBAAcC,OAAd,CAAsBC,SADf,EAEPd,WAAW,CACT,CAACE,GAAD,EAAMC,IAAN,KAAe;AACb,UAAI,CAAC,SAAD,EAAY,cAAZ,EAA4BY,QAA5B,CAAqCZ,IAAI,CAACC,GAA1C,CAAJ,EAAoD;AAClD,eAAO,IAAP;AACD;;AAED,aAAOQ,uBAAcC,OAAd,CAAsBG,UAAtB,CAAiCd,GAAjC,EAAsCC,IAAtC,CAAP;AACD,KAPQ,CAFJ,EAWPH,WAAW,CACT,CAACE,GAAD,EAAMC,IAAN,KAAe;AACb,UAAI,CACF,SADE,EACS,QADT,EACmB,SADnB,EAC8B,QAD9B,EACwC,WADxC,EAEF,QAFE,EAEQ,SAFR,EAEmB,OAFnB,EAE4B,SAF5B,EAEuC,QAFvC,EAGF,SAHE,EAGS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L,EAEiBwF,QAFjB,CAAP;AAID,OAXD;;AAaA,UAAIF,UAAU,CAAC+B,eAAf,EAAgC;AAC9B,eAAOlI,oBAAWqI,gBAAX,CAA4BJ,QAA5B,EAAsCG,UAAtC,CAAP;AACD;;AAED,aAAO;AACLE,QAAAA,uBAAuB,EAAEF,UADpB;AAELG,QAAAA,mBAAmB,EAAEH,UAFhB;AAGLI,QAAAA,kBAAkB,EAAEJ;AAHf,OAAP;AAKD,KA7CI;;AA8CLR,IAAAA,IAAI,EAAEzB,UAAU,CAACyB;AA9CZ,GAAP;AAgDD","sourcesContent":["// eslint-disable-next-line import/no-named-default\nimport {default as commentParser, stringify as commentStringify} from 'comment-parser';\nimport _ from 'lodash';\nimport jsdocUtils from './jsdocUtils';\nimport getJSDocComment, {getReducedASTNode} from './eslint/getJSDocComment';\n\nconst globalState = new Map();\n\nconst skipSeeLink = (parser) => {\n return (str, data) => {\n if (data.tag === 'see' && str.match(/\\{@link.+?\\}/u)) {\n return null;\n }\n\n return parser(str, data);\n };\n};\n\n/**\n *\n * @param {object} commentNode\n * @param {string} indent Whitespace\n * @param {boolean} [trim=true]\n * @returns {object}\n */\nconst parseComment = (commentNode, indent, trim = true) => {\n // Preserve JSDoc block start/end indentation.\n return commentParser(`${indent}/*${commentNode.value}${indent}*/`, {\n // @see https://github.com/yavorskiy/comment-parser/issues/21\n parsers: [\n commentParser.PARSERS.parse_tag,\n skipSeeLink(\n (str, data) => {\n if (['default', 'defaultvalue'].includes(data.tag)) {\n return null;\n }\n\n return commentParser.PARSERS.parse_type(str, data);\n },\n ),\n skipSeeLink(\n (str, data) => {\n if ([\n 'example', 'return', 'returns', 'throws', 'exception',\n 'access', 'version', 'since', 'license', 'author',\n 'default', 'defaultvalue',\n ].includes(data.tag)) {\n return null;\n }\n\n return commentParser.PARSERS.parse_name(str, data);\n },\n ),\n\n // parse_description\n (str, data) => {\n // Only expected throw in previous step is if bad name (i.e.,\n // missing end bracket on optional name), but `@example`\n // skips name parsing\n /* istanbul ignore next */\n if (data.errors && data.errors.length) {\n return null;\n }\n\n // Tweak original regex to capture only single optional space\n const result = str.match(/^ ?((.|\\s)+)?/u);\n\n // Always has at least whitespace due to `indent` we've added\n /* istanbul ignore next */\n if (result) {\n return {\n data: {\n description: result[1] === undefined ? '' : result[1],\n },\n source: result[0],\n };\n }\n\n // Always has at least whitespace due to `indent` we've added\n /* istanbul ignore next */\n return null;\n },\n ],\n trim,\n })[0] || {};\n};\n\nconst getBasicUtils = (context, {tagNamePreference, mode}) => {\n const utils = {};\n utils.reportSettings = (message) => {\n context.report({\n loc: {\n start: {\n column: 1,\n line: 1,\n },\n },\n message,\n });\n };\n\n utils.getPreferredTagNameObject = ({tagName}) => {\n const ret = jsdocUtils.getPreferredTagName(context, mode, tagName, tagNamePreference);\n const isObject = ret && typeof ret === 'object';\n if (ret === false || isObject && !ret.replacement) {\n return {\n blocked: true,\n tagName,\n };\n }\n\n return ret;\n };\n\n return utils;\n};\n\nconst getUtils = (\n node,\n jsdoc,\n jsdocNode,\n settings,\n report,\n context,\n iteratingAll,\n) => {\n const ancestors = context.getAncestors();\n const sourceCode = context.getSourceCode();\n\n const utils = getBasicUtils(context, settings);\n\n const {\n tagNamePreference,\n overrideReplacesDocs,\n implementsReplacesDocs,\n augmentsExtendsReplacesDocs,\n maxLines,\n minLines,\n mode,\n } = settings;\n\n utils.isIteratingFunction = () => {\n return !iteratingAll || [\n 'ArrowFunctionExpression',\n 'FunctionDeclaration',\n 'FunctionExpression',\n ].includes(node && node.type);\n };\n\n utils.isVirtualFunction = () => {\n return iteratingAll && utils.hasATag(['callback', 'function', 'func', 'method']);\n };\n\n utils.stringify = (tagBlock) => {\n const indent = jsdocUtils.getIndent(sourceCode);\n\n return commentStringify([tagBlock], {indent}).slice(indent.length - 1);\n };\n\n utils.reportJSDoc = (msg, tag, handler) => {\n report(msg, handler ? (fixer) => {\n handler();\n const replacement = utils.stringify(jsdoc);\n\n return fixer.replaceText(jsdocNode, replacement);\n } : null, tag);\n };\n\n utils.getFunctionParameterNames = () => {\n return jsdocUtils.getFunctionParameterNames(node);\n };\n\n utils.isConstructor = () => {\n return node && node.parent && node.parent.kind === 'constructor';\n };\n\n utils.isGetter = () => {\n return node && node.parent.kind === 'get';\n };\n\n utils.isSetter = () => {\n return node && node.parent.kind === 'set';\n };\n\n utils.getJsdocTagsDeep = (tagName) => {\n const name = utils.getPreferredTagName({tagName});\n if (!name) {\n return false;\n }\n\n return jsdocUtils.getJsdocTagsDeep(jsdoc, name);\n };\n\n utils.getJsdocTags = (tagName) => {\n const name = utils.getPreferredTagName({tagName});\n if (!name) {\n return false;\n }\n\n return jsdocUtils.getJsdocTags(jsdoc, name);\n };\n\n utils.getPreferredTagName = ({tagName, skipReportingBlockedTag = false, allowObjectReturn = false, defaultMessage = `Unexpected tag \\`@${tagName}\\``}) => {\n const ret = jsdocUtils.getPreferredTagName(context, mode, tagName, tagNamePreference);\n const isObject = ret && typeof ret === 'object';\n if (utils.hasTag(tagName) && (ret === false || isObject && !ret.replacement)) {\n if (skipReportingBlockedTag) {\n return {\n blocked: true,\n tagName,\n };\n }\n const message = isObject && ret.message || defaultMessage;\n report(message, null, utils.getTags(tagName)[0]);\n\n return false;\n }\n\n return isObject && !allowObjectReturn ? ret.replacement : ret;\n };\n\n utils.isValidTag = (name, definedTags) => {\n return jsdocUtils.isValidTag(context, mode, name, definedTags);\n };\n\n utils.hasATag = (name) => {\n return jsdocUtils.hasATag(jsdoc, name);\n };\n\n utils.hasTag = (name) => {\n return jsdocUtils.hasTag(jsdoc, name);\n };\n\n utils.avoidDocs = () => {\n if (\n overrideReplacesDocs !== false &&\n (utils.hasTag('override') || utils.classHasTag('override')) ||\n implementsReplacesDocs !== false &&\n (utils.hasTag('implements') || utils.classHasTag('implements')) ||\n\n // inheritdoc implies that all documentation is inherited; see https://jsdoc.app/tags-inheritdoc.html\n utils.hasTag('inheritdoc') ||\n\n augmentsExtendsReplacesDocs &&\n (utils.hasATag(['augments', 'extends']) ||\n utils.classHasTag('augments') ||\n utils.classHasTag('extends'))) {\n return true;\n }\n\n const exemptedBy = _.get(context, 'options[0].exemptedBy');\n if (exemptedBy && exemptedBy.length && utils.getPresentTags(exemptedBy).length) {\n return true;\n }\n\n return false;\n };\n\n utils.tagMustHaveEitherTypeOrNamePosition = (tagName) => {\n return jsdocUtils.tagMustHaveEitherTypeOrNamePosition(tagName);\n };\n\n utils.tagMightHaveEitherTypeOrNamePosition = (tagName) => {\n return jsdocUtils.tagMightHaveEitherTypeOrNamePosition(mode, tagName);\n };\n\n utils.tagMustHaveNamePosition = (tagName) => {\n return jsdocUtils.tagMustHaveNamePosition(tagName);\n };\n\n utils.tagMightHaveNamePosition = (tagName) => {\n return jsdocUtils.tagMightHaveNamePosition(tagName);\n };\n\n utils.tagMustHaveTypePosition = (tagName) => {\n return jsdocUtils.tagMustHaveTypePosition(mode, tagName);\n };\n\n utils.tagMightHaveTypePosition = (tagName) => {\n return jsdocUtils.tagMightHaveTypePosition(mode, tagName);\n };\n\n utils.isNamepathDefiningTag = (tagName) => {\n return jsdocUtils.isNamepathDefiningTag(tagName);\n };\n\n utils.hasDefinedTypeReturnTag = (tag) => {\n return jsdocUtils.hasDefinedTypeReturnTag(tag);\n };\n\n utils.hasReturnValue = () => {\n return jsdocUtils.hasReturnValue(node);\n };\n\n utils.isAsync = () => {\n return node.async;\n };\n\n utils.getTags = (tagName) => {\n return utils.filterTags((item) => {\n return item.tag === tagName;\n });\n };\n\n utils.getPresentTags = (tagList) => {\n return utils.filterTags((tag) => {\n return tagList.includes(tag.tag);\n });\n };\n\n utils.filterTags = (filter) => {\n return jsdocUtils.filterTags(jsdoc.tags, filter);\n };\n\n utils.getTagsByType = (tags) => {\n return jsdocUtils.getTagsByType(context, mode, tags, tagNamePreference);\n };\n\n utils.hasOptionTag = (tagName) => {\n const tags = _.get(context, 'options[0].tags');\n\n return Boolean(tags && tags.includes(tagName));\n };\n\n utils.getClassNode = () => {\n return [...ancestors, node].reverse().find((parent) => {\n return parent && ['ClassDeclaration', 'ClassExpression'].includes(parent.type);\n }) || null;\n };\n\n utils.getClassJsdoc = () => {\n const classNode = utils.getClassNode();\n\n if (!classNode) {\n return null;\n }\n\n const classJsdocNode = getJSDocComment(sourceCode, classNode, {\n maxLines,\n minLines,\n });\n\n if (classJsdocNode) {\n const indent = ' '.repeat(classJsdocNode.loc.start.column);\n\n return parseComment(classJsdocNode, indent);\n }\n\n return null;\n };\n\n utils.classHasTag = (tagName) => {\n const classJsdoc = utils.getClassJsdoc();\n\n return Boolean(classJsdoc) && jsdocUtils.hasTag(classJsdoc, tagName);\n };\n\n utils.forEachPreferredTag = (tagName, arrayHandler, skipReportingBlockedTag = false) => {\n const targetTagName = utils.getPreferredTagName({\n skipReportingBlockedTag,\n tagName,\n });\n if (!targetTagName ||\n skipReportingBlockedTag && targetTagName && typeof targetTagName === 'object'\n ) {\n return;\n }\n const matchingJsdocTags = _.filter(jsdoc.tags || [], {\n tag: targetTagName,\n });\n\n matchingJsdocTags.forEach((matchingJsdocTag) => {\n arrayHandler(matchingJsdocTag, targetTagName);\n });\n };\n\n return utils;\n};\n\nconst getSettings = (context) => {\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n const settings = {\n // All rules\n ignorePrivate: Boolean(_.get(context, 'settings.jsdoc.ignorePrivate')),\n maxLines: Number(_.get(context, 'settings.jsdoc.maxLines', 1)),\n minLines: Number(_.get(context, 'settings.jsdoc.minLines', 0)),\n\n // `check-tag-names` and many returns/param rules\n tagNamePreference: _.get(context, 'settings.jsdoc.tagNamePreference') || {},\n\n // `check-types` and `no-undefined-types`\n preferredTypes: _.get(context, 'settings.jsdoc.preferredTypes') || {},\n\n // `require-param`, `require-description`, `require-example`, `require-returns`\n overrideReplacesDocs: _.get(context, 'settings.jsdoc.overrideReplacesDocs'),\n implementsReplacesDocs: _.get(context, 'settings.jsdoc.implementsReplacesDocs'),\n augmentsExtendsReplacesDocs: _.get(context, 'settings.jsdoc.augmentsExtendsReplacesDocs'),\n\n // Many rules, e.g., `check-tag-names`\n mode: _.get(context, 'settings.jsdoc.mode') || 'jsdoc',\n };\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n\n return settings;\n};\n\n/**\n * Create the report function\n *\n * @param {object} context\n * @param {object} commentNode\n */\nconst makeReport = (context, commentNode) => {\n const report = (message, fix = null, jsdocLoc = null, data = null) => {\n let loc;\n\n if (jsdocLoc) {\n const lineNumber = commentNode.loc.start.line + jsdocLoc.line;\n\n loc = {\n end: {line: lineNumber},\n start: {line: lineNumber},\n };\n if (jsdocLoc.column) {\n const colNumber = commentNode.loc.start.column + jsdocLoc.column;\n\n loc.end.column = colNumber;\n loc.start.column = colNumber;\n }\n }\n\n context.report({\n data,\n fix,\n loc,\n message,\n node: commentNode,\n });\n };\n\n return report;\n};\n\n/**\n * @typedef {ReturnType<typeof getUtils>} Utils\n * @typedef {ReturnType<typeof getSettings>} Settings\n * @typedef {(\n * arg: {\n * context: object,\n * sourceCode: object,\n * indent: string,\n * jsdoc: object,\n * jsdocNode: object,\n * node: object | null,\n * report: ReturnType<typeof makeReport>,\n * settings: Settings,\n * utils: Utils,\n * }\n * ) => any } JsdocVisitor\n */\n\nconst iterate = (\n ruleConfig, context, lines, jsdocNode, node, settings,\n sourceCode, iterator, state, iteratingAll,\n) => {\n const sourceLine = lines[jsdocNode.loc.start.line - 1];\n const indent = sourceLine.charAt(0).repeat(jsdocNode.loc.start.column);\n const jsdoc = parseComment(jsdocNode, indent, !ruleConfig.noTrim);\n const report = makeReport(context, jsdocNode);\n\n const utils = getUtils(\n node,\n jsdoc,\n jsdocNode,\n settings,\n report,\n context,\n iteratingAll,\n );\n\n if (\n settings.ignorePrivate &&\n !ruleConfig.checkPrivate &&\n (utils.hasTag('private') || _.filter(jsdoc.tags, {\n tag: 'access',\n }).some(({description}) => {\n return description === 'private';\n }))\n ) {\n return;\n }\n\n iterator({\n context,\n globalState,\n indent,\n iteratingAll,\n jsdoc,\n jsdocNode,\n node,\n report,\n settings,\n sourceCode,\n state,\n utils,\n });\n};\n\n/**\n * Create an eslint rule that iterates over all JSDocs, regardless of whether\n * they are attached to a function-like node.\n *\n * @param {JsdocVisitor} iterator\n * @param {{meta: any}} ruleConfig\n */\nconst iterateAllJsdocs = (iterator, ruleConfig) => {\n const trackedJsdocs = [];\n\n const callIterator = (context, node, jsdocNodes, state, lastCall) => {\n const sourceCode = context.getSourceCode();\n const settings = getSettings(context);\n const {lines} = sourceCode;\n\n const utils = getBasicUtils(context, settings);\n jsdocNodes.forEach((jsdocNode) => {\n if (!(/^\\/\\*\\*\\s/).test(sourceCode.getText(jsdocNode))) {\n return;\n }\n iterate(\n ruleConfig, context, lines, jsdocNode, node,\n settings, sourceCode, iterator,\n state, true,\n );\n });\n if (lastCall && ruleConfig.exit) {\n ruleConfig.exit({\n context,\n state,\n utils,\n });\n }\n };\n\n return {\n create (context) {\n const sourceCode = context.getSourceCode();\n const settings = getSettings(context);\n const state = {};\n\n return {\n '*:not(Program)' (node) {\n const reducedNode = getReducedASTNode(node, sourceCode);\n\n if (node !== reducedNode) {\n return;\n }\n\n const comment = getJSDocComment(sourceCode, node, settings);\n if (trackedJsdocs.includes(comment)) {\n return;\n }\n if (!comment) {\n if (ruleConfig.nonComment) {\n ruleConfig.nonComment({\n node,\n state,\n });\n }\n\n return;\n }\n\n trackedJsdocs.push(comment);\n callIterator(context, node, [comment], state);\n },\n 'Program:exit' () {\n const allComments = sourceCode.getAllComments();\n const untrackedJSdoc = allComments.filter((node) => {\n return !trackedJsdocs.includes(node);\n });\n\n callIterator(context, null, untrackedJSdoc, state, true);\n },\n };\n },\n meta: ruleConfig.meta,\n };\n};\n\n/**\n * Create an eslint rule that iterates over all JSDocs, regardless of whether\n * they are attached to a function-like node.\n *\n * @param {JsdocVisitor} iterator\n * @param {{meta: any}} ruleConfig\n */\nconst checkFile = (iterator, ruleConfig) => {\n return {\n create (context) {\n const sourceCode = context.getSourceCode();\n const settings = getSettings(context);\n\n return {\n 'Program:exit' () {\n const allComments = sourceCode.getAllComments();\n const {lines} = sourceCode;\n const utils = getBasicUtils(context, settings);\n\n iterator({\n allComments,\n context,\n lines,\n makeReport,\n settings,\n sourceCode,\n utils,\n });\n },\n };\n },\n meta: ruleConfig.meta,\n };\n};\n\nexport {\n getSettings,\n parseComment,\n};\n\n/**\n * @param {JsdocVisitor} iterator\n * @param {{\n * meta: any,\n * contextDefaults?: true | string[],\n * iterateAllJsdocs?: true,\n * }} ruleConfig\n */\nexport default function iterateJsdoc (iterator, ruleConfig) {\n const metaType = _.get(ruleConfig, 'meta.type');\n if (!metaType || !['problem', 'suggestion', 'layout'].includes(metaType)) {\n throw new TypeError('Rule must include `meta.type` option (with value \"problem\", \"suggestion\", or \"layout\")');\n }\n if (typeof iterator !== 'function') {\n throw new TypeError('The iterator argument must be a function.');\n }\n\n if (ruleConfig.checkFile) {\n return checkFile(iterator, ruleConfig);\n }\n\n if (ruleConfig.iterateAllJsdocs) {\n return iterateAllJsdocs(iterator, ruleConfig);\n }\n\n return {\n /**\n * The entrypoint for the JSDoc rule.\n *\n * @param {*} context\n * a reference to the context which hold all important information\n * like settings and the sourcecode to check.\n * @returns {object}\n * a list with parser callback function.\n */\n create (context) {\n let contexts;\n if (ruleConfig.contextDefaults) {\n contexts = jsdocUtils.enforcedContexts(context, ruleConfig.contextDefaults);\n if (contexts.includes('any')) {\n return iterateAllJsdocs(iterator, ruleConfig).create(context);\n }\n }\n\n const sourceCode = context.getSourceCode();\n const settings = getSettings(context);\n const {lines} = sourceCode;\n\n const checkJsdoc = (node) => {\n const jsdocNode = getJSDocComment(sourceCode, node, settings);\n\n if (!jsdocNode) {\n return;\n }\n\n iterate(\n ruleConfig, context, lines, jsdocNode, node,\n settings, sourceCode, iterator,\n );\n };\n\n if (ruleConfig.contextDefaults) {\n return jsdocUtils.getContextObject(contexts, checkJsdoc);\n }\n\n return {\n ArrowFunctionExpression: checkJsdoc,\n FunctionDeclaration: checkJsdoc,\n FunctionExpression: checkJsdoc,\n };\n },\n meta: ruleConfig.meta,\n };\n}\n"],"file":"iterateJsdoc.js"} |