eslint-plugin-jsdoc 54.4.0 → 54.5.0
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/getJsdocProcessorPlugin.cjs +2 -2
- package/dist/getJsdocProcessorPlugin.cjs.map +1 -1
- package/dist/rules/requireJsdoc.cjs +59 -4
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireTemplate.cjs +3 -0
- package/dist/rules/requireTemplate.cjs.map +1 -1
- package/package.json +15 -15
- package/src/getJsdocProcessorPlugin.js +2 -2
- package/src/rules/requireJsdoc.js +67 -1
- package/src/rules/requireTemplate.js +3 -0
|
@@ -475,6 +475,7 @@ const getJsdocProcessorPlugin = (options = {}) => {
|
|
|
475
475
|
// fix: {range: [number, number], text: string}
|
|
476
476
|
// suggestions: {desc: , messageId:, fix: }[],
|
|
477
477
|
} = msg;
|
|
478
|
+
delete msg.fix;
|
|
478
479
|
const [codeCtxLine, codeCtxColumn] = commentLineCols;
|
|
479
480
|
const startLine = codeCtxLine + codeStartLine + line;
|
|
480
481
|
|
|
@@ -560,8 +561,7 @@ const getJsdocProcessorPlugin = (options = {}) => {
|
|
|
560
561
|
}
|
|
561
562
|
return [];
|
|
562
563
|
},
|
|
563
|
-
|
|
564
|
-
supportsAutofix: false
|
|
564
|
+
supportsAutofix: true
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsdocProcessorPlugin.cjs","names":["_jsdocUtils","require","_jsdoccomment","espree","_interopRequireWildcard","_nodeFs","_nodePath","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","version","JSON","parse","readFileSync","join","__dirname","likelyNestedJSDocIndentSpace","preTagSpaceLength","firstLinePrefixLength","hasCaptionRegex","escapeStringRegexp","str","replaceAll","countChars","ch","match","RegExp","length","getLinesCols","text","matchLines","colDelta","slice","lastIndexOf","getJsdocProcessorPlugin","options","allowedLanguagesToProcess","captionRequired","checkDefaults","checkExamples","checkParams","checkProperties","exampleCodeRegex","matchingFileName","matchingFileNameDefaults","matchingFileNameParams","matchingFileNameProperties","paddedIndent","parser","undefined","rejectExampleCodeRegex","sourceType","exampleCodeRegExp","rejectExampleCodeRegExp","getRegexFromString","otherInfo","extraMessages","getTextsAndFileNames","jsdoc","jsFileName","commentLineCols","textsAndFileNames","checkSource","cols","defaultFileName","ext","filename","lines","skipInit","source","sources","tag","line","targetTagName","push","nonJSPrefacingCols","nonJSPrefacingLines","string","addSourceInfo","src","file","number","codeStartLine","codeStartCol","targetSource","getFilenameInfo","includes","replace","filenameInfo","forEachPreferredTag","description","trim","getTagDescription","tagName","getPreferredTagName","hasTag","matchingFilenameInfo","column","message","ruleId","severity","test","matches","exec","groups","language","toLowerCase","startingIndex","lastStringCount","exampleCode","lastIndex","n0","n1","index","preMatch","preMatchLines","nonJSPreface","nonJSPrefaceLineCount","idx","indexOf","charsInLastLine","global","meta","name","processors","examples","postprocess","jsMessages","messages","entries","msg","endColumn","endLine","fatal","messageText","codeCtxLine","codeCtxColumn","startLine","startCol","ret","concat","preprocess","ast","parseForESLint","comment","ecmaVersion","jsdocComments","comments","filter","value","map","start","range","textToStart","parseComment","flatMap","error","console","log","supportsAutofix","exports"],"sources":["../src/getJsdocProcessorPlugin.js"],"sourcesContent":["import {\n forEachPreferredTag,\n getPreferredTagName,\n getRegexFromString,\n getTagDescription,\n hasTag,\n} from './jsdocUtils.js';\nimport {\n parseComment,\n} from '@es-joy/jsdoccomment';\nimport * as espree from 'espree';\nimport {\n readFileSync,\n} from 'node:fs';\nimport {\n join,\n} from 'node:path';\n\n/**\n * @import {\n * Integer,\n * JsdocBlockWithInline,\n * } from './iterateJsdoc.js';\n * @import {\n * ESLint,\n * Linter,\n * } from 'eslint';\n */\n\nconst {\n version,\n} = JSON.parse(\n // @ts-expect-error `Buffer` is ok for `JSON.parse`\n readFileSync(join(import.meta.dirname, '../package.json')),\n);\n\n// const zeroBasedLineIndexAdjust = -1;\nconst likelyNestedJSDocIndentSpace = 1;\nconst preTagSpaceLength = 1;\n\n// If a space is present, we should ignore it\nconst firstLinePrefixLength = preTagSpaceLength;\n\nconst hasCaptionRegex = /^\\s*<caption>([\\s\\S]*?)<\\/caption>/v;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst escapeStringRegexp = (str) => {\n return str.replaceAll(/[.*+?^$\\{\\}\\(\\)\\|\\[\\]\\\\]/gv, '\\\\$&');\n};\n\n/**\n * @param {string} str\n * @param {string} ch\n * @returns {Integer}\n */\nconst countChars = (str, ch) => {\n return (str.match(new RegExp(escapeStringRegexp(ch), 'gv')) || []).length;\n};\n\n/**\n * @param {string} text\n * @returns {[\n * Integer,\n * Integer\n * ]}\n */\nconst getLinesCols = (text) => {\n const matchLines = countChars(text, '\\n');\n\n const colDelta = matchLines ?\n text.slice(text.lastIndexOf('\\n') + 1).length :\n text.length;\n\n return [\n matchLines, colDelta,\n ];\n};\n\n/**\n * @typedef {number} Integer\n */\n\n/**\n * @typedef {object} JsdocProcessorOptions\n * @property {boolean} [captionRequired] Require captions for example tags\n * @property {Integer} [paddedIndent] See docs\n * @property {boolean} [checkDefaults] See docs\n * @property {boolean} [checkParams] See docs\n * @property {boolean} [checkExamples] See docs\n * @property {boolean} [checkProperties] See docs\n * @property {string} [matchingFileName] See docs\n * @property {string} [matchingFileNameDefaults] See docs\n * @property {string} [matchingFileNameParams] See docs\n * @property {string} [matchingFileNameProperties] See docs\n * @property {string|RegExp} [exampleCodeRegex] See docs\n * @property {string|RegExp} [rejectExampleCodeRegex] See docs\n * @property {string[]} [allowedLanguagesToProcess] See docs\n * @property {\"script\"|\"module\"} [sourceType] See docs\n * @property {import('eslint').Linter.ESTreeParser|import('eslint').Linter.NonESTreeParser} [parser] See docs\n */\n\n/**\n * We use a function for the ability of the user to pass in a config, but\n * without requiring all users of the plugin to do so.\n * @param {JsdocProcessorOptions} [options]\n * @returns {ESLint.Plugin}\n */\nexport const getJsdocProcessorPlugin = (options = {}) => {\n const {\n allowedLanguagesToProcess = [\n 'js', 'ts', 'javascript', 'typescript',\n ],\n captionRequired = false,\n checkDefaults = false,\n checkExamples = true,\n checkParams = false,\n checkProperties = false,\n exampleCodeRegex = null,\n matchingFileName = null,\n matchingFileNameDefaults = null,\n matchingFileNameParams = null,\n matchingFileNameProperties = null,\n paddedIndent = 0,\n parser = undefined,\n rejectExampleCodeRegex = null,\n sourceType = 'module',\n } = options;\n\n /** @type {RegExp} */\n let exampleCodeRegExp;\n /** @type {RegExp} */\n let rejectExampleCodeRegExp;\n\n if (exampleCodeRegex) {\n exampleCodeRegExp = typeof exampleCodeRegex === 'string' ?\n getRegexFromString(exampleCodeRegex) :\n exampleCodeRegex;\n }\n\n if (rejectExampleCodeRegex) {\n rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === 'string' ?\n getRegexFromString(rejectExampleCodeRegex) :\n rejectExampleCodeRegex;\n }\n\n /**\n * @type {{\n * targetTagName: string,\n * ext: string,\n * codeStartLine: number,\n * codeStartCol: number,\n * nonJSPrefacingCols: number,\n * commentLineCols: [number, number]\n * }[]}\n */\n const otherInfo = [];\n\n /** @type {import('eslint').Linter.LintMessage[]} */\n let extraMessages = [];\n\n /**\n * @param {JsdocBlockWithInline} jsdoc\n * @param {string} jsFileName\n * @param {[number, number]} commentLineCols\n */\n const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {\n /**\n * @type {{\n * text: string,\n * filename: string|null|undefined\n * }[]}\n */\n const textsAndFileNames = [];\n\n /**\n * @param {{\n * filename: string|null,\n * defaultFileName: string|undefined,\n * source: string,\n * targetTagName: string,\n * rules?: import('eslint').Linter.RulesRecord|undefined,\n * lines?: Integer,\n * cols?: Integer,\n * skipInit?: boolean,\n * ext: string,\n * sources?: {\n * nonJSPrefacingCols: Integer,\n * nonJSPrefacingLines: Integer,\n * string: string,\n * }[],\n * tag?: import('comment-parser').Spec & {\n * line?: Integer,\n * }|{\n * line: Integer,\n * }\n * }} cfg\n */\n const checkSource = ({\n cols = 0,\n defaultFileName,\n ext,\n filename,\n lines = 0,\n skipInit,\n source,\n sources = [],\n tag = {\n line: 0,\n },\n targetTagName,\n }) => {\n if (!skipInit) {\n sources.push({\n nonJSPrefacingCols: cols,\n nonJSPrefacingLines: lines,\n string: source,\n });\n }\n\n /**\n * @param {{\n * nonJSPrefacingCols: Integer,\n * nonJSPrefacingLines: Integer,\n * string: string\n * }} cfg\n */\n const addSourceInfo = function ({\n nonJSPrefacingCols,\n nonJSPrefacingLines,\n string,\n }) {\n const src = paddedIndent ?\n string.replaceAll(new RegExp(`(^|\\n) {${paddedIndent}}(?!$)`, 'gv'), '\\n') :\n string;\n\n // Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api\n const file = filename || defaultFileName;\n\n if (!('line' in tag)) {\n tag.line = tag.source[0].number;\n }\n\n // NOTE: `tag.line` can be 0 if of form `/** @tag ... */`\n const codeStartLine = /**\n * @type {import('comment-parser').Spec & {\n * line: Integer,\n * }}\n */ (tag).line + nonJSPrefacingLines;\n const codeStartCol = likelyNestedJSDocIndentSpace;\n\n textsAndFileNames.push({\n filename: file,\n text: src,\n });\n otherInfo.push({\n codeStartCol,\n codeStartLine,\n commentLineCols,\n ext,\n nonJSPrefacingCols,\n targetTagName,\n });\n };\n\n for (const targetSource of sources) {\n addSourceInfo(targetSource);\n }\n };\n\n /**\n *\n * @param {string|null} filename\n * @param {string} [ext] Since `eslint-plugin-markdown` v2, and\n * ESLint 7, this is the default which other JS-fenced rules will used.\n * Formerly \"md\" was the default.\n * @returns {{\n * defaultFileName: string|undefined,\n * filename: string|null,\n * ext: string\n * }}\n */\n const getFilenameInfo = (filename, ext = 'md/*.js') => {\n let defaultFileName;\n if (!filename) {\n if (typeof jsFileName === 'string' && jsFileName.includes('.')) {\n defaultFileName = jsFileName.replace(/\\.[^.]*$/v, `.${ext}`);\n } else {\n defaultFileName = `dummy.${ext}`;\n }\n }\n\n return {\n defaultFileName,\n ext,\n filename,\n };\n };\n\n if (checkDefaults) {\n const filenameInfo = getFilenameInfo(matchingFileNameDefaults, 'jsdoc-defaults');\n forEachPreferredTag(jsdoc, 'default', (tag, targetTagName) => {\n if (!tag.description.trim()) {\n return;\n }\n\n checkSource({\n source: `(${getTagDescription(tag)})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (checkParams) {\n const filenameInfo = getFilenameInfo(matchingFileNameParams, 'jsdoc-params');\n forEachPreferredTag(jsdoc, 'param', (tag, targetTagName) => {\n if (!tag.default || !tag.default.trim()) {\n return;\n }\n\n checkSource({\n source: `(${tag.default})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (checkProperties) {\n const filenameInfo = getFilenameInfo(matchingFileNameProperties, 'jsdoc-properties');\n forEachPreferredTag(jsdoc, 'property', (tag, targetTagName) => {\n if (!tag.default || !tag.default.trim()) {\n return;\n }\n\n checkSource({\n source: `(${tag.default})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (!checkExamples) {\n return textsAndFileNames;\n }\n\n const tagName = /** @type {string} */ (getPreferredTagName(jsdoc, {\n tagName: 'example',\n }));\n if (!hasTag(jsdoc, tagName)) {\n return textsAndFileNames;\n }\n\n const matchingFilenameInfo = getFilenameInfo(matchingFileName);\n\n forEachPreferredTag(jsdoc, 'example', (tag, targetTagName) => {\n let source = /** @type {string} */ (getTagDescription(tag));\n const match = source.match(hasCaptionRegex);\n\n if (captionRequired && (!match || !match[1].trim())) {\n extraMessages.push({\n column: commentLineCols[1] + 1,\n line: 1 + commentLineCols[0] + (tag.line ?? tag.source[0].number),\n message: `@${targetTagName} error - Caption is expected for examples.`,\n ruleId: 'jsdoc/example-missing-caption',\n severity: 2,\n });\n return;\n }\n\n source = source.replace(hasCaptionRegex, '');\n const [\n lines,\n cols,\n ] = match ? getLinesCols(match[0]) : [\n 0, 0,\n ];\n\n if (exampleCodeRegex && !exampleCodeRegExp.test(source) ||\n rejectExampleCodeRegex && rejectExampleCodeRegExp.test(source)\n ) {\n return;\n }\n\n // If `allowedLanguagesToProcess` is falsy, all languages should be processed.\n if (allowedLanguagesToProcess) {\n const matches = (/^\\s*```(?<language>\\S+)([\\s\\S]*)```\\s*$/v).exec(source);\n if (matches?.groups && !allowedLanguagesToProcess.includes(\n matches.groups.language.toLowerCase(),\n )) {\n return;\n }\n }\n\n const sources = [];\n let skipInit = false;\n if (exampleCodeRegex) {\n let nonJSPrefacingCols = 0;\n let nonJSPrefacingLines = 0;\n\n let startingIndex = 0;\n let lastStringCount = 0;\n\n let exampleCode;\n exampleCodeRegExp.lastIndex = 0;\n while ((exampleCode = exampleCodeRegExp.exec(source)) !== null) {\n const {\n '0': n0,\n '1': n1,\n index,\n } = exampleCode;\n\n // Count anything preceding user regex match (can affect line numbering)\n const preMatch = source.slice(startingIndex, index);\n\n const [\n preMatchLines,\n colDelta,\n ] = getLinesCols(preMatch);\n\n let nonJSPreface;\n let nonJSPrefaceLineCount;\n if (n1) {\n const idx = n0.indexOf(n1);\n nonJSPreface = n0.slice(0, idx);\n nonJSPrefaceLineCount = countChars(nonJSPreface, '\\n');\n } else {\n nonJSPreface = '';\n nonJSPrefaceLineCount = 0;\n }\n\n nonJSPrefacingLines += lastStringCount + preMatchLines + nonJSPrefaceLineCount;\n\n // Ignore `preMatch` delta if newlines here\n if (nonJSPrefaceLineCount) {\n const charsInLastLine = nonJSPreface.slice(nonJSPreface.lastIndexOf('\\n') + 1).length;\n\n nonJSPrefacingCols += charsInLastLine;\n } else {\n nonJSPrefacingCols += colDelta + nonJSPreface.length;\n }\n\n const string = n1 || n0;\n sources.push({\n nonJSPrefacingCols,\n nonJSPrefacingLines,\n string,\n });\n startingIndex = exampleCodeRegExp.lastIndex;\n lastStringCount = countChars(string, '\\n');\n if (!exampleCodeRegExp.global) {\n break;\n }\n }\n\n skipInit = true;\n }\n\n checkSource({\n cols,\n lines,\n skipInit,\n source,\n sources,\n tag,\n targetTagName,\n ...matchingFilenameInfo,\n });\n });\n\n return textsAndFileNames;\n };\n\n // See https://eslint.org/docs/latest/extend/plugins#processors-in-plugins\n // See https://eslint.org/docs/latest/extend/custom-processors\n // From https://github.com/eslint/eslint/issues/14745#issuecomment-869457265\n /*\n {\n \"files\": [\"*.js\", \"*.ts\"],\n \"processor\": \"jsdoc/example\" // a pretended value here\n },\n {\n \"files\": [\n \"*.js/*_jsdoc-example.js\",\n \"*.ts/*_jsdoc-example.js\",\n \"*.js/*_jsdoc-example.ts\"\n ],\n \"rules\": {\n // specific rules for examples in jsdoc only here\n // And other rules for `.js` and `.ts` will also be enabled for them\n }\n }\n */\n return {\n meta: {\n name: 'eslint-plugin-jsdoc/processor',\n version,\n },\n processors: {\n examples: {\n meta: {\n name: 'eslint-plugin-jsdoc/preprocessor',\n version,\n },\n /**\n * @param {import('eslint').Linter.LintMessage[][]} messages\n * @param {string} filename\n */\n postprocess ([\n jsMessages,\n ...messages\n // eslint-disable-next-line no-unused-vars -- Placeholder\n ], filename) {\n for (const [\n idx,\n message,\n ] of messages.entries()) {\n const {\n codeStartCol,\n codeStartLine,\n commentLineCols,\n nonJSPrefacingCols,\n targetTagName,\n } = otherInfo[idx];\n\n for (const msg of message) {\n const {\n column,\n endColumn,\n endLine,\n fatal,\n line,\n message: messageText,\n ruleId,\n severity,\n\n // Todo: Make fixable\n // fix\n // fix: {range: [number, number], text: string}\n // suggestions: {desc: , messageId:, fix: }[],\n } = msg;\n\n const [\n codeCtxLine,\n codeCtxColumn,\n ] = commentLineCols;\n const startLine = codeCtxLine + codeStartLine + line;\n\n // Seems to need one more now\n const startCol = 1 +\n codeCtxColumn + codeStartCol + (\n // This might not work for line 0, but line 0 is unlikely for examples\n line <= 1 ? nonJSPrefacingCols + firstLinePrefixLength : preTagSpaceLength\n ) + column;\n\n msg.message = '@' + targetTagName + ' ' + (severity === 2 ? 'error' : 'warning') +\n (ruleId ? ' (' + ruleId + ')' : '') + ': ' +\n (fatal ? 'Fatal: ' : '') +\n messageText;\n msg.line = startLine;\n msg.column = startCol;\n msg.endLine = endLine ? startLine + endLine : startLine;\n // added `- column` to offset what `endColumn` already seemed to include\n msg.endColumn = endColumn ? startCol - column + endColumn : startCol;\n }\n }\n\n const ret = [\n ...jsMessages,\n ].concat(...messages, ...extraMessages);\n extraMessages = [];\n return ret;\n },\n\n /**\n * @param {string} text\n * @param {string} filename\n * @returns {(string | Linter.ProcessorFile)[]}\n */\n preprocess (text, filename) {\n try {\n let ast;\n\n // May be running a second time so catch and ignore\n try {\n ast = parser ?\n // @ts-expect-error Should be present\n parser.parseForESLint(text, {\n comment: true,\n ecmaVersion: 'latest',\n sourceType,\n }).ast :\n espree.parse(text, {\n comment: true,\n ecmaVersion: 'latest',\n sourceType,\n });\n } catch {\n return [\n text,\n ];\n }\n\n /** @type {[number, number][]} */\n const commentLineCols = [];\n const jsdocComments = /** @type {import('estree').Comment[]} */ (\n /**\n * @type {import('estree').Program & {\n * comments?: import('estree').Comment[]\n * }}\n */\n (ast).comments\n ).filter((comment) => {\n return (/^\\*\\s/v).test(comment.value);\n }).map((comment) => {\n const [\n start,\n /* c8 ignore next -- Unsupporting processors only? */\n ] = comment.range ?? [];\n const textToStart = text.slice(0, start);\n\n const [\n lines,\n cols,\n ] = getLinesCols(textToStart);\n\n // const lines = [...textToStart.matchAll(/\\n/gv)].length\n // const lastLinePos = textToStart.lastIndexOf('\\n');\n // const cols = lastLinePos === -1\n // ? 0\n // : textToStart.slice(lastLinePos).length;\n commentLineCols.push([\n lines, cols,\n ]);\n return parseComment(comment);\n });\n\n return [\n text,\n ...jsdocComments.flatMap((jsdoc, idx) => {\n return getTextsAndFileNames(\n jsdoc,\n filename,\n commentLineCols[idx],\n );\n }).filter(\n /**\n * @returns {file is Linter.ProcessorFile}\n */\n (file) => {\n return file !== null && file !== undefined;\n },\n ),\n ];\n /* c8 ignore next 6 */\n } catch (error) {\n // eslint-disable-next-line no-console -- Debugging\n console.log('err', fil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AAI,IAAIA,IAAI,KAAK/B,SAAS;YAC5C,CACF,CAAC,CACF;YACH;UACA,CAAC,CAAC,OAAO2G,KAAK,EAAE;YACd;YACAC,OAAO,CAACC,GAAG,CAAC,KAAK,EAAE5F,QAAQ,EAAE0F,KAAK,CAAC;UACrC;UAEA,OAAO,EAAE;QACX,CAAC;QACD;QACAG,eAAe,EAAE;MACnB;IACF;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAA9H,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"getJsdocProcessorPlugin.cjs","names":["_jsdocUtils","require","_jsdoccomment","espree","_interopRequireWildcard","_nodeFs","_nodePath","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","version","JSON","parse","readFileSync","join","__dirname","likelyNestedJSDocIndentSpace","preTagSpaceLength","firstLinePrefixLength","hasCaptionRegex","escapeStringRegexp","str","replaceAll","countChars","ch","match","RegExp","length","getLinesCols","text","matchLines","colDelta","slice","lastIndexOf","getJsdocProcessorPlugin","options","allowedLanguagesToProcess","captionRequired","checkDefaults","checkExamples","checkParams","checkProperties","exampleCodeRegex","matchingFileName","matchingFileNameDefaults","matchingFileNameParams","matchingFileNameProperties","paddedIndent","parser","undefined","rejectExampleCodeRegex","sourceType","exampleCodeRegExp","rejectExampleCodeRegExp","getRegexFromString","otherInfo","extraMessages","getTextsAndFileNames","jsdoc","jsFileName","commentLineCols","textsAndFileNames","checkSource","cols","defaultFileName","ext","filename","lines","skipInit","source","sources","tag","line","targetTagName","push","nonJSPrefacingCols","nonJSPrefacingLines","string","addSourceInfo","src","file","number","codeStartLine","codeStartCol","targetSource","getFilenameInfo","includes","replace","filenameInfo","forEachPreferredTag","description","trim","getTagDescription","tagName","getPreferredTagName","hasTag","matchingFilenameInfo","column","message","ruleId","severity","test","matches","exec","groups","language","toLowerCase","startingIndex","lastStringCount","exampleCode","lastIndex","n0","n1","index","preMatch","preMatchLines","nonJSPreface","nonJSPrefaceLineCount","idx","indexOf","charsInLastLine","global","meta","name","processors","examples","postprocess","jsMessages","messages","entries","msg","endColumn","endLine","fatal","messageText","fix","codeCtxLine","codeCtxColumn","startLine","startCol","ret","concat","preprocess","ast","parseForESLint","comment","ecmaVersion","jsdocComments","comments","filter","value","map","start","range","textToStart","parseComment","flatMap","error","console","log","supportsAutofix","exports"],"sources":["../src/getJsdocProcessorPlugin.js"],"sourcesContent":["import {\n forEachPreferredTag,\n getPreferredTagName,\n getRegexFromString,\n getTagDescription,\n hasTag,\n} from './jsdocUtils.js';\nimport {\n parseComment,\n} from '@es-joy/jsdoccomment';\nimport * as espree from 'espree';\nimport {\n readFileSync,\n} from 'node:fs';\nimport {\n join,\n} from 'node:path';\n\n/**\n * @import {\n * Integer,\n * JsdocBlockWithInline,\n * } from './iterateJsdoc.js';\n * @import {\n * ESLint,\n * Linter,\n * } from 'eslint';\n */\n\nconst {\n version,\n} = JSON.parse(\n // @ts-expect-error `Buffer` is ok for `JSON.parse`\n readFileSync(join(import.meta.dirname, '../package.json')),\n);\n\n// const zeroBasedLineIndexAdjust = -1;\nconst likelyNestedJSDocIndentSpace = 1;\nconst preTagSpaceLength = 1;\n\n// If a space is present, we should ignore it\nconst firstLinePrefixLength = preTagSpaceLength;\n\nconst hasCaptionRegex = /^\\s*<caption>([\\s\\S]*?)<\\/caption>/v;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst escapeStringRegexp = (str) => {\n return str.replaceAll(/[.*+?^$\\{\\}\\(\\)\\|\\[\\]\\\\]/gv, '\\\\$&');\n};\n\n/**\n * @param {string} str\n * @param {string} ch\n * @returns {Integer}\n */\nconst countChars = (str, ch) => {\n return (str.match(new RegExp(escapeStringRegexp(ch), 'gv')) || []).length;\n};\n\n/**\n * @param {string} text\n * @returns {[\n * Integer,\n * Integer\n * ]}\n */\nconst getLinesCols = (text) => {\n const matchLines = countChars(text, '\\n');\n\n const colDelta = matchLines ?\n text.slice(text.lastIndexOf('\\n') + 1).length :\n text.length;\n\n return [\n matchLines, colDelta,\n ];\n};\n\n/**\n * @typedef {number} Integer\n */\n\n/**\n * @typedef {object} JsdocProcessorOptions\n * @property {boolean} [captionRequired] Require captions for example tags\n * @property {Integer} [paddedIndent] See docs\n * @property {boolean} [checkDefaults] See docs\n * @property {boolean} [checkParams] See docs\n * @property {boolean} [checkExamples] See docs\n * @property {boolean} [checkProperties] See docs\n * @property {string} [matchingFileName] See docs\n * @property {string} [matchingFileNameDefaults] See docs\n * @property {string} [matchingFileNameParams] See docs\n * @property {string} [matchingFileNameProperties] See docs\n * @property {string|RegExp} [exampleCodeRegex] See docs\n * @property {string|RegExp} [rejectExampleCodeRegex] See docs\n * @property {string[]} [allowedLanguagesToProcess] See docs\n * @property {\"script\"|\"module\"} [sourceType] See docs\n * @property {import('eslint').Linter.ESTreeParser|import('eslint').Linter.NonESTreeParser} [parser] See docs\n */\n\n/**\n * We use a function for the ability of the user to pass in a config, but\n * without requiring all users of the plugin to do so.\n * @param {JsdocProcessorOptions} [options]\n * @returns {ESLint.Plugin}\n */\nexport const getJsdocProcessorPlugin = (options = {}) => {\n const {\n allowedLanguagesToProcess = [\n 'js', 'ts', 'javascript', 'typescript',\n ],\n captionRequired = false,\n checkDefaults = false,\n checkExamples = true,\n checkParams = false,\n checkProperties = false,\n exampleCodeRegex = null,\n matchingFileName = null,\n matchingFileNameDefaults = null,\n matchingFileNameParams = null,\n matchingFileNameProperties = null,\n paddedIndent = 0,\n parser = undefined,\n rejectExampleCodeRegex = null,\n sourceType = 'module',\n } = options;\n\n /** @type {RegExp} */\n let exampleCodeRegExp;\n /** @type {RegExp} */\n let rejectExampleCodeRegExp;\n\n if (exampleCodeRegex) {\n exampleCodeRegExp = typeof exampleCodeRegex === 'string' ?\n getRegexFromString(exampleCodeRegex) :\n exampleCodeRegex;\n }\n\n if (rejectExampleCodeRegex) {\n rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === 'string' ?\n getRegexFromString(rejectExampleCodeRegex) :\n rejectExampleCodeRegex;\n }\n\n /**\n * @type {{\n * targetTagName: string,\n * ext: string,\n * codeStartLine: number,\n * codeStartCol: number,\n * nonJSPrefacingCols: number,\n * commentLineCols: [number, number]\n * }[]}\n */\n const otherInfo = [];\n\n /** @type {import('eslint').Linter.LintMessage[]} */\n let extraMessages = [];\n\n /**\n * @param {JsdocBlockWithInline} jsdoc\n * @param {string} jsFileName\n * @param {[number, number]} commentLineCols\n */\n const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {\n /**\n * @type {{\n * text: string,\n * filename: string|null|undefined\n * }[]}\n */\n const textsAndFileNames = [];\n\n /**\n * @param {{\n * filename: string|null,\n * defaultFileName: string|undefined,\n * source: string,\n * targetTagName: string,\n * rules?: import('eslint').Linter.RulesRecord|undefined,\n * lines?: Integer,\n * cols?: Integer,\n * skipInit?: boolean,\n * ext: string,\n * sources?: {\n * nonJSPrefacingCols: Integer,\n * nonJSPrefacingLines: Integer,\n * string: string,\n * }[],\n * tag?: import('comment-parser').Spec & {\n * line?: Integer,\n * }|{\n * line: Integer,\n * }\n * }} cfg\n */\n const checkSource = ({\n cols = 0,\n defaultFileName,\n ext,\n filename,\n lines = 0,\n skipInit,\n source,\n sources = [],\n tag = {\n line: 0,\n },\n targetTagName,\n }) => {\n if (!skipInit) {\n sources.push({\n nonJSPrefacingCols: cols,\n nonJSPrefacingLines: lines,\n string: source,\n });\n }\n\n /**\n * @param {{\n * nonJSPrefacingCols: Integer,\n * nonJSPrefacingLines: Integer,\n * string: string\n * }} cfg\n */\n const addSourceInfo = function ({\n nonJSPrefacingCols,\n nonJSPrefacingLines,\n string,\n }) {\n const src = paddedIndent ?\n string.replaceAll(new RegExp(`(^|\\n) {${paddedIndent}}(?!$)`, 'gv'), '\\n') :\n string;\n\n // Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api\n const file = filename || defaultFileName;\n\n if (!('line' in tag)) {\n tag.line = tag.source[0].number;\n }\n\n // NOTE: `tag.line` can be 0 if of form `/** @tag ... */`\n const codeStartLine = /**\n * @type {import('comment-parser').Spec & {\n * line: Integer,\n * }}\n */ (tag).line + nonJSPrefacingLines;\n const codeStartCol = likelyNestedJSDocIndentSpace;\n\n textsAndFileNames.push({\n filename: file,\n text: src,\n });\n otherInfo.push({\n codeStartCol,\n codeStartLine,\n commentLineCols,\n ext,\n nonJSPrefacingCols,\n targetTagName,\n });\n };\n\n for (const targetSource of sources) {\n addSourceInfo(targetSource);\n }\n };\n\n /**\n *\n * @param {string|null} filename\n * @param {string} [ext] Since `eslint-plugin-markdown` v2, and\n * ESLint 7, this is the default which other JS-fenced rules will used.\n * Formerly \"md\" was the default.\n * @returns {{\n * defaultFileName: string|undefined,\n * filename: string|null,\n * ext: string\n * }}\n */\n const getFilenameInfo = (filename, ext = 'md/*.js') => {\n let defaultFileName;\n if (!filename) {\n if (typeof jsFileName === 'string' && jsFileName.includes('.')) {\n defaultFileName = jsFileName.replace(/\\.[^.]*$/v, `.${ext}`);\n } else {\n defaultFileName = `dummy.${ext}`;\n }\n }\n\n return {\n defaultFileName,\n ext,\n filename,\n };\n };\n\n if (checkDefaults) {\n const filenameInfo = getFilenameInfo(matchingFileNameDefaults, 'jsdoc-defaults');\n forEachPreferredTag(jsdoc, 'default', (tag, targetTagName) => {\n if (!tag.description.trim()) {\n return;\n }\n\n checkSource({\n source: `(${getTagDescription(tag)})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (checkParams) {\n const filenameInfo = getFilenameInfo(matchingFileNameParams, 'jsdoc-params');\n forEachPreferredTag(jsdoc, 'param', (tag, targetTagName) => {\n if (!tag.default || !tag.default.trim()) {\n return;\n }\n\n checkSource({\n source: `(${tag.default})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (checkProperties) {\n const filenameInfo = getFilenameInfo(matchingFileNameProperties, 'jsdoc-properties');\n forEachPreferredTag(jsdoc, 'property', (tag, targetTagName) => {\n if (!tag.default || !tag.default.trim()) {\n return;\n }\n\n checkSource({\n source: `(${tag.default})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (!checkExamples) {\n return textsAndFileNames;\n }\n\n const tagName = /** @type {string} */ (getPreferredTagName(jsdoc, {\n tagName: 'example',\n }));\n if (!hasTag(jsdoc, tagName)) {\n return textsAndFileNames;\n }\n\n const matchingFilenameInfo = getFilenameInfo(matchingFileName);\n\n forEachPreferredTag(jsdoc, 'example', (tag, targetTagName) => {\n let source = /** @type {string} */ (getTagDescription(tag));\n const match = source.match(hasCaptionRegex);\n\n if (captionRequired && (!match || !match[1].trim())) {\n extraMessages.push({\n column: commentLineCols[1] + 1,\n line: 1 + commentLineCols[0] + (tag.line ?? tag.source[0].number),\n message: `@${targetTagName} error - Caption is expected for examples.`,\n ruleId: 'jsdoc/example-missing-caption',\n severity: 2,\n });\n return;\n }\n\n source = source.replace(hasCaptionRegex, '');\n const [\n lines,\n cols,\n ] = match ? getLinesCols(match[0]) : [\n 0, 0,\n ];\n\n if (exampleCodeRegex && !exampleCodeRegExp.test(source) ||\n rejectExampleCodeRegex && rejectExampleCodeRegExp.test(source)\n ) {\n return;\n }\n\n // If `allowedLanguagesToProcess` is falsy, all languages should be processed.\n if (allowedLanguagesToProcess) {\n const matches = (/^\\s*```(?<language>\\S+)([\\s\\S]*)```\\s*$/v).exec(source);\n if (matches?.groups && !allowedLanguagesToProcess.includes(\n matches.groups.language.toLowerCase(),\n )) {\n return;\n }\n }\n\n const sources = [];\n let skipInit = false;\n if (exampleCodeRegex) {\n let nonJSPrefacingCols = 0;\n let nonJSPrefacingLines = 0;\n\n let startingIndex = 0;\n let lastStringCount = 0;\n\n let exampleCode;\n exampleCodeRegExp.lastIndex = 0;\n while ((exampleCode = exampleCodeRegExp.exec(source)) !== null) {\n const {\n '0': n0,\n '1': n1,\n index,\n } = exampleCode;\n\n // Count anything preceding user regex match (can affect line numbering)\n const preMatch = source.slice(startingIndex, index);\n\n const [\n preMatchLines,\n colDelta,\n ] = getLinesCols(preMatch);\n\n let nonJSPreface;\n let nonJSPrefaceLineCount;\n if (n1) {\n const idx = n0.indexOf(n1);\n nonJSPreface = n0.slice(0, idx);\n nonJSPrefaceLineCount = countChars(nonJSPreface, '\\n');\n } else {\n nonJSPreface = '';\n nonJSPrefaceLineCount = 0;\n }\n\n nonJSPrefacingLines += lastStringCount + preMatchLines + nonJSPrefaceLineCount;\n\n // Ignore `preMatch` delta if newlines here\n if (nonJSPrefaceLineCount) {\n const charsInLastLine = nonJSPreface.slice(nonJSPreface.lastIndexOf('\\n') + 1).length;\n\n nonJSPrefacingCols += charsInLastLine;\n } else {\n nonJSPrefacingCols += colDelta + nonJSPreface.length;\n }\n\n const string = n1 || n0;\n sources.push({\n nonJSPrefacingCols,\n nonJSPrefacingLines,\n string,\n });\n startingIndex = exampleCodeRegExp.lastIndex;\n lastStringCount = countChars(string, '\\n');\n if (!exampleCodeRegExp.global) {\n break;\n }\n }\n\n skipInit = true;\n }\n\n checkSource({\n cols,\n lines,\n skipInit,\n source,\n sources,\n tag,\n targetTagName,\n ...matchingFilenameInfo,\n });\n });\n\n return textsAndFileNames;\n };\n\n // See https://eslint.org/docs/latest/extend/plugins#processors-in-plugins\n // See https://eslint.org/docs/latest/extend/custom-processors\n // From https://github.com/eslint/eslint/issues/14745#issuecomment-869457265\n /*\n {\n \"files\": [\"*.js\", \"*.ts\"],\n \"processor\": \"jsdoc/example\" // a pretended value here\n },\n {\n \"files\": [\n \"*.js/*_jsdoc-example.js\",\n \"*.ts/*_jsdoc-example.js\",\n \"*.js/*_jsdoc-example.ts\"\n ],\n \"rules\": {\n // specific rules for examples in jsdoc only here\n // And other rules for `.js` and `.ts` will also be enabled for them\n }\n }\n */\n return {\n meta: {\n name: 'eslint-plugin-jsdoc/processor',\n version,\n },\n processors: {\n examples: {\n meta: {\n name: 'eslint-plugin-jsdoc/preprocessor',\n version,\n },\n /**\n * @param {import('eslint').Linter.LintMessage[][]} messages\n * @param {string} filename\n */\n postprocess ([\n jsMessages,\n ...messages\n // eslint-disable-next-line no-unused-vars -- Placeholder\n ], filename) {\n for (const [\n idx,\n message,\n ] of messages.entries()) {\n const {\n codeStartCol,\n codeStartLine,\n commentLineCols,\n nonJSPrefacingCols,\n targetTagName,\n } = otherInfo[idx];\n\n for (const msg of message) {\n const {\n column,\n endColumn,\n endLine,\n fatal,\n line,\n message: messageText,\n ruleId,\n severity,\n\n // Todo: Make fixable\n // fix\n // fix: {range: [number, number], text: string}\n // suggestions: {desc: , messageId:, fix: }[],\n } = msg;\n delete msg.fix;\n\n const [\n codeCtxLine,\n codeCtxColumn,\n ] = commentLineCols;\n const startLine = codeCtxLine + codeStartLine + line;\n\n // Seems to need one more now\n const startCol = 1 +\n codeCtxColumn + codeStartCol + (\n // This might not work for line 0, but line 0 is unlikely for examples\n line <= 1 ? nonJSPrefacingCols + firstLinePrefixLength : preTagSpaceLength\n ) + column;\n\n msg.message = '@' + targetTagName + ' ' + (severity === 2 ? 'error' : 'warning') +\n (ruleId ? ' (' + ruleId + ')' : '') + ': ' +\n (fatal ? 'Fatal: ' : '') +\n messageText;\n msg.line = startLine;\n msg.column = startCol;\n msg.endLine = endLine ? startLine + endLine : startLine;\n // added `- column` to offset what `endColumn` already seemed to include\n msg.endColumn = endColumn ? startCol - column + endColumn : startCol;\n }\n }\n\n const ret = [\n ...jsMessages,\n ].concat(...messages, ...extraMessages);\n extraMessages = [];\n return ret;\n },\n\n /**\n * @param {string} text\n * @param {string} filename\n * @returns {(string | Linter.ProcessorFile)[]}\n */\n preprocess (text, filename) {\n try {\n let ast;\n\n // May be running a second time so catch and ignore\n try {\n ast = parser ?\n // @ts-expect-error Should be present\n parser.parseForESLint(text, {\n comment: true,\n ecmaVersion: 'latest',\n sourceType,\n }).ast :\n espree.parse(text, {\n comment: true,\n ecmaVersion: 'latest',\n sourceType,\n });\n } catch {\n return [\n text,\n ];\n }\n\n /** @type {[number, number][]} */\n const commentLineCols = [];\n const jsdocComments = /** @type {import('estree').Comment[]} */ (\n /**\n * @type {import('estree').Program & {\n * comments?: import('estree').Comment[]\n * }}\n */\n (ast).comments\n ).filter((comment) => {\n return (/^\\*\\s/v).test(comment.value);\n }).map((comment) => {\n const [\n start,\n /* c8 ignore next -- Unsupporting processors only? */\n ] = comment.range ?? [];\n const textToStart = text.slice(0, start);\n\n const [\n lines,\n cols,\n ] = getLinesCols(textToStart);\n\n // const lines = [...textToStart.matchAll(/\\n/gv)].length\n // const lastLinePos = textToStart.lastIndexOf('\\n');\n // const cols = lastLinePos === -1\n // ? 0\n // : textToStart.slice(lastLinePos).length;\n commentLineCols.push([\n lines, cols,\n ]);\n return parseComment(comment);\n });\n\n return [\n text,\n ...jsdocComments.flatMap((jsdoc, idx) => {\n return getTextsAndFileNames(\n jsdoc,\n filename,\n commentLineCols[idx],\n );\n }).filter(\n /**\n * @returns {file is Linter.ProcessorFile}\n */\n (file) => {\n return file !== null && file !== undefined;\n },\n ),\n ];\n /* c8 ignore next 6 */\n } catch (error) {\n // eslint-disable-next-line no-console -- Debugging\n console.log('err', filename, error);\n }\n\n return [];\n },\n supportsAutofix: true,\n },\n },\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,aAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAGA,IAAAK,SAAA,GAAAL,OAAA;AAEmB,SAAAG,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CA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AO,IAAK;cAClB,MAAM,CACJO;cACA,sDACD,GAAGP,OAAO,CAACQ,KAAK,IAAI,EAAE;cACvB,MAAMC,WAAW,GAAG7H,IAAI,CAACG,KAAK,CAAC,CAAC,EAAEwH,KAAK,CAAC;cAExC,MAAM,CACJrF,KAAK,EACLJ,IAAI,CACL,GAAGnC,YAAY,CAAC8H,WAAW,CAAC;;cAE7B;cACA;cACA;cACA;cACA;cACA9F,eAAe,CAACc,IAAI,CAAC,CACnBP,KAAK,EAAEJ,IAAI,CACZ,CAAC;cACF,OAAO,IAAA4F,0BAAY,EAACV,OAAO,CAAC;YAC9B,CAAC,CAAC;YAEF,OAAO,CACLpH,IAAI,EACJ,GAAGsH,aAAa,CAACS,OAAO,CAAC,CAAClG,KAAK,EAAE4D,GAAG,KAAK;cACvC,OAAO7D,oBAAoB,CACzBC,KAAK,EACLQ,QAAQ,EACRN,eAAe,CAAC0D,GAAG,CACrB,CAAC;YACH,CAAC,CAAC,CAAC+B,MAAM;YACP;AAChB;AACA;YACiBrE,IAAI,IAAK;cACR,OAAOA,IAAI,KAAK,IAAI,IAAIA,IAAI,KAAK/B,SAAS;YAC5C,CACF,CAAC,CACF;YACH;UACA,CAAC,CAAC,OAAO4G,KAAK,EAAE;YACd;YACAC,OAAO,CAACC,GAAG,CAAC,KAAK,EAAE7F,QAAQ,EAAE2F,KAAK,CAAC;UACrC;UAEA,OAAO,EAAE;QACX,CAAC;QACDG,eAAe,EAAE;MACnB;IACF;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAA/H,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -83,6 +83,10 @@ const OPTIONS_SCHEMA = {
|
|
|
83
83
|
default: false,
|
|
84
84
|
type: 'boolean'
|
|
85
85
|
},
|
|
86
|
+
exemptOverloadedImplementations: {
|
|
87
|
+
default: false,
|
|
88
|
+
type: 'boolean'
|
|
89
|
+
},
|
|
86
90
|
fixerMessage: {
|
|
87
91
|
default: '',
|
|
88
92
|
type: 'string'
|
|
@@ -144,6 +148,10 @@ const OPTIONS_SCHEMA = {
|
|
|
144
148
|
}
|
|
145
149
|
},
|
|
146
150
|
type: 'object'
|
|
151
|
+
},
|
|
152
|
+
skipInterveningOverloadedDeclarations: {
|
|
153
|
+
default: true,
|
|
154
|
+
type: 'boolean'
|
|
147
155
|
}
|
|
148
156
|
},
|
|
149
157
|
type: 'object'
|
|
@@ -249,6 +257,8 @@ const getOption = (context, baseObject, option, key) => {
|
|
|
249
257
|
* enableFixer: boolean,
|
|
250
258
|
* exemptEmptyConstructors: boolean,
|
|
251
259
|
* exemptEmptyFunctions: boolean,
|
|
260
|
+
* skipInterveningOverloadedDeclarations: boolean,
|
|
261
|
+
* exemptOverloadedImplementations: boolean,
|
|
252
262
|
* fixerMessage: string,
|
|
253
263
|
* minLineCount: undefined|import('../iterateJsdoc.js').Integer,
|
|
254
264
|
* publicOnly: boolean|{[key: string]: boolean|undefined}
|
|
@@ -261,15 +271,18 @@ const getOptions = (context, settings) => {
|
|
|
261
271
|
enableFixer = true,
|
|
262
272
|
exemptEmptyConstructors = true,
|
|
263
273
|
exemptEmptyFunctions = false,
|
|
274
|
+
exemptOverloadedImplementations = false,
|
|
264
275
|
fixerMessage = '',
|
|
265
276
|
minLineCount = undefined,
|
|
266
|
-
publicOnly
|
|
277
|
+
publicOnly,
|
|
278
|
+
skipInterveningOverloadedDeclarations = true
|
|
267
279
|
} = context.options[0] || {};
|
|
268
280
|
return {
|
|
269
281
|
contexts,
|
|
270
282
|
enableFixer,
|
|
271
283
|
exemptEmptyConstructors,
|
|
272
284
|
exemptEmptyFunctions,
|
|
285
|
+
exemptOverloadedImplementations,
|
|
273
286
|
fixerMessage,
|
|
274
287
|
minLineCount,
|
|
275
288
|
publicOnly: (baseObj => {
|
|
@@ -300,10 +313,45 @@ const getOptions = (context, settings) => {
|
|
|
300
313
|
}
|
|
301
314
|
return properties;
|
|
302
315
|
})(/** @type {import('json-schema').JSONSchema4Object} */
|
|
303
|
-
OPTIONS_SCHEMA.properties.require)
|
|
316
|
+
OPTIONS_SCHEMA.properties.require),
|
|
317
|
+
skipInterveningOverloadedDeclarations
|
|
304
318
|
};
|
|
305
319
|
};
|
|
306
320
|
|
|
321
|
+
/**
|
|
322
|
+
* @param {ESLintOrTSNode} node
|
|
323
|
+
*/
|
|
324
|
+
const isFunctionWithOverload = node => {
|
|
325
|
+
if (node.type !== 'FunctionDeclaration') {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
let parent;
|
|
329
|
+
let child;
|
|
330
|
+
if (node.parent?.type === 'Program') {
|
|
331
|
+
parent = node.parent;
|
|
332
|
+
child = node;
|
|
333
|
+
} else if (node.parent?.type === 'ExportNamedDeclaration' && node.parent?.parent.type === 'Program') {
|
|
334
|
+
parent = node.parent?.parent;
|
|
335
|
+
child = node.parent;
|
|
336
|
+
}
|
|
337
|
+
if (!child || !parent) {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
const functionName = node.id.name;
|
|
341
|
+
const idx = parent.body.indexOf(child);
|
|
342
|
+
const prevSibling = parent.body[idx - 1];
|
|
343
|
+
return (
|
|
344
|
+
// @ts-expect-error Should be ok
|
|
345
|
+
prevSibling?.type === 'TSDeclareFunction' &&
|
|
346
|
+
// @ts-expect-error Should be ok
|
|
347
|
+
functionName === prevSibling.id.name || prevSibling?.type === 'ExportNamedDeclaration' &&
|
|
348
|
+
// @ts-expect-error Should be ok
|
|
349
|
+
prevSibling.declaration?.type === 'TSDeclareFunction' &&
|
|
350
|
+
// @ts-expect-error Should be ok
|
|
351
|
+
prevSibling.declaration?.id?.name === functionName
|
|
352
|
+
);
|
|
353
|
+
};
|
|
354
|
+
|
|
307
355
|
/** @type {import('eslint').Rule.RuleModule} */
|
|
308
356
|
var _default = exports.default = {
|
|
309
357
|
create(context) {
|
|
@@ -321,9 +369,11 @@ var _default = exports.default = {
|
|
|
321
369
|
enableFixer,
|
|
322
370
|
exemptEmptyConstructors,
|
|
323
371
|
exemptEmptyFunctions,
|
|
372
|
+
exemptOverloadedImplementations,
|
|
324
373
|
fixerMessage,
|
|
325
374
|
minLineCount,
|
|
326
|
-
require: requireOption
|
|
375
|
+
require: requireOption,
|
|
376
|
+
skipInterveningOverloadedDeclarations
|
|
327
377
|
} = opts;
|
|
328
378
|
const publicOnly =
|
|
329
379
|
/**
|
|
@@ -380,7 +430,12 @@ var _default = exports.default = {
|
|
|
380
430
|
return;
|
|
381
431
|
}
|
|
382
432
|
}
|
|
383
|
-
|
|
433
|
+
if (exemptOverloadedImplementations && isFunctionWithOverload(node)) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const jsDocNode = (0, _jsdoccomment.getJSDocComment)(sourceCode, node, settings, {
|
|
437
|
+
checkOverloads: skipInterveningOverloadedDeclarations
|
|
438
|
+
});
|
|
384
439
|
if (jsDocNode) {
|
|
385
440
|
return;
|
|
386
441
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireJsdoc.cjs","names":["_exportParser","_interopRequireDefault","require","_iterateJsdoc","_jsdocUtils","_jsdoccomment","e","__esModule","default","OPTIONS_SCHEMA","additionalProperties","properties","checkConstructors","type","checkGetters","anyOf","enum","checkSetters","contexts","items","context","inlineCommentBlock","minLineCount","enableFixer","exemptEmptyConstructors","exemptEmptyFunctions","fixerMessage","publicOnly","oneOf","ancestorsOnly","cjs","esm","window","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","MethodDefinition","getMethodOnInterface","interfaceName","methodName","scope","scp","identifiers","name","variables","identifier","interfaceDeclaration","parent","bodyItem","body","methodSig","key","upper","isExemptedImplementer","node","sourceCode","settings","implments","implements","impl","expression","interfaceMethodNode","getScope","comment","getJSDocComment","getOption","baseObject","option","options","getOptions","undefined","baseObj","prop","Object","keys","opt","_default","exports","create","getSourceCode","getSettings","opts","requireOption","checkJsDoc","info","_handler","some","ctxt","count","underMinLine","getText","match","length","contextMinLineCount","find","ctx","selector","jsDocNode","exemptSpeciaMethods","description","inlineTags","problems","source","tags","isFunctionContext","isConstructor","functionParameterNames","getFunctionParameterNames","hasReturnValue","fix","fixer","lines","minLines","maxLines","baseNode","getReducedASTNode","decorator","getDecorator","indent","getIndent","text","loc","start","column","contxt","insertion","repeat","slice","insertTextBefore","report","end","line","messageId","Boolean","initModuleExports","initWindow","exported","exportParser","isUncommentedExport","hasOption","getContextObject","enforcedContexts","includes","value","meta","docs","category","recommended","url","fixable","messages","missingJsDoc","schema","module"],"sources":["../../src/rules/requireJsdoc.js"],"sourcesContent":["import exportParser from '../exportParser.js';\nimport {\n getSettings,\n} from '../iterateJsdoc.js';\nimport {\n enforcedContexts,\n exemptSpeciaMethods,\n getContextObject,\n getFunctionParameterNames,\n getIndent,\n hasReturnValue,\n isConstructor,\n} from '../jsdocUtils.js';\nimport {\n getDecorator,\n getJSDocComment,\n getReducedASTNode,\n} from '@es-joy/jsdoccomment';\n\n/**\n * @typedef {{\n * ancestorsOnly: boolean,\n * esm: boolean,\n * initModuleExports: boolean,\n * initWindow: boolean\n * }} RequireJsdocOpts\n */\n\n/**\n * @typedef {import('eslint').Rule.Node|\n * import('@typescript-eslint/types').TSESTree.Node} ESLintOrTSNode\n */\n\n/** @type {import('json-schema').JSONSchema4} */\nconst OPTIONS_SCHEMA = {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-setter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n checkSetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-getter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n context: {\n type: 'string',\n },\n inlineCommentBlock: {\n type: 'boolean',\n },\n minLineCount: {\n type: 'integer',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n default: true,\n type: 'boolean',\n },\n exemptEmptyConstructors: {\n default: false,\n type: 'boolean',\n },\n exemptEmptyFunctions: {\n default: false,\n type: 'boolean',\n },\n fixerMessage: {\n default: '',\n type: 'string',\n },\n minLineCount: {\n type: 'integer',\n },\n publicOnly: {\n oneOf: [\n {\n default: false,\n type: 'boolean',\n },\n {\n additionalProperties: false,\n default: {},\n properties: {\n ancestorsOnly: {\n type: 'boolean',\n },\n cjs: {\n type: 'boolean',\n },\n esm: {\n type: 'boolean',\n },\n window: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n },\n require: {\n additionalProperties: false,\n default: {},\n properties: {\n ArrowFunctionExpression: {\n default: false,\n type: 'boolean',\n },\n ClassDeclaration: {\n default: false,\n type: 'boolean',\n },\n ClassExpression: {\n default: false,\n type: 'boolean',\n },\n FunctionDeclaration: {\n default: true,\n type: 'boolean',\n },\n FunctionExpression: {\n default: false,\n type: 'boolean',\n },\n MethodDefinition: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n};\n\n/**\n * @param {string} interfaceName\n * @param {string} methodName\n * @param {import(\"eslint\").Scope.Scope | null} scope\n * @returns {import('@typescript-eslint/types').TSESTree.TSMethodSignature|null}\n */\nconst getMethodOnInterface = (interfaceName, methodName, scope) => {\n let scp = scope;\n while (scp) {\n for (const {\n identifiers,\n name,\n } of scp.variables) {\n if (interfaceName !== name) {\n continue;\n }\n\n for (const identifier of identifiers) {\n const interfaceDeclaration = /** @type {import('@typescript-eslint/types').TSESTree.Identifier & {parent: import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration}} */ (\n identifier\n ).parent;\n /* c8 ignore next 3 -- TS */\n if (interfaceDeclaration.type !== 'TSInterfaceDeclaration') {\n continue;\n }\n\n for (const bodyItem of interfaceDeclaration.body.body) {\n const methodSig = /** @type {import('@typescript-eslint/types').TSESTree.TSMethodSignature} */ (\n bodyItem\n );\n if (methodName === /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n methodSig.key\n ).name) {\n return methodSig;\n }\n }\n }\n }\n\n scp = scp.upper;\n }\n\n return null;\n};\n\n/**\n * @param {import('eslint').Rule.Node} node\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('../iterateJsdoc.js').Settings} settings\n */\nconst isExemptedImplementer = (node, sourceCode, context, settings) => {\n if (node.type === 'FunctionExpression' &&\n node.parent.type === 'MethodDefinition' &&\n node.parent.parent.type === 'ClassBody' &&\n node.parent.parent.parent.type === 'ClassDeclaration' &&\n 'implements' in node.parent.parent.parent\n ) {\n const implments = /** @type {import('@typescript-eslint/types').TSESTree.TSClassImplements[]} */ (\n node.parent.parent.parent.implements\n );\n\n const {\n name: methodName,\n } = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n node.parent.key\n );\n\n for (const impl of implments) {\n const {\n name: interfaceName,\n } = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n impl.expression\n );\n\n const interfaceMethodNode = getMethodOnInterface(interfaceName, methodName, node && (\n (sourceCode.getScope &&\n /* c8 ignore next 3 */\n sourceCode.getScope(node)) ||\n // @ts-expect-error ESLint 8\n context.getScope()\n ));\n if (interfaceMethodNode) {\n // @ts-expect-error Ok\n const comment = getJSDocComment(sourceCode, interfaceMethodNode, settings);\n if (comment) {\n return true;\n }\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('json-schema').JSONSchema4Object} baseObject\n * @param {string} option\n * @param {string} key\n * @returns {boolean|undefined}\n */\nconst getOption = (context, baseObject, option, key) => {\n if (context.options[0] && option in context.options[0] &&\n // Todo: boolean shouldn't be returning property, but\n // tests currently require\n (typeof context.options[0][option] === 'boolean' ||\n key in context.options[0][option])\n ) {\n return context.options[0][option][key];\n }\n\n return /** @type {{[key: string]: {default?: boolean|undefined}}} */ (\n baseObject.properties\n )[key].default;\n};\n\n/**\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('../iterateJsdoc.js').Settings} settings\n * @returns {{\n * contexts: (string|{\n * context: string,\n * inlineCommentBlock: boolean,\n * minLineCount: import('../iterateJsdoc.js').Integer\n * })[],\n * enableFixer: boolean,\n * exemptEmptyConstructors: boolean,\n * exemptEmptyFunctions: boolean,\n * fixerMessage: string,\n * minLineCount: undefined|import('../iterateJsdoc.js').Integer,\n * publicOnly: boolean|{[key: string]: boolean|undefined}\n * require: {[key: string]: boolean|undefined}\n * }}\n */\nconst getOptions = (context, settings) => {\n const {\n contexts = settings.contexts || [],\n enableFixer = true,\n exemptEmptyConstructors = true,\n exemptEmptyFunctions = false,\n fixerMessage = '',\n minLineCount = undefined,\n publicOnly,\n } = context.options[0] || {};\n\n return {\n contexts,\n enableFixer,\n exemptEmptyConstructors,\n exemptEmptyFunctions,\n fixerMessage,\n minLineCount,\n publicOnly: ((baseObj) => {\n if (!publicOnly) {\n return false;\n }\n\n /** @type {{[key: string]: boolean|undefined}} */\n const properties = {};\n for (const prop of Object.keys(\n /** @type {import('json-schema').JSONSchema4Object} */ (\n /** @type {import('json-schema').JSONSchema4Object} */ (\n baseObj\n ).properties),\n )) {\n const opt = getOption(\n context,\n /** @type {import('json-schema').JSONSchema4Object} */ (baseObj),\n 'publicOnly',\n prop,\n );\n\n properties[prop] = opt;\n }\n\n return properties;\n })(\n /** @type {import('json-schema').JSONSchema4Object} */\n (\n /** @type {import('json-schema').JSONSchema4Object} */\n (\n /** @type {import('json-schema').JSONSchema4Object} */\n (\n OPTIONS_SCHEMA.properties\n ).publicOnly\n ).oneOf\n )[1],\n ),\n require: ((baseObj) => {\n /** @type {{[key: string]: boolean|undefined}} */\n const properties = {};\n for (const prop of Object.keys(\n /** @type {import('json-schema').JSONSchema4Object} */ (\n /** @type {import('json-schema').JSONSchema4Object} */ (\n baseObj\n ).properties),\n )) {\n const opt = getOption(\n context,\n /** @type {import('json-schema').JSONSchema4Object} */\n (baseObj),\n 'require',\n prop,\n );\n properties[prop] = opt;\n }\n\n return properties;\n })(\n /** @type {import('json-schema').JSONSchema4Object} */\n (OPTIONS_SCHEMA.properties).require,\n ),\n };\n};\n\n/** @type {import('eslint').Rule.RuleModule} */\nexport default {\n create (context) {\n /* c8 ignore next -- Fallback to deprecated method */\n const {\n sourceCode = context.getSourceCode(),\n } = context;\n const settings = getSettings(context);\n if (!settings) {\n return {};\n }\n\n const opts = getOptions(context, settings);\n\n const {\n contexts,\n enableFixer,\n exemptEmptyConstructors,\n exemptEmptyFunctions,\n fixerMessage,\n minLineCount,\n require: requireOption,\n } = opts;\n\n const publicOnly =\n\n /**\n * @type {{\n * [key: string]: boolean | undefined;\n * }}\n */ (\n opts.publicOnly\n );\n\n /**\n * @type {import('../iterateJsdoc.js').CheckJsdoc}\n */\n const checkJsDoc = (info, _handler, node) => {\n if (\n // Optimize\n minLineCount !== undefined || contexts.some((ctxt) => {\n if (typeof ctxt === 'string') {\n return false;\n }\n\n const {\n minLineCount: count,\n } = ctxt;\n return count !== undefined;\n })\n ) {\n /**\n * @param {undefined|import('../iterateJsdoc.js').Integer} count\n */\n const underMinLine = (count) => {\n return count !== undefined && count >\n (sourceCode.getText(node).match(/\\n/gv)?.length ?? 0) + 1;\n };\n\n if (underMinLine(minLineCount)) {\n return;\n }\n\n const {\n minLineCount: contextMinLineCount,\n } =\n /**\n * @type {{\n * context: string;\n * inlineCommentBlock: boolean;\n * minLineCount: number;\n * }}\n */ (contexts.find((ctxt) => {\n if (typeof ctxt === 'string') {\n return false;\n }\n\n const {\n context: ctx,\n } = ctxt;\n return ctx === (info.selector || node.type);\n })) || {};\n if (underMinLine(contextMinLineCount)) {\n return;\n }\n }\n\n const jsDocNode = getJSDocComment(sourceCode, node, settings);\n\n if (jsDocNode) {\n return;\n }\n\n // For those who have options configured against ANY constructors (or\n // setters or getters) being reported\n if (exemptSpeciaMethods(\n {\n description: '',\n inlineTags: [],\n problems: [],\n source: [],\n tags: [],\n },\n node,\n context,\n [\n OPTIONS_SCHEMA,\n ],\n )) {\n return;\n }\n\n if (\n // Avoid reporting param-less, return-less functions (when\n // `exemptEmptyFunctions` option is set)\n exemptEmptyFunctions && info.isFunctionContext ||\n\n // Avoid reporting param-less, return-less constructor methods (when\n // `exemptEmptyConstructors` option is set)\n exemptEmptyConstructors && isConstructor(node)\n ) {\n const functionParameterNames = getFunctionParameterNames(node);\n if (!functionParameterNames.length && !hasReturnValue(node)) {\n return;\n }\n }\n\n if (isExemptedImplementer(node, sourceCode, context, settings)) {\n return;\n }\n\n const fix = /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n // Default to one line break if the `minLines`/`maxLines` settings allow\n const lines = settings.minLines === 0 && settings.maxLines >= 1 ? 1 : settings.minLines;\n /** @type {ESLintOrTSNode|import('@typescript-eslint/types').TSESTree.Decorator} */\n let baseNode = getReducedASTNode(node, sourceCode);\n\n const decorator = getDecorator(\n /** @type {import('eslint').Rule.Node} */\n (baseNode),\n );\n if (decorator) {\n baseNode = decorator;\n }\n\n const indent = getIndent({\n text: sourceCode.getText(\n /** @type {import('eslint').Rule.Node} */ (baseNode),\n /** @type {import('eslint').AST.SourceLocation} */\n (\n /** @type {import('eslint').Rule.Node} */ (baseNode).loc\n ).start.column,\n ),\n });\n\n const {\n inlineCommentBlock,\n } =\n /**\n * @type {{\n * context: string,\n * inlineCommentBlock: boolean,\n * minLineCount: import('../iterateJsdoc.js').Integer\n * }}\n */ (contexts.find((contxt) => {\n if (typeof contxt === 'string') {\n return false;\n }\n\n const {\n context: ctxt,\n } = contxt;\n return ctxt === node.type;\n })) || {};\n const insertion = (inlineCommentBlock ?\n `/** ${fixerMessage}` :\n `/**\\n${indent}*${fixerMessage}\\n${indent}`) +\n `*/${'\\n'.repeat(lines)}${indent.slice(0, -1)}`;\n\n return fixer.insertTextBefore(\n /** @type {import('eslint').Rule.Node} */\n (baseNode),\n insertion,\n );\n };\n\n const report = () => {\n const {\n start,\n } = /** @type {import('eslint').AST.SourceLocation} */ (node.loc);\n const loc = {\n end: {\n column: 0,\n line: start.line + 1,\n },\n start,\n };\n context.report({\n fix: enableFixer ? fix : null,\n loc,\n messageId: 'missingJsDoc',\n node,\n });\n };\n\n if (publicOnly) {\n /** @type {RequireJsdocOpts} */\n const opt = {\n ancestorsOnly: Boolean(publicOnly?.ancestorsOnly ?? false),\n esm: Boolean(publicOnly?.esm ?? true),\n initModuleExports: Boolean(publicOnly?.cjs ?? true),\n initWindow: Boolean(publicOnly?.window ?? false),\n };\n const exported = exportParser.isUncommentedExport(node, sourceCode, opt, settings);\n\n if (exported) {\n report();\n }\n } else {\n report();\n }\n };\n\n /**\n * @param {string} prop\n * @returns {boolean}\n */\n const hasOption = (prop) => {\n return requireOption[prop] || contexts.some((ctxt) => {\n return typeof ctxt === 'object' ? ctxt.context === prop : ctxt === prop;\n });\n };\n\n return {\n ...getContextObject(\n enforcedContexts(context, [], settings),\n checkJsDoc,\n ),\n ArrowFunctionExpression (node) {\n if (!hasOption('ArrowFunctionExpression')) {\n return;\n }\n\n if (\n [\n 'AssignmentExpression', 'ExportDefaultDeclaration', 'VariableDeclarator',\n ].includes(node.parent.type) ||\n [\n 'ClassProperty', 'ObjectProperty', 'Property', 'PropertyDefinition',\n ].includes(node.parent.type) &&\n node ===\n /**\n * @type {import('@typescript-eslint/types').TSESTree.Property|\n * import('@typescript-eslint/types').TSESTree.PropertyDefinition\n * }\n */\n (node.parent).value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n ClassDeclaration (node) {\n if (!hasOption('ClassDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n ClassExpression (node) {\n if (!hasOption('ClassExpression')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n FunctionDeclaration (node) {\n if (!hasOption('FunctionDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n },\n\n FunctionExpression (node) {\n if (!hasOption('FunctionExpression')) {\n return;\n }\n\n if (\n [\n 'AssignmentExpression', 'ExportDefaultDeclaration', 'VariableDeclarator',\n ].includes(node.parent.type) ||\n [\n 'ClassProperty', 'ObjectProperty', 'Property', 'PropertyDefinition',\n ].includes(node.parent.type) &&\n node ===\n /**\n * @type {import('@typescript-eslint/types').TSESTree.Property|\n * import('@typescript-eslint/types').TSESTree.PropertyDefinition\n * }\n */\n (node.parent).value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n MethodDefinition (node) {\n if (!hasOption('MethodDefinition')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n selector: 'MethodDefinition',\n }, null, /** @type {import('eslint').Rule.Node} */ (node.value));\n },\n };\n },\n meta: {\n docs: {\n category: 'Stylistic Issues',\n description: 'Require JSDoc comments',\n recommended: true,\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md#repos-sticky-header',\n },\n\n fixable: 'code',\n\n messages: {\n missingJsDoc: 'Missing JSDoc comment.',\n },\n\n schema: [\n OPTIONS_SCHEMA,\n ],\n\n type: 'suggestion',\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAGA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,aAAA,GAAAH,OAAA;AAI8B,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,MAAMG,cAAc,GAAG;EACrBC,oBAAoB,EAAE,KAAK;EAC3BC,UAAU,EAAE;IACVC,iBAAiB,EAAE;MACjBJ,OAAO,EAAE,IAAI;MACbK,IAAI,EAAE;IACR,CAAC;IACDC,YAAY,EAAE;MACZC,KAAK,EAAE,CACL;QACE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QAEA,IACE,CACE,sBAAsB,EAAE,0BAA0B,EAAE,oBAAoB,CACzE,CAACG,QAAQ,CAACxF,IAAI,CAACP,MAAM,CAACpC,IAAI,CAAC,IAC5B,CACE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,oBAAoB,CACpE,CAACmI,QAAQ,CAACxF,IAAI,CAACP,MAAM,CAACpC,IAAI,CAAC,IAC1B2C,IAAI;QACF;AACd;AACA;AACA;AACA;QACeA,IAAI,CAACP,MAAM,CAAEgG,KAAK,EACvB;UACA5D,UAAU,CAAC;YACTqB,iBAAiB,EAAE;UACrB,CAAC,EAAE,IAAI,EAAElD,IAAI,CAAC;QAChB;MACF,CAAC;MAEDlB,gBAAgBA,CAAEkB,IAAI,EAAE;QACtB,IAAI,CAACqF,SAAS,CAAC,kBAAkB,CAAC,EAAE;UAClC;QACF;QAEAxD,UAAU,CAAC;UACTqB,iBAAiB,EAAE,IAAI;UACvBR,QAAQ,EAAE;QACZ,CAAC,EAAE,IAAI,EAAE,yCAA2C1C,IAAI,CAACyF,KAAM,CAAC;MAClE;IACF,CAAC;EACH,CAAC;EACDC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,QAAQ,EAAE,kBAAkB;MAC5B/C,WAAW,EAAE,wBAAwB;MACrCgD,WAAW,EAAE,IAAI;MACjBC,GAAG,EAAE;IACP,CAAC;IAEDC,OAAO,EAAE,MAAM;IAEfC,QAAQ,EAAE;MACRC,YAAY,EAAE;IAChB,CAAC;IAEDC,MAAM,EAAE,CACNjJ,cAAc,CACf;IAEDI,IAAI,EAAE;EACR;AACF,CAAC;AAAA8I,MAAA,CAAA5E,OAAA,GAAAA,OAAA,CAAAvE,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"requireJsdoc.cjs","names":["_exportParser","_interopRequireDefault","require","_iterateJsdoc","_jsdocUtils","_jsdoccomment","e","__esModule","default","OPTIONS_SCHEMA","additionalProperties","properties","checkConstructors","type","checkGetters","anyOf","enum","checkSetters","contexts","items","context","inlineCommentBlock","minLineCount","enableFixer","exemptEmptyConstructors","exemptEmptyFunctions","exemptOverloadedImplementations","fixerMessage","publicOnly","oneOf","ancestorsOnly","cjs","esm","window","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","MethodDefinition","skipInterveningOverloadedDeclarations","getMethodOnInterface","interfaceName","methodName","scope","scp","identifiers","name","variables","identifier","interfaceDeclaration","parent","bodyItem","body","methodSig","key","upper","isExemptedImplementer","node","sourceCode","settings","implments","implements","impl","expression","interfaceMethodNode","getScope","comment","getJSDocComment","getOption","baseObject","option","options","getOptions","undefined","baseObj","prop","Object","keys","opt","isFunctionWithOverload","child","functionName","id","idx","indexOf","prevSibling","declaration","_default","exports","create","getSourceCode","getSettings","opts","requireOption","checkJsDoc","info","_handler","some","ctxt","count","underMinLine","getText","match","length","contextMinLineCount","find","ctx","selector","jsDocNode","checkOverloads","exemptSpeciaMethods","description","inlineTags","problems","source","tags","isFunctionContext","isConstructor","functionParameterNames","getFunctionParameterNames","hasReturnValue","fix","fixer","lines","minLines","maxLines","baseNode","getReducedASTNode","decorator","getDecorator","indent","getIndent","text","loc","start","column","contxt","insertion","repeat","slice","insertTextBefore","report","end","line","messageId","Boolean","initModuleExports","initWindow","exported","exportParser","isUncommentedExport","hasOption","getContextObject","enforcedContexts","includes","value","meta","docs","category","recommended","url","fixable","messages","missingJsDoc","schema","module"],"sources":["../../src/rules/requireJsdoc.js"],"sourcesContent":["import exportParser from '../exportParser.js';\nimport {\n getSettings,\n} from '../iterateJsdoc.js';\nimport {\n enforcedContexts,\n exemptSpeciaMethods,\n getContextObject,\n getFunctionParameterNames,\n getIndent,\n hasReturnValue,\n isConstructor,\n} from '../jsdocUtils.js';\nimport {\n getDecorator,\n getJSDocComment,\n getReducedASTNode,\n} from '@es-joy/jsdoccomment';\n\n/**\n * @typedef {{\n * ancestorsOnly: boolean,\n * esm: boolean,\n * initModuleExports: boolean,\n * initWindow: boolean\n * }} RequireJsdocOpts\n */\n\n/**\n * @typedef {import('eslint').Rule.Node|\n * import('@typescript-eslint/types').TSESTree.Node} ESLintOrTSNode\n */\n\n/** @type {import('json-schema').JSONSchema4} */\nconst OPTIONS_SCHEMA = {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-setter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n checkSetters: {\n anyOf: [\n {\n type: 'boolean',\n },\n {\n enum: [\n 'no-getter',\n ],\n type: 'string',\n },\n ],\n default: true,\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n context: {\n type: 'string',\n },\n inlineCommentBlock: {\n type: 'boolean',\n },\n minLineCount: {\n type: 'integer',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n default: true,\n type: 'boolean',\n },\n exemptEmptyConstructors: {\n default: false,\n type: 'boolean',\n },\n exemptEmptyFunctions: {\n default: false,\n type: 'boolean',\n },\n exemptOverloadedImplementations: {\n default: false,\n type: 'boolean',\n },\n fixerMessage: {\n default: '',\n type: 'string',\n },\n minLineCount: {\n type: 'integer',\n },\n publicOnly: {\n oneOf: [\n {\n default: false,\n type: 'boolean',\n },\n {\n additionalProperties: false,\n default: {},\n properties: {\n ancestorsOnly: {\n type: 'boolean',\n },\n cjs: {\n type: 'boolean',\n },\n esm: {\n type: 'boolean',\n },\n window: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n },\n require: {\n additionalProperties: false,\n default: {},\n properties: {\n ArrowFunctionExpression: {\n default: false,\n type: 'boolean',\n },\n ClassDeclaration: {\n default: false,\n type: 'boolean',\n },\n ClassExpression: {\n default: false,\n type: 'boolean',\n },\n FunctionDeclaration: {\n default: true,\n type: 'boolean',\n },\n FunctionExpression: {\n default: false,\n type: 'boolean',\n },\n MethodDefinition: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n skipInterveningOverloadedDeclarations: {\n default: true,\n type: 'boolean',\n },\n },\n type: 'object',\n};\n\n/**\n * @param {string} interfaceName\n * @param {string} methodName\n * @param {import(\"eslint\").Scope.Scope | null} scope\n * @returns {import('@typescript-eslint/types').TSESTree.TSMethodSignature|null}\n */\nconst getMethodOnInterface = (interfaceName, methodName, scope) => {\n let scp = scope;\n while (scp) {\n for (const {\n identifiers,\n name,\n } of scp.variables) {\n if (interfaceName !== name) {\n continue;\n }\n\n for (const identifier of identifiers) {\n const interfaceDeclaration = /** @type {import('@typescript-eslint/types').TSESTree.Identifier & {parent: import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration}} */ (\n identifier\n ).parent;\n /* c8 ignore next 3 -- TS */\n if (interfaceDeclaration.type !== 'TSInterfaceDeclaration') {\n continue;\n }\n\n for (const bodyItem of interfaceDeclaration.body.body) {\n const methodSig = /** @type {import('@typescript-eslint/types').TSESTree.TSMethodSignature} */ (\n bodyItem\n );\n if (methodName === /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n methodSig.key\n ).name) {\n return methodSig;\n }\n }\n }\n }\n\n scp = scp.upper;\n }\n\n return null;\n};\n\n/**\n * @param {import('eslint').Rule.Node} node\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('../iterateJsdoc.js').Settings} settings\n */\nconst isExemptedImplementer = (node, sourceCode, context, settings) => {\n if (node.type === 'FunctionExpression' &&\n node.parent.type === 'MethodDefinition' &&\n node.parent.parent.type === 'ClassBody' &&\n node.parent.parent.parent.type === 'ClassDeclaration' &&\n 'implements' in node.parent.parent.parent\n ) {\n const implments = /** @type {import('@typescript-eslint/types').TSESTree.TSClassImplements[]} */ (\n node.parent.parent.parent.implements\n );\n\n const {\n name: methodName,\n } = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n node.parent.key\n );\n\n for (const impl of implments) {\n const {\n name: interfaceName,\n } = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n impl.expression\n );\n\n const interfaceMethodNode = getMethodOnInterface(interfaceName, methodName, node && (\n (sourceCode.getScope &&\n /* c8 ignore next 3 */\n sourceCode.getScope(node)) ||\n // @ts-expect-error ESLint 8\n context.getScope()\n ));\n if (interfaceMethodNode) {\n // @ts-expect-error Ok\n const comment = getJSDocComment(sourceCode, interfaceMethodNode, settings);\n if (comment) {\n return true;\n }\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('json-schema').JSONSchema4Object} baseObject\n * @param {string} option\n * @param {string} key\n * @returns {boolean|undefined}\n */\nconst getOption = (context, baseObject, option, key) => {\n if (context.options[0] && option in context.options[0] &&\n // Todo: boolean shouldn't be returning property, but\n // tests currently require\n (typeof context.options[0][option] === 'boolean' ||\n key in context.options[0][option])\n ) {\n return context.options[0][option][key];\n }\n\n return /** @type {{[key: string]: {default?: boolean|undefined}}} */ (\n baseObject.properties\n )[key].default;\n};\n\n/**\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('../iterateJsdoc.js').Settings} settings\n * @returns {{\n * contexts: (string|{\n * context: string,\n * inlineCommentBlock: boolean,\n * minLineCount: import('../iterateJsdoc.js').Integer\n * })[],\n * enableFixer: boolean,\n * exemptEmptyConstructors: boolean,\n * exemptEmptyFunctions: boolean,\n * skipInterveningOverloadedDeclarations: boolean,\n * exemptOverloadedImplementations: boolean,\n * fixerMessage: string,\n * minLineCount: undefined|import('../iterateJsdoc.js').Integer,\n * publicOnly: boolean|{[key: string]: boolean|undefined}\n * require: {[key: string]: boolean|undefined}\n * }}\n */\nconst getOptions = (context, settings) => {\n const {\n contexts = settings.contexts || [],\n enableFixer = true,\n exemptEmptyConstructors = true,\n exemptEmptyFunctions = false,\n exemptOverloadedImplementations = false,\n fixerMessage = '',\n minLineCount = undefined,\n publicOnly,\n skipInterveningOverloadedDeclarations = true,\n } = context.options[0] || {};\n\n return {\n contexts,\n enableFixer,\n exemptEmptyConstructors,\n exemptEmptyFunctions,\n exemptOverloadedImplementations,\n fixerMessage,\n minLineCount,\n publicOnly: ((baseObj) => {\n if (!publicOnly) {\n return false;\n }\n\n /** @type {{[key: string]: boolean|undefined}} */\n const properties = {};\n for (const prop of Object.keys(\n /** @type {import('json-schema').JSONSchema4Object} */ (\n /** @type {import('json-schema').JSONSchema4Object} */ (\n baseObj\n ).properties),\n )) {\n const opt = getOption(\n context,\n /** @type {import('json-schema').JSONSchema4Object} */ (baseObj),\n 'publicOnly',\n prop,\n );\n\n properties[prop] = opt;\n }\n\n return properties;\n })(\n /** @type {import('json-schema').JSONSchema4Object} */\n (\n /** @type {import('json-schema').JSONSchema4Object} */\n (\n /** @type {import('json-schema').JSONSchema4Object} */\n (\n OPTIONS_SCHEMA.properties\n ).publicOnly\n ).oneOf\n )[1],\n ),\n require: ((baseObj) => {\n /** @type {{[key: string]: boolean|undefined}} */\n const properties = {};\n for (const prop of Object.keys(\n /** @type {import('json-schema').JSONSchema4Object} */ (\n /** @type {import('json-schema').JSONSchema4Object} */ (\n baseObj\n ).properties),\n )) {\n const opt = getOption(\n context,\n /** @type {import('json-schema').JSONSchema4Object} */\n (baseObj),\n 'require',\n prop,\n );\n properties[prop] = opt;\n }\n\n return properties;\n })(\n /** @type {import('json-schema').JSONSchema4Object} */\n (OPTIONS_SCHEMA.properties).require,\n ),\n skipInterveningOverloadedDeclarations,\n };\n};\n\n/**\n * @param {ESLintOrTSNode} node\n */\nconst isFunctionWithOverload = (node) => {\n if (node.type !== 'FunctionDeclaration') {\n return false;\n }\n\n let parent;\n let child;\n\n if (node.parent?.type === 'Program') {\n parent = node.parent;\n child = node;\n } else if (node.parent?.type === 'ExportNamedDeclaration' &&\n node.parent?.parent.type === 'Program') {\n parent = node.parent?.parent;\n child = node.parent;\n }\n\n if (!child || !parent) {\n return false;\n }\n\n const functionName = node.id.name;\n\n const idx = parent.body.indexOf(child);\n const prevSibling = parent.body[idx - 1];\n\n return (\n // @ts-expect-error Should be ok\n (prevSibling?.type === 'TSDeclareFunction' &&\n // @ts-expect-error Should be ok\n functionName === prevSibling.id.name) ||\n (prevSibling?.type === 'ExportNamedDeclaration' &&\n // @ts-expect-error Should be ok\n prevSibling.declaration?.type === 'TSDeclareFunction' &&\n // @ts-expect-error Should be ok\n prevSibling.declaration?.id?.name === functionName)\n );\n};\n\n/** @type {import('eslint').Rule.RuleModule} */\nexport default {\n create (context) {\n /* c8 ignore next -- Fallback to deprecated method */\n const {\n sourceCode = context.getSourceCode(),\n } = context;\n const settings = getSettings(context);\n if (!settings) {\n return {};\n }\n\n const opts = getOptions(context, settings);\n\n const {\n contexts,\n enableFixer,\n exemptEmptyConstructors,\n exemptEmptyFunctions,\n exemptOverloadedImplementations,\n fixerMessage,\n minLineCount,\n require: requireOption,\n skipInterveningOverloadedDeclarations,\n } = opts;\n\n const publicOnly =\n\n /**\n * @type {{\n * [key: string]: boolean | undefined;\n * }}\n */ (\n opts.publicOnly\n );\n\n /**\n * @type {import('../iterateJsdoc.js').CheckJsdoc}\n */\n const checkJsDoc = (info, _handler, node) => {\n if (\n // Optimize\n minLineCount !== undefined || contexts.some((ctxt) => {\n if (typeof ctxt === 'string') {\n return false;\n }\n\n const {\n minLineCount: count,\n } = ctxt;\n return count !== undefined;\n })\n ) {\n /**\n * @param {undefined|import('../iterateJsdoc.js').Integer} count\n */\n const underMinLine = (count) => {\n return count !== undefined && count >\n (sourceCode.getText(node).match(/\\n/gv)?.length ?? 0) + 1;\n };\n\n if (underMinLine(minLineCount)) {\n return;\n }\n\n const {\n minLineCount: contextMinLineCount,\n } =\n /**\n * @type {{\n * context: string;\n * inlineCommentBlock: boolean;\n * minLineCount: number;\n * }}\n */ (contexts.find((ctxt) => {\n if (typeof ctxt === 'string') {\n return false;\n }\n\n const {\n context: ctx,\n } = ctxt;\n return ctx === (info.selector || node.type);\n })) || {};\n if (underMinLine(contextMinLineCount)) {\n return;\n }\n }\n\n if (exemptOverloadedImplementations && isFunctionWithOverload(node)) {\n return;\n }\n\n const jsDocNode = getJSDocComment(\n sourceCode, node, settings, {\n checkOverloads: skipInterveningOverloadedDeclarations,\n },\n );\n\n if (jsDocNode) {\n return;\n }\n\n // For those who have options configured against ANY constructors (or\n // setters or getters) being reported\n if (exemptSpeciaMethods(\n {\n description: '',\n inlineTags: [],\n problems: [],\n source: [],\n tags: [],\n },\n node,\n context,\n [\n OPTIONS_SCHEMA,\n ],\n )) {\n return;\n }\n\n if (\n // Avoid reporting param-less, return-less functions (when\n // `exemptEmptyFunctions` option is set)\n exemptEmptyFunctions && info.isFunctionContext ||\n\n // Avoid reporting param-less, return-less constructor methods (when\n // `exemptEmptyConstructors` option is set)\n exemptEmptyConstructors && isConstructor(node)\n ) {\n const functionParameterNames = getFunctionParameterNames(node);\n if (!functionParameterNames.length && !hasReturnValue(node)) {\n return;\n }\n }\n\n if (isExemptedImplementer(node, sourceCode, context, settings)) {\n return;\n }\n\n const fix = /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n // Default to one line break if the `minLines`/`maxLines` settings allow\n const lines = settings.minLines === 0 && settings.maxLines >= 1 ? 1 : settings.minLines;\n /** @type {ESLintOrTSNode|import('@typescript-eslint/types').TSESTree.Decorator} */\n let baseNode = getReducedASTNode(node, sourceCode);\n\n const decorator = getDecorator(\n /** @type {import('eslint').Rule.Node} */\n (baseNode),\n );\n if (decorator) {\n baseNode = decorator;\n }\n\n const indent = getIndent({\n text: sourceCode.getText(\n /** @type {import('eslint').Rule.Node} */ (baseNode),\n /** @type {import('eslint').AST.SourceLocation} */\n (\n /** @type {import('eslint').Rule.Node} */ (baseNode).loc\n ).start.column,\n ),\n });\n\n const {\n inlineCommentBlock,\n } =\n /**\n * @type {{\n * context: string,\n * inlineCommentBlock: boolean,\n * minLineCount: import('../iterateJsdoc.js').Integer\n * }}\n */ (contexts.find((contxt) => {\n if (typeof contxt === 'string') {\n return false;\n }\n\n const {\n context: ctxt,\n } = contxt;\n return ctxt === node.type;\n })) || {};\n const insertion = (inlineCommentBlock ?\n `/** ${fixerMessage}` :\n `/**\\n${indent}*${fixerMessage}\\n${indent}`) +\n `*/${'\\n'.repeat(lines)}${indent.slice(0, -1)}`;\n\n return fixer.insertTextBefore(\n /** @type {import('eslint').Rule.Node} */\n (baseNode),\n insertion,\n );\n };\n\n const report = () => {\n const {\n start,\n } = /** @type {import('eslint').AST.SourceLocation} */ (node.loc);\n const loc = {\n end: {\n column: 0,\n line: start.line + 1,\n },\n start,\n };\n context.report({\n fix: enableFixer ? fix : null,\n loc,\n messageId: 'missingJsDoc',\n node,\n });\n };\n\n if (publicOnly) {\n /** @type {RequireJsdocOpts} */\n const opt = {\n ancestorsOnly: Boolean(publicOnly?.ancestorsOnly ?? false),\n esm: Boolean(publicOnly?.esm ?? true),\n initModuleExports: Boolean(publicOnly?.cjs ?? true),\n initWindow: Boolean(publicOnly?.window ?? false),\n };\n const exported = exportParser.isUncommentedExport(node, sourceCode, opt, settings);\n\n if (exported) {\n report();\n }\n } else {\n report();\n }\n };\n\n /**\n * @param {string} prop\n * @returns {boolean}\n */\n const hasOption = (prop) => {\n return requireOption[prop] || contexts.some((ctxt) => {\n return typeof ctxt === 'object' ? ctxt.context === prop : ctxt === prop;\n });\n };\n\n return {\n ...getContextObject(\n enforcedContexts(context, [], settings),\n checkJsDoc,\n ),\n ArrowFunctionExpression (node) {\n if (!hasOption('ArrowFunctionExpression')) {\n return;\n }\n\n if (\n [\n 'AssignmentExpression', 'ExportDefaultDeclaration', 'VariableDeclarator',\n ].includes(node.parent.type) ||\n [\n 'ClassProperty', 'ObjectProperty', 'Property', 'PropertyDefinition',\n ].includes(node.parent.type) &&\n node ===\n /**\n * @type {import('@typescript-eslint/types').TSESTree.Property|\n * import('@typescript-eslint/types').TSESTree.PropertyDefinition\n * }\n */\n (node.parent).value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n ClassDeclaration (node) {\n if (!hasOption('ClassDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n ClassExpression (node) {\n if (!hasOption('ClassExpression')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: false,\n }, null, node);\n },\n\n FunctionDeclaration (node) {\n if (!hasOption('FunctionDeclaration')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n },\n\n FunctionExpression (node) {\n if (!hasOption('FunctionExpression')) {\n return;\n }\n\n if (\n [\n 'AssignmentExpression', 'ExportDefaultDeclaration', 'VariableDeclarator',\n ].includes(node.parent.type) ||\n [\n 'ClassProperty', 'ObjectProperty', 'Property', 'PropertyDefinition',\n ].includes(node.parent.type) &&\n node ===\n /**\n * @type {import('@typescript-eslint/types').TSESTree.Property|\n * import('@typescript-eslint/types').TSESTree.PropertyDefinition\n * }\n */\n (node.parent).value\n ) {\n checkJsDoc({\n isFunctionContext: true,\n }, null, node);\n }\n },\n\n MethodDefinition (node) {\n if (!hasOption('MethodDefinition')) {\n return;\n }\n\n checkJsDoc({\n isFunctionContext: true,\n selector: 'MethodDefinition',\n }, null, /** @type {import('eslint').Rule.Node} */ (node.value));\n },\n };\n },\n meta: {\n docs: {\n category: 'Stylistic Issues',\n description: 'Require JSDoc comments',\n recommended: true,\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md#repos-sticky-header',\n },\n\n fixable: 'code',\n\n messages: {\n missingJsDoc: 'Missing JSDoc comment.',\n },\n\n schema: [\n OPTIONS_SCHEMA,\n ],\n\n type: 'suggestion',\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAGA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,aAAA,GAAAH,OAAA;AAI8B,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CA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2ClD,IAAI,CAACkG,KAAM,CAAC;MAClE;IACF,CAAC;EACH,CAAC;EACDC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,QAAQ,EAAE,kBAAkB;MAC5B/C,WAAW,EAAE,wBAAwB;MACrCgD,WAAW,EAAE,IAAI;MACjBC,GAAG,EAAE;IACP,CAAC;IAEDC,OAAO,EAAE,MAAM;IAEfC,QAAQ,EAAE;MACRC,YAAY,EAAE;IAChB,CAAC;IAEDC,MAAM,EAAE,CACN5J,cAAc,CACf;IAEDI,IAAI,EAAE;EACR;AACF,CAAC;AAAAyJ,MAAA,CAAA7E,OAAA,GAAAA,OAAA,CAAAjF,OAAA","ignoreList":[]}
|
|
@@ -40,6 +40,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
40
40
|
/**
|
|
41
41
|
* @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|
|
|
42
42
|
* import('@typescript-eslint/types').TSESTree.ClassDeclaration|
|
|
43
|
+
* import('@typescript-eslint/types').TSESTree.TSDeclareFunction|
|
|
43
44
|
* import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|
|
|
44
45
|
* import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
|
|
45
46
|
*/
|
|
@@ -73,6 +74,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
73
74
|
switch (nde.type) {
|
|
74
75
|
case 'ClassDeclaration':
|
|
75
76
|
case 'FunctionDeclaration':
|
|
77
|
+
case 'TSDeclareFunction':
|
|
76
78
|
case 'TSInterfaceDeclaration':
|
|
77
79
|
case 'TSTypeAliasDeclaration':
|
|
78
80
|
checkTypeParams(nde);
|
|
@@ -90,6 +92,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
90
92
|
switch (nde.declaration?.type) {
|
|
91
93
|
case 'ClassDeclaration':
|
|
92
94
|
case 'FunctionDeclaration':
|
|
95
|
+
case 'TSDeclareFunction':
|
|
93
96
|
case 'TSInterfaceDeclaration':
|
|
94
97
|
case 'TSTypeAliasDeclaration':
|
|
95
98
|
checkTypeParams(nde.declaration);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireTemplate.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdoccomment","e","__esModule","default","_default","exports","iterateJsdoc","context","node","report","settings","utils","avoidDocs","requireSeparateTemplates","options","mode","usedNames","Set","templateTags","getTags","templateNames","flatMap","tag","parseClosureTemplateTag","names","length","checkTypeParams","aliasDeclaration","params","typeParameters","name","add","usedName","includes","handleTypes","nde","type","declaration","usedNameToTag","Map","checkForUsedTypes","potentialTag","parsedType","tryParseType","parseType","traverse","value","test","has","set","checkTagsAndTemplates","tagNames","tagName","preferredTagName","getPreferredTagName","matchingTags","matchingTag","get","callbackTags","functionTags","typedefTags","potentialTypedef","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","exemptedBy","items","module"],"sources":["../../src/rules/requireTemplate.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n utils,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n requireSeparateTemplates = false,\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n const usedNames = new Set();\n const templateTags = utils.getTags('template');\n const templateNames = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n if (requireSeparateTemplates) {\n for (const tag of templateTags) {\n const names = utils.parseClosureTemplateTag(tag);\n if (names.length > 1) {\n report(`Missing separate @template for ${names[1]}`, null, tag);\n }\n }\n }\n\n /**\n * @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|\n * import('@typescript-eslint/types').TSESTree.ClassDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n */\n const checkTypeParams = (aliasDeclaration) => {\n const {\n params,\n /* c8 ignore next -- Guard */\n } = aliasDeclaration.typeParameters ?? {\n /* c8 ignore next -- Guard */\n params: [],\n };\n for (const {\n name: {\n name,\n },\n } of params) {\n usedNames.add(name);\n }\n\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @template ${usedName}`);\n }\n }\n };\n\n const handleTypes = () => {\n const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (\n node\n );\n if (!nde) {\n return;\n }\n\n switch (nde.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSInterfaceDeclaration':\n case 'TSTypeAliasDeclaration':\n checkTypeParams(nde);\n break;\n case 'ExportDefaultDeclaration':\n switch (nde.declaration?.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSInterfaceDeclaration':\n checkTypeParams(nde.declaration);\n break;\n }\n\n break;\n case 'ExportNamedDeclaration':\n switch (nde.declaration?.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSInterfaceDeclaration':\n case 'TSTypeAliasDeclaration':\n checkTypeParams(nde.declaration);\n break;\n }\n\n break;\n }\n };\n\n const usedNameToTag = new Map();\n\n /**\n * @param {import('comment-parser').Spec} potentialTag\n */\n const checkForUsedTypes = (potentialTag) => {\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialTag.type)) :\n parseType(/** @type {string} */ (potentialTag.type), mode);\n } catch {\n return;\n }\n\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n if (type === 'JsdocTypeName' && (/^[A-Z]$/v).test(value)) {\n usedNames.add(value);\n if (!usedNameToTag.has(value)) {\n usedNameToTag.set(value, potentialTag);\n }\n }\n });\n };\n\n /**\n * @param {string[]} tagNames\n */\n const checkTagsAndTemplates = (tagNames) => {\n for (const tagName of tagNames) {\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName,\n }));\n const matchingTags = utils.getTags(preferredTagName);\n for (const matchingTag of matchingTags) {\n checkForUsedTypes(matchingTag);\n }\n }\n\n // Could check against whitelist/blacklist\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @template ${usedName}`, null, usedNameToTag.get(usedName));\n }\n }\n };\n\n const callbackTags = utils.getTags('callback');\n const functionTags = utils.getTags('function');\n if (callbackTags.length || functionTags.length) {\n checkTagsAndTemplates([\n 'param', 'returns',\n ]);\n return;\n }\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypes();\n return;\n }\n\n const potentialTypedef = typedefTags[0];\n checkForUsedTypes(potentialTypedef);\n\n checkTagsAndTemplates([\n 'property',\n ]);\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires template tags for each generic type parameter',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n exemptedBy: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n requireSeparateTemplates: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAI8B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEf,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,IAAIA,KAAK,CAACC,SAAS,CAAC,CAAC,EAAE;IACrB;EACF;EAEA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WAAW,CAAC,CAAC,CAAC;EACvCpB,iBAAiB,CAACqB,gBAAgB,CAAC;EAEnCX,qBAAqB,CAAC,CACpB,UAAU,CACX,CAAC;AACJ,CAAC,EAAE;EACDY,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,wDAAwD;MACrEC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,UAAU,EAAE;UACVC,KAAK,EAAE;YACLnC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDvB,wBAAwB,EAAE;UACxBuB,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAoC,MAAA,CAAAnE,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"requireTemplate.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdoccomment","e","__esModule","default","_default","exports","iterateJsdoc","context","node","report","settings","utils","avoidDocs","requireSeparateTemplates","options","mode","usedNames","Set","templateTags","getTags","templateNames","flatMap","tag","parseClosureTemplateTag","names","length","checkTypeParams","aliasDeclaration","params","typeParameters","name","add","usedName","includes","handleTypes","nde","type","declaration","usedNameToTag","Map","checkForUsedTypes","potentialTag","parsedType","tryParseType","parseType","traverse","value","test","has","set","checkTagsAndTemplates","tagNames","tagName","preferredTagName","getPreferredTagName","matchingTags","matchingTag","get","callbackTags","functionTags","typedefTags","potentialTypedef","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","exemptedBy","items","module"],"sources":["../../src/rules/requireTemplate.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n utils,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n requireSeparateTemplates = false,\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n const usedNames = new Set();\n const templateTags = utils.getTags('template');\n const templateNames = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n if (requireSeparateTemplates) {\n for (const tag of templateTags) {\n const names = utils.parseClosureTemplateTag(tag);\n if (names.length > 1) {\n report(`Missing separate @template for ${names[1]}`, null, tag);\n }\n }\n }\n\n /**\n * @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|\n * import('@typescript-eslint/types').TSESTree.ClassDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSDeclareFunction|\n * import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n */\n const checkTypeParams = (aliasDeclaration) => {\n const {\n params,\n /* c8 ignore next -- Guard */\n } = aliasDeclaration.typeParameters ?? {\n /* c8 ignore next -- Guard */\n params: [],\n };\n for (const {\n name: {\n name,\n },\n } of params) {\n usedNames.add(name);\n }\n\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @template ${usedName}`);\n }\n }\n };\n\n const handleTypes = () => {\n const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (\n node\n );\n if (!nde) {\n return;\n }\n\n switch (nde.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSDeclareFunction':\n case 'TSInterfaceDeclaration':\n case 'TSTypeAliasDeclaration':\n checkTypeParams(nde);\n break;\n case 'ExportDefaultDeclaration':\n switch (nde.declaration?.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSInterfaceDeclaration':\n checkTypeParams(nde.declaration);\n break;\n }\n\n break;\n case 'ExportNamedDeclaration':\n switch (nde.declaration?.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSDeclareFunction':\n case 'TSInterfaceDeclaration':\n case 'TSTypeAliasDeclaration':\n checkTypeParams(nde.declaration);\n break;\n }\n\n break;\n }\n };\n\n const usedNameToTag = new Map();\n\n /**\n * @param {import('comment-parser').Spec} potentialTag\n */\n const checkForUsedTypes = (potentialTag) => {\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialTag.type)) :\n parseType(/** @type {string} */ (potentialTag.type), mode);\n } catch {\n return;\n }\n\n traverse(parsedType, (nde) => {\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n if (type === 'JsdocTypeName' && (/^[A-Z]$/v).test(value)) {\n usedNames.add(value);\n if (!usedNameToTag.has(value)) {\n usedNameToTag.set(value, potentialTag);\n }\n }\n });\n };\n\n /**\n * @param {string[]} tagNames\n */\n const checkTagsAndTemplates = (tagNames) => {\n for (const tagName of tagNames) {\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName,\n }));\n const matchingTags = utils.getTags(preferredTagName);\n for (const matchingTag of matchingTags) {\n checkForUsedTypes(matchingTag);\n }\n }\n\n // Could check against whitelist/blacklist\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @template ${usedName}`, null, usedNameToTag.get(usedName));\n }\n }\n };\n\n const callbackTags = utils.getTags('callback');\n const functionTags = utils.getTags('function');\n if (callbackTags.length || functionTags.length) {\n checkTagsAndTemplates([\n 'param', 'returns',\n ]);\n return;\n }\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypes();\n return;\n }\n\n const potentialTypedef = typedefTags[0];\n checkForUsedTypes(potentialTypedef);\n\n checkTagsAndTemplates([\n 'property',\n ]);\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires template tags for each generic type parameter',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n exemptedBy: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n requireSeparateTemplates: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAI8B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEf,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,IAAIA,KAAK,CAACC,SAAS,CAAC,CAAC,EAAE;IACrB;EACF;EAEA,MAAM;IACJC,wBAAwB,GAAG;EAC7B,CAAC,GAAGN,OAAO,CAACO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM;IACJC;EACF,CAAC,GAAGL,QAAQ;EAEZ,MAAMM,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC3B,MAAMC,YAAY,GAAGP,KAAK,CAACQ,OAAO,CAAC,UAAU,CAAC;EAC9C,MAAMC,aAAa,GAAGF,YAAY,CAACG,OAAO,CAAEC,GAAG,IAAK;IAClD,OAAOX,KAAK,CAACY,uBAAuB,CAACD,GAAG,CAAC;EAC3C,CAAC,CAAC;EAEF,IAAIT,wBAAwB,EAAE;IAC5B,KAAK,MAAMS,GAAG,IAAIJ,YAAY,EAAE;MAC9B,MAAMM,KAAK,GAAGb,KAAK,CAACY,uBAAuB,CAACD,GAAG,CAAC;MAChD,IAAIE,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;QACpBhB,MAAM,CAAC,kCAAkCe,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE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
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "http://gajus.com"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@es-joy/jsdoccomment": "~0.
|
|
8
|
+
"@es-joy/jsdoccomment": "~0.56.0",
|
|
9
9
|
"are-docs-informative": "^0.0.2",
|
|
10
10
|
"comment-parser": "1.4.1",
|
|
11
11
|
"debug": "^4.4.1",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"description": "JSDoc linting rules for ESLint.",
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@babel/cli": "^7.28.3",
|
|
22
|
-
"@babel/core": "^7.28.
|
|
23
|
-
"@babel/eslint-parser": "^7.28.
|
|
22
|
+
"@babel/core": "^7.28.4",
|
|
23
|
+
"@babel/eslint-parser": "^7.28.4",
|
|
24
24
|
"@babel/node": "^7.28.0",
|
|
25
25
|
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
|
26
26
|
"@babel/plugin-transform-flow-strip-types": "^7.27.1",
|
|
27
27
|
"@babel/preset-env": "^7.28.3",
|
|
28
28
|
"@es-joy/escodegen": "^3.5.1",
|
|
29
|
-
"@es-joy/jsdoc-eslint-parser": "^0.
|
|
29
|
+
"@es-joy/jsdoc-eslint-parser": "^0.23.0",
|
|
30
30
|
"@hkdobrev/run-if-changed": "^0.6.3",
|
|
31
31
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
32
|
-
"@semantic-release/github": "^11.0.
|
|
32
|
+
"@semantic-release/github": "^11.0.5",
|
|
33
33
|
"@semantic-release/npm": "^12.0.2",
|
|
34
34
|
"@types/chai": "^5.2.2",
|
|
35
35
|
"@types/debug": "^4.1.12",
|
|
@@ -39,34 +39,34 @@
|
|
|
39
39
|
"@types/json-schema": "^7.0.15",
|
|
40
40
|
"@types/lodash.defaultsdeep": "^4.6.9",
|
|
41
41
|
"@types/mocha": "^10.0.10",
|
|
42
|
-
"@types/node": "^24.3.
|
|
43
|
-
"@types/semver": "^7.7.
|
|
42
|
+
"@types/node": "^24.3.1",
|
|
43
|
+
"@types/semver": "^7.7.1",
|
|
44
44
|
"@types/spdx-expression-parse": "^3.0.5",
|
|
45
|
-
"@typescript-eslint/types": "^8.
|
|
45
|
+
"@typescript-eslint/types": "^8.42.0",
|
|
46
46
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
47
|
-
"babel-plugin-istanbul": "^7.0.
|
|
47
|
+
"babel-plugin-istanbul": "^7.0.1",
|
|
48
48
|
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
49
49
|
"c8": "^10.1.3",
|
|
50
50
|
"camelcase": "^8.0.0",
|
|
51
51
|
"chai": "^6.0.1",
|
|
52
52
|
"decamelize": "^6.0.1",
|
|
53
|
-
"eslint": "9.
|
|
53
|
+
"eslint": "9.35.0",
|
|
54
54
|
"eslint-config-canonical": "~45.0.0",
|
|
55
55
|
"gitdown": "^4.1.1",
|
|
56
56
|
"glob": "^11.0.3",
|
|
57
57
|
"globals": "^16.3.0",
|
|
58
58
|
"husky": "^9.1.7",
|
|
59
|
-
"jsdoc-type-pratt-parser": "^
|
|
59
|
+
"jsdoc-type-pratt-parser": "^5.1.1",
|
|
60
60
|
"json-schema": "^0.4.0",
|
|
61
|
-
"lint-staged": "^16.1.
|
|
61
|
+
"lint-staged": "^16.1.6",
|
|
62
62
|
"lodash.defaultsdeep": "^4.6.1",
|
|
63
|
-
"mocha": "^11.7.
|
|
63
|
+
"mocha": "^11.7.2",
|
|
64
64
|
"open-editor": "^5.1.0",
|
|
65
65
|
"replace": "^1.2.2",
|
|
66
66
|
"rimraf": "^6.0.1",
|
|
67
67
|
"semantic-release": "^24.2.7",
|
|
68
68
|
"typescript": "5.9.2",
|
|
69
|
-
"typescript-eslint": "^8.
|
|
69
|
+
"typescript-eslint": "^8.42.0"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=20.11.0"
|
|
@@ -153,5 +153,5 @@
|
|
|
153
153
|
"test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
|
|
154
154
|
"test-index": "pnpm run test-no-cov test/rules/index.js"
|
|
155
155
|
},
|
|
156
|
-
"version": "54.
|
|
156
|
+
"version": "54.5.0"
|
|
157
157
|
}
|
|
@@ -543,6 +543,7 @@ export const getJsdocProcessorPlugin = (options = {}) => {
|
|
|
543
543
|
// fix: {range: [number, number], text: string}
|
|
544
544
|
// suggestions: {desc: , messageId:, fix: }[],
|
|
545
545
|
} = msg;
|
|
546
|
+
delete msg.fix;
|
|
546
547
|
|
|
547
548
|
const [
|
|
548
549
|
codeCtxLine,
|
|
@@ -664,8 +665,7 @@ export const getJsdocProcessorPlugin = (options = {}) => {
|
|
|
664
665
|
|
|
665
666
|
return [];
|
|
666
667
|
},
|
|
667
|
-
|
|
668
|
-
supportsAutofix: false,
|
|
668
|
+
supportsAutofix: true,
|
|
669
669
|
},
|
|
670
670
|
},
|
|
671
671
|
};
|
|
@@ -104,6 +104,10 @@ const OPTIONS_SCHEMA = {
|
|
|
104
104
|
default: false,
|
|
105
105
|
type: 'boolean',
|
|
106
106
|
},
|
|
107
|
+
exemptOverloadedImplementations: {
|
|
108
|
+
default: false,
|
|
109
|
+
type: 'boolean',
|
|
110
|
+
},
|
|
107
111
|
fixerMessage: {
|
|
108
112
|
default: '',
|
|
109
113
|
type: 'string',
|
|
@@ -169,6 +173,10 @@ const OPTIONS_SCHEMA = {
|
|
|
169
173
|
},
|
|
170
174
|
type: 'object',
|
|
171
175
|
},
|
|
176
|
+
skipInterveningOverloadedDeclarations: {
|
|
177
|
+
default: true,
|
|
178
|
+
type: 'boolean',
|
|
179
|
+
},
|
|
172
180
|
},
|
|
173
181
|
type: 'object',
|
|
174
182
|
};
|
|
@@ -302,6 +310,8 @@ const getOption = (context, baseObject, option, key) => {
|
|
|
302
310
|
* enableFixer: boolean,
|
|
303
311
|
* exemptEmptyConstructors: boolean,
|
|
304
312
|
* exemptEmptyFunctions: boolean,
|
|
313
|
+
* skipInterveningOverloadedDeclarations: boolean,
|
|
314
|
+
* exemptOverloadedImplementations: boolean,
|
|
305
315
|
* fixerMessage: string,
|
|
306
316
|
* minLineCount: undefined|import('../iterateJsdoc.js').Integer,
|
|
307
317
|
* publicOnly: boolean|{[key: string]: boolean|undefined}
|
|
@@ -314,9 +324,11 @@ const getOptions = (context, settings) => {
|
|
|
314
324
|
enableFixer = true,
|
|
315
325
|
exemptEmptyConstructors = true,
|
|
316
326
|
exemptEmptyFunctions = false,
|
|
327
|
+
exemptOverloadedImplementations = false,
|
|
317
328
|
fixerMessage = '',
|
|
318
329
|
minLineCount = undefined,
|
|
319
330
|
publicOnly,
|
|
331
|
+
skipInterveningOverloadedDeclarations = true,
|
|
320
332
|
} = context.options[0] || {};
|
|
321
333
|
|
|
322
334
|
return {
|
|
@@ -324,6 +336,7 @@ const getOptions = (context, settings) => {
|
|
|
324
336
|
enableFixer,
|
|
325
337
|
exemptEmptyConstructors,
|
|
326
338
|
exemptEmptyFunctions,
|
|
339
|
+
exemptOverloadedImplementations,
|
|
327
340
|
fixerMessage,
|
|
328
341
|
minLineCount,
|
|
329
342
|
publicOnly: ((baseObj) => {
|
|
@@ -386,9 +399,52 @@ const getOptions = (context, settings) => {
|
|
|
386
399
|
/** @type {import('json-schema').JSONSchema4Object} */
|
|
387
400
|
(OPTIONS_SCHEMA.properties).require,
|
|
388
401
|
),
|
|
402
|
+
skipInterveningOverloadedDeclarations,
|
|
389
403
|
};
|
|
390
404
|
};
|
|
391
405
|
|
|
406
|
+
/**
|
|
407
|
+
* @param {ESLintOrTSNode} node
|
|
408
|
+
*/
|
|
409
|
+
const isFunctionWithOverload = (node) => {
|
|
410
|
+
if (node.type !== 'FunctionDeclaration') {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
let parent;
|
|
415
|
+
let child;
|
|
416
|
+
|
|
417
|
+
if (node.parent?.type === 'Program') {
|
|
418
|
+
parent = node.parent;
|
|
419
|
+
child = node;
|
|
420
|
+
} else if (node.parent?.type === 'ExportNamedDeclaration' &&
|
|
421
|
+
node.parent?.parent.type === 'Program') {
|
|
422
|
+
parent = node.parent?.parent;
|
|
423
|
+
child = node.parent;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (!child || !parent) {
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const functionName = node.id.name;
|
|
431
|
+
|
|
432
|
+
const idx = parent.body.indexOf(child);
|
|
433
|
+
const prevSibling = parent.body[idx - 1];
|
|
434
|
+
|
|
435
|
+
return (
|
|
436
|
+
// @ts-expect-error Should be ok
|
|
437
|
+
(prevSibling?.type === 'TSDeclareFunction' &&
|
|
438
|
+
// @ts-expect-error Should be ok
|
|
439
|
+
functionName === prevSibling.id.name) ||
|
|
440
|
+
(prevSibling?.type === 'ExportNamedDeclaration' &&
|
|
441
|
+
// @ts-expect-error Should be ok
|
|
442
|
+
prevSibling.declaration?.type === 'TSDeclareFunction' &&
|
|
443
|
+
// @ts-expect-error Should be ok
|
|
444
|
+
prevSibling.declaration?.id?.name === functionName)
|
|
445
|
+
);
|
|
446
|
+
};
|
|
447
|
+
|
|
392
448
|
/** @type {import('eslint').Rule.RuleModule} */
|
|
393
449
|
export default {
|
|
394
450
|
create (context) {
|
|
@@ -408,9 +464,11 @@ export default {
|
|
|
408
464
|
enableFixer,
|
|
409
465
|
exemptEmptyConstructors,
|
|
410
466
|
exemptEmptyFunctions,
|
|
467
|
+
exemptOverloadedImplementations,
|
|
411
468
|
fixerMessage,
|
|
412
469
|
minLineCount,
|
|
413
470
|
require: requireOption,
|
|
471
|
+
skipInterveningOverloadedDeclarations,
|
|
414
472
|
} = opts;
|
|
415
473
|
|
|
416
474
|
const publicOnly =
|
|
@@ -476,7 +534,15 @@ export default {
|
|
|
476
534
|
}
|
|
477
535
|
}
|
|
478
536
|
|
|
479
|
-
|
|
537
|
+
if (exemptOverloadedImplementations && isFunctionWithOverload(node)) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
const jsDocNode = getJSDocComment(
|
|
542
|
+
sourceCode, node, settings, {
|
|
543
|
+
checkOverloads: skipInterveningOverloadedDeclarations,
|
|
544
|
+
},
|
|
545
|
+
);
|
|
480
546
|
|
|
481
547
|
if (jsDocNode) {
|
|
482
548
|
return;
|
|
@@ -42,6 +42,7 @@ export default iterateJsdoc(({
|
|
|
42
42
|
/**
|
|
43
43
|
* @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|
|
|
44
44
|
* import('@typescript-eslint/types').TSESTree.ClassDeclaration|
|
|
45
|
+
* import('@typescript-eslint/types').TSESTree.TSDeclareFunction|
|
|
45
46
|
* import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|
|
|
46
47
|
* import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
|
|
47
48
|
*/
|
|
@@ -79,6 +80,7 @@ export default iterateJsdoc(({
|
|
|
79
80
|
switch (nde.type) {
|
|
80
81
|
case 'ClassDeclaration':
|
|
81
82
|
case 'FunctionDeclaration':
|
|
83
|
+
case 'TSDeclareFunction':
|
|
82
84
|
case 'TSInterfaceDeclaration':
|
|
83
85
|
case 'TSTypeAliasDeclaration':
|
|
84
86
|
checkTypeParams(nde);
|
|
@@ -97,6 +99,7 @@ export default iterateJsdoc(({
|
|
|
97
99
|
switch (nde.declaration?.type) {
|
|
98
100
|
case 'ClassDeclaration':
|
|
99
101
|
case 'FunctionDeclaration':
|
|
102
|
+
case 'TSDeclareFunction':
|
|
100
103
|
case 'TSInterfaceDeclaration':
|
|
101
104
|
case 'TSTypeAliasDeclaration':
|
|
102
105
|
checkTypeParams(nde.declaration);
|