github-pages-deploy-action/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js.map
2020-03-31 08:57:48 -04:00

1 line
37 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","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,cAHT,EA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AtC,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.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"}