eslint-plugin-jsdoc 58.1.0 → 59.0.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/README.md +66 -60
- package/dist/buildForbidRuleDefinition.cjs +0 -1
- package/dist/buildForbidRuleDefinition.cjs.map +1 -1
- package/dist/buildRejectOrPreferRuleDefinition.cjs +7 -2
- package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
- package/dist/cjs/rules/convertToJsdocComments.d.ts +7 -0
- package/dist/generateDocs.cjs +129 -3
- package/dist/generateDocs.cjs.map +1 -1
- package/dist/generateRule.cjs +3 -1
- package/dist/generateRule.cjs.map +1 -1
- package/dist/generateRuleTypes.cjs +5 -5
- package/dist/generateRuleTypes.cjs.map +1 -1
- package/dist/index-cjs.cjs +30 -0
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -1
- package/dist/rules/checkAccess.cjs +1 -1
- package/dist/rules/checkAccess.cjs.map +1 -1
- package/dist/rules/checkAlignment.cjs +4 -1
- package/dist/rules/checkAlignment.cjs.map +1 -1
- package/dist/rules/checkExamples.cjs +1 -1
- package/dist/rules/checkExamples.cjs.map +1 -1
- package/dist/rules/checkIndentation.cjs +19 -0
- package/dist/rules/checkIndentation.cjs.map +1 -1
- package/dist/rules/checkLineAlignment.cjs +25 -1
- package/dist/rules/checkLineAlignment.cjs.map +1 -1
- package/dist/rules/checkParamNames.cjs +62 -1
- package/dist/rules/checkParamNames.cjs.map +1 -1
- package/dist/rules/checkPropertyNames.cjs +6 -0
- package/dist/rules/checkPropertyNames.cjs.map +1 -1
- package/dist/rules/checkTagNames.cjs +71 -0
- package/dist/rules/checkTagNames.cjs.map +1 -1
- package/dist/rules/checkTypes.cjs +16 -1
- package/dist/rules/checkTypes.cjs.map +1 -1
- package/dist/rules/checkValues.cjs +17 -1
- package/dist/rules/checkValues.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.cjs +48 -0
- package/dist/rules/convertToJsdocComments.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.d.ts +7 -0
- package/dist/rules/emptyTags.cjs +10 -1
- package/dist/rules/emptyTags.cjs.map +1 -1
- package/dist/rules/implementsOnClasses.cjs +15 -1
- package/dist/rules/implementsOnClasses.cjs.map +1 -1
- package/dist/rules/informativeDocs.cjs +45 -0
- package/dist/rules/informativeDocs.cjs.map +1 -1
- package/dist/rules/linesBeforeBlock.cjs +14 -0
- package/dist/rules/linesBeforeBlock.cjs.map +1 -1
- package/dist/rules/matchDescription.cjs +129 -0
- package/dist/rules/matchDescription.cjs.map +1 -1
- package/dist/rules/matchName.cjs +30 -0
- package/dist/rules/matchName.cjs.map +1 -1
- package/dist/rules/multilineBlocks.cjs +78 -6
- package/dist/rules/multilineBlocks.cjs.map +1 -1
- package/dist/rules/noBadBlocks.cjs +11 -2
- package/dist/rules/noBadBlocks.cjs.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.cjs +1 -1
- package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
- package/dist/rules/noBlankBlocks.cjs +3 -1
- package/dist/rules/noBlankBlocks.cjs.map +1 -1
- package/dist/rules/noDefaults.cjs +19 -0
- package/dist/rules/noDefaults.cjs.map +1 -1
- package/dist/rules/noMissingSyntax.cjs +22 -2
- package/dist/rules/noMissingSyntax.cjs.map +1 -1
- package/dist/rules/noMultiAsterisks.cjs +29 -0
- package/dist/rules/noMultiAsterisks.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.cjs +17 -1
- package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
- package/dist/rules/noTypes.cjs +17 -1
- package/dist/rules/noTypes.cjs.map +1 -1
- package/dist/rules/noUndefinedTypes.cjs +11 -1
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/requireAsteriskPrefix.cjs +28 -0
- package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
- package/dist/rules/requireDescription.cjs +30 -1
- package/dist/rules/requireDescription.cjs.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.cjs +27 -0
- package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
- package/dist/rules/requireExample.cjs +26 -1
- package/dist/rules/requireExample.cjs.map +1 -1
- package/dist/rules/requireFileOverview.cjs +61 -0
- package/dist/rules/requireFileOverview.cjs.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.cjs +20 -2
- package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
- package/dist/rules/requireJsdoc.cjs +82 -3
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireParam.cjs +213 -1
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/requireParamDescription.cjs +21 -0
- package/dist/rules/requireParamDescription.cjs.map +1 -1
- package/dist/rules/requireParamName.cjs +16 -1
- package/dist/rules/requireParamName.cjs.map +1 -1
- package/dist/rules/requireParamType.cjs +21 -1
- package/dist/rules/requireParamType.cjs.map +1 -1
- package/dist/rules/requirePropertyName.cjs +1 -1
- package/dist/rules/requirePropertyName.cjs.map +1 -1
- package/dist/rules/requirePropertyType.cjs +1 -1
- package/dist/rules/requirePropertyType.cjs.map +1 -1
- package/dist/rules/requireReturns.cjs +54 -1
- package/dist/rules/requireReturns.cjs.map +1 -1
- package/dist/rules/requireReturnsCheck.cjs +22 -1
- package/dist/rules/requireReturnsCheck.cjs.map +1 -1
- package/dist/rules/requireReturnsDescription.cjs +15 -1
- package/dist/rules/requireReturnsDescription.cjs.map +1 -1
- package/dist/rules/requireReturnsType.cjs +15 -1
- package/dist/rules/requireReturnsType.cjs.map +1 -1
- package/dist/rules/requireTemplate.cjs +17 -1
- package/dist/rules/requireTemplate.cjs.map +1 -1
- package/dist/rules/requireThrows.cjs +18 -1
- package/dist/rules/requireThrows.cjs.map +1 -1
- package/dist/rules/requireYields.cjs +50 -1
- package/dist/rules/requireYields.cjs.map +1 -1
- package/dist/rules/requireYieldsCheck.cjs +25 -7
- package/dist/rules/requireYieldsCheck.cjs.map +1 -1
- package/dist/rules/sortTags.cjs +200 -1
- package/dist/rules/sortTags.cjs.map +1 -1
- package/dist/rules/tagLines.cjs +32 -2
- package/dist/rules/tagLines.cjs.map +1 -1
- package/dist/rules/textEscaping.cjs +5 -1
- package/dist/rules/textEscaping.cjs.map +1 -1
- package/dist/rules/typeFormatting.cjs +64 -16
- package/dist/rules/typeFormatting.cjs.map +1 -1
- package/dist/rules/validTypes.cjs +8 -1
- package/dist/rules/validTypes.cjs.map +1 -1
- package/dist/rules.d.ts +2130 -32
- package/package.json +1 -1
- package/src/buildForbidRuleDefinition.js +0 -1
- package/src/buildRejectOrPreferRuleDefinition.js +12 -2
- package/src/index-cjs.js +36 -0
- package/src/index.js +36 -0
- package/src/rules/checkAccess.js +1 -1
- package/src/rules/checkAlignment.js +3 -0
- package/src/rules/checkExamples.js +1 -1
- package/src/rules/checkIndentation.js +19 -0
- package/src/rules/checkLineAlignment.js +24 -0
- package/src/rules/checkParamNames.js +62 -1
- package/src/rules/checkPropertyNames.js +6 -0
- package/src/rules/checkTagNames.js +71 -0
- package/src/rules/checkTypes.js +16 -1
- package/src/rules/checkValues.js +16 -0
- package/src/rules/convertToJsdocComments.js +48 -0
- package/src/rules/emptyTags.js +10 -1
- package/src/rules/implementsOnClasses.js +15 -1
- package/src/rules/informativeDocs.js +45 -0
- package/src/rules/linesBeforeBlock.js +14 -0
- package/src/rules/matchDescription.js +129 -0
- package/src/rules/matchName.js +30 -0
- package/src/rules/multilineBlocks.js +77 -5
- package/src/rules/noBadBlocks.js +11 -2
- package/src/rules/noBlankBlockDescriptions.js +1 -1
- package/src/rules/noBlankBlocks.js +2 -0
- package/src/rules/noDefaults.js +19 -0
- package/src/rules/noMissingSyntax.js +22 -2
- package/src/rules/noMultiAsterisks.js +29 -0
- package/src/rules/noRestrictedSyntax.js +17 -1
- package/src/rules/noTypes.js +17 -1
- package/src/rules/noUndefinedTypes.js +11 -1
- package/src/rules/requireAsteriskPrefix.js +28 -0
- package/src/rules/requireDescription.js +30 -1
- package/src/rules/requireDescriptionCompleteSentence.js +27 -0
- package/src/rules/requireExample.js +26 -1
- package/src/rules/requireFileOverview.js +61 -0
- package/src/rules/requireHyphenBeforeParamDescription.js +19 -1
- package/src/rules/requireJsdoc.js +80 -1
- package/src/rules/requireParam.js +213 -1
- package/src/rules/requireParamDescription.js +21 -0
- package/src/rules/requireParamName.js +16 -1
- package/src/rules/requireParamType.js +21 -1
- package/src/rules/requirePropertyName.js +1 -1
- package/src/rules/requirePropertyType.js +1 -1
- package/src/rules/requireReturns.js +54 -1
- package/src/rules/requireReturnsCheck.js +22 -1
- package/src/rules/requireReturnsDescription.js +15 -1
- package/src/rules/requireReturnsType.js +15 -1
- package/src/rules/requireTemplate.js +17 -1
- package/src/rules/requireThrows.js +18 -1
- package/src/rules/requireYields.js +50 -1
- package/src/rules/requireYieldsCheck.js +25 -7
- package/src/rules/sortTags.js +200 -1
- package/src/rules/tagLines.js +30 -0
- package/src/rules/textEscaping.js +5 -1
- package/src/rules/typeFormatting.js +57 -19
- package/src/rules/validTypes.js +8 -1
- package/src/rules.d.ts +2130 -32
- package/typings/gitdown.d.ts +4 -0
|
@@ -58,6 +58,25 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
58
58
|
additionalProperties: false,
|
|
59
59
|
properties: {
|
|
60
60
|
excludeTags: {
|
|
61
|
+
description: `Array of tags (e.g., \`['example', 'description']\`) whose content will be
|
|
62
|
+
"hidden" from the \`check-indentation\` rule. Defaults to \`['example']\`.
|
|
63
|
+
|
|
64
|
+
By default, the whole JSDoc block will be checked for invalid padding.
|
|
65
|
+
That would include \`@example\` blocks too, which can get in the way
|
|
66
|
+
of adding full, readable examples of code without ending up with multiple
|
|
67
|
+
linting issues.
|
|
68
|
+
|
|
69
|
+
When disabled (by passing \`excludeTags: []\` option), the following code *will*
|
|
70
|
+
report a padding issue:
|
|
71
|
+
|
|
72
|
+
\`\`\`js
|
|
73
|
+
/**
|
|
74
|
+
* @example
|
|
75
|
+
* anArray.filter((a) => {
|
|
76
|
+
* return a.b;
|
|
77
|
+
* });
|
|
78
|
+
*/
|
|
79
|
+
\`\`\``,
|
|
61
80
|
items: {
|
|
62
81
|
pattern: '^\\S+$',
|
|
63
82
|
type: 'string'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIndentation.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","maskExcludedContent","str","excludeTags","regContent","RegExp","join","replace","_match","margin","code","repeat","match","length","maskCodeBlocks","replaceAll","_default","exports","iterateJsdoc","context","jsdocNode","report","sourceCode","options","reg","textWithoutCodeBlocks","getText","text","test","lineBreaks","slice","lastIndex","line","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","pattern","type","module"],"sources":["../../src/rules/checkIndentation.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {string} str\n * @param {string[]} excludeTags\n * @returns {string}\n */\nconst maskExcludedContent = (str, excludeTags) => {\n const regContent = new RegExp(`([ \\\\t]+\\\\*)[ \\\\t]@(?:${excludeTags.join('|')})(?=[ \\\\n])([\\\\w\\\\|\\\\W]*?\\\\n)(?=[ \\\\t]*\\\\*(?:[ \\\\t]*@\\\\w+\\\\s|\\\\/))`, 'gv');\n\n return str.replace(regContent, (_match, margin, code) => {\n return (margin + '\\n').repeat(code.match(/\\n/gv).length);\n });\n};\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst maskCodeBlocks = (str) => {\n const regContent = /([ \\t]+\\*)[ \\t]```[^\\n]*?([\\w\\|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*(?:```|@\\w+\\s)|\\/))/gv;\n\n return str.replaceAll(regContent, (_match, margin, code) => {\n return (margin + '\\n').repeat(code.match(/\\n/gv).length);\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdocNode,\n report,\n sourceCode,\n}) => {\n const options = context.options[0] || {};\n const /** @type {{excludeTags: string[]}} */ {\n excludeTags = [\n 'example',\n ],\n } = options;\n\n const reg = /^(?:\\/?\\**|[ \\t]*)\\*[ \\t]{2}/gmv;\n const textWithoutCodeBlocks = maskCodeBlocks(sourceCode.getText(jsdocNode));\n const text = excludeTags.length ? maskExcludedContent(textWithoutCodeBlocks, excludeTags) : textWithoutCodeBlocks;\n\n if (reg.test(text)) {\n const lineBreaks = text.slice(0, reg.lastIndex).match(/\\n/gv) || [];\n report('There must be no indentation.', null, {\n line: lineBreaks.length,\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports invalid padding inside JSDoc blocks.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-indentation.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n excludeTags: {\n items: {\n pattern: '^\\\\S+$',\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA,MAAMG,mBAAmB,GAAGA,CAACC,GAAG,EAAEC,WAAW,KAAK;EAChD,MAAMC,UAAU,GAAG,IAAIC,MAAM,CAAC,yBAAyBF,WAAW,CAACG,IAAI,CAAC,GAAG,CAAC,oEAAoE,EAAE,IAAI,CAAC;EAEvJ,OAAOJ,GAAG,CAACK,OAAO,CAACH,UAAU,EAAE,CAACI,MAAM,EAAEC,MAAM,EAAEC,IAAI,KAAK;IACvD,OAAO,CAACD,MAAM,GAAG,IAAI,EAAEE,MAAM,CAACD,IAAI,CAACE,KAAK,CAAC,MAAM,CAAC,CAACC,MAAM,CAAC;EAC1D,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;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C,WAAW,EAAE,8CAA8C;MAC3DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVrC,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"checkIndentation.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","maskExcludedContent","str","excludeTags","regContent","RegExp","join","replace","_match","margin","code","repeat","match","length","maskCodeBlocks","replaceAll","_default","exports","iterateJsdoc","context","jsdocNode","report","sourceCode","options","reg","textWithoutCodeBlocks","getText","text","test","lineBreaks","slice","lastIndex","line","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","pattern","type","module"],"sources":["../../src/rules/checkIndentation.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {string} str\n * @param {string[]} excludeTags\n * @returns {string}\n */\nconst maskExcludedContent = (str, excludeTags) => {\n const regContent = new RegExp(`([ \\\\t]+\\\\*)[ \\\\t]@(?:${excludeTags.join('|')})(?=[ \\\\n])([\\\\w\\\\|\\\\W]*?\\\\n)(?=[ \\\\t]*\\\\*(?:[ \\\\t]*@\\\\w+\\\\s|\\\\/))`, 'gv');\n\n return str.replace(regContent, (_match, margin, code) => {\n return (margin + '\\n').repeat(code.match(/\\n/gv).length);\n });\n};\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst maskCodeBlocks = (str) => {\n const regContent = /([ \\t]+\\*)[ \\t]```[^\\n]*?([\\w\\|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*(?:```|@\\w+\\s)|\\/))/gv;\n\n return str.replaceAll(regContent, (_match, margin, code) => {\n return (margin + '\\n').repeat(code.match(/\\n/gv).length);\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdocNode,\n report,\n sourceCode,\n}) => {\n const options = context.options[0] || {};\n const /** @type {{excludeTags: string[]}} */ {\n excludeTags = [\n 'example',\n ],\n } = options;\n\n const reg = /^(?:\\/?\\**|[ \\t]*)\\*[ \\t]{2}/gmv;\n const textWithoutCodeBlocks = maskCodeBlocks(sourceCode.getText(jsdocNode));\n const text = excludeTags.length ? maskExcludedContent(textWithoutCodeBlocks, excludeTags) : textWithoutCodeBlocks;\n\n if (reg.test(text)) {\n const lineBreaks = text.slice(0, reg.lastIndex).match(/\\n/gv) || [];\n report('There must be no indentation.', null, {\n line: lineBreaks.length,\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports invalid padding inside JSDoc blocks.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-indentation.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n excludeTags: {\n description: `Array of tags (e.g., \\`['example', 'description']\\`) whose content will be\n\"hidden\" from the \\`check-indentation\\` rule. Defaults to \\`['example']\\`.\n\nBy default, the whole JSDoc block will be checked for invalid padding.\nThat would include \\`@example\\` blocks too, which can get in the way\nof adding full, readable examples of code without ending up with multiple\nlinting issues.\n\nWhen disabled (by passing \\`excludeTags: []\\` option), the following code *will*\nreport a padding issue:\n\n\\`\\`\\`js\n/**\n * @example\n * anArray.filter((a) => {\n * return a.b;\n * });\n */\n\\`\\`\\``,\n items: {\n pattern: '^\\\\S+$',\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA,MAAMG,mBAAmB,GAAGA,CAACC,GAAG,EAAEC,WAAW,KAAK;EAChD,MAAMC,UAAU,GAAG,IAAIC,MAAM,CAAC,yBAAyBF,WAAW,CAACG,IAAI,CAAC,GAAG,CAAC,oEAAoE,EAAE,IAAI,CAA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,CAACO,SAAS,CAAC,CAACnB,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;IACnES,MAAM,CAAC,+BAA+B,EAAE,IAAI,EAAE;MAC5CW,IAAI,EAAEH,UAAU,CAAChB;IACnB,CAAC,CAAC;EACJ;AACF,CAAC,EAAE;EACDoB,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,8CAA8C;MAC3DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVrC,WAAW,EAAE;UACXiC,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;UACKK,KAAK,EAAE;YACLC,OAAO,EAAE,QAAQ;YACjBC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,MAAA,CAAA3B,OAAA,GAAAA,OAAA,CAAAjB,OAAA","ignoreList":[]}
|
|
@@ -270,6 +270,14 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
270
270
|
},
|
|
271
271
|
fixable: 'whitespace',
|
|
272
272
|
schema: [{
|
|
273
|
+
description: `If the string value is
|
|
274
|
+
\`"always"\` then a problem is raised when the lines are not aligned.
|
|
275
|
+
If it is \`"never"\` then a problem should be raised when there is more than
|
|
276
|
+
one space between each line's parts. If it is \`"any"\`, no alignment is made.
|
|
277
|
+
Defaults to \`"never"\`.
|
|
278
|
+
|
|
279
|
+
Note that in addition to alignment, the "never" and "always" options will both
|
|
280
|
+
ensure that at least one space is present after the asterisk delimiter.`,
|
|
273
281
|
enum: ['always', 'never', 'any'],
|
|
274
282
|
type: 'string'
|
|
275
283
|
}, {
|
|
@@ -277,38 +285,54 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
277
285
|
properties: {
|
|
278
286
|
customSpacings: {
|
|
279
287
|
additionalProperties: false,
|
|
288
|
+
description: `An object with any of the following spacing keys set to an integer.
|
|
289
|
+
If a spacing is not defined, it defaults to one.
|
|
290
|
+
`,
|
|
280
291
|
properties: {
|
|
281
292
|
postDelimiter: {
|
|
293
|
+
description: 'Affects spacing after the asterisk (e.g., `* @param`)',
|
|
282
294
|
type: 'integer'
|
|
283
295
|
},
|
|
284
296
|
postHyphen: {
|
|
297
|
+
description: 'Affects spacing after any hyphens in the description (e.g., `* @param {someType} name - A description`)',
|
|
285
298
|
type: 'integer'
|
|
286
299
|
},
|
|
287
300
|
postName: {
|
|
301
|
+
description: 'Affects spacing after the name (e.g., `* @param {someType} name `)',
|
|
288
302
|
type: 'integer'
|
|
289
303
|
},
|
|
290
304
|
postTag: {
|
|
305
|
+
description: 'Affects spacing after the tag (e.g., `* @param `)',
|
|
291
306
|
type: 'integer'
|
|
292
307
|
},
|
|
293
308
|
postType: {
|
|
309
|
+
description: 'Affects spacing after the type (e.g., `* @param {someType} `)',
|
|
294
310
|
type: 'integer'
|
|
295
311
|
}
|
|
296
|
-
}
|
|
312
|
+
},
|
|
313
|
+
type: 'object'
|
|
297
314
|
},
|
|
298
315
|
disableWrapIndent: {
|
|
316
|
+
description: 'Disables `wrapIndent`; existing wrap indentation is preserved without changes.',
|
|
299
317
|
type: 'boolean'
|
|
300
318
|
},
|
|
301
319
|
preserveMainDescriptionPostDelimiter: {
|
|
302
320
|
default: false,
|
|
321
|
+
description: `A boolean to determine whether to preserve the post-delimiter spacing of the
|
|
322
|
+
main description. If \`false\` or unset, will be set to a single space.`,
|
|
303
323
|
type: 'boolean'
|
|
304
324
|
},
|
|
305
325
|
tags: {
|
|
326
|
+
description: `Use this to change the tags which are sought for alignment changes. Defaults to an array of
|
|
327
|
+
\`['param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template']\`.`,
|
|
306
328
|
items: {
|
|
307
329
|
type: 'string'
|
|
308
330
|
},
|
|
309
331
|
type: 'array'
|
|
310
332
|
},
|
|
311
333
|
wrapIndent: {
|
|
334
|
+
description: `The indent that will be applied for tag text after the first line.
|
|
335
|
+
Default to the empty string (no indent).`,
|
|
312
336
|
type: 'string'
|
|
313
337
|
}
|
|
314
338
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkLineAlignment.cjs","names":["_alignTransform","_interopRequireDefault","require","_iterateJsdoc","_commentParser","e","__esModule","default","flow","commentFlow","transforms","checkNotAlignedPerTag","utils","tag","customSpacings","spacerProps","contentProps","mightHaveNamepath","tagMightHaveNamepath","tokens","source","followedBySpace","idx","callbck","nextIndex","slice","some","spacerProp","innerIdx","contentProp","spacePropVal","ret","postHyphenSpacing","postHyphen","exactHyphenSpacing","RegExp","hasNoHyphen","test","description","hasExactHyphenSpacing","ok","contentPropVal","spacerPropVal","spacing","length","fix","entries","padStart","hasSpace","contentPrp","hyphenSpacing","replace","setTag","reportJSDoc","checkAlignment","disableWrapIndent","indent","jsdoc","jsdocNode","preserveMainDescriptionPostDelimiter","report","tags","wrapIndent","transform","alignTransform","transformedJsdoc","comment","value","formatted","stringify","trimStart","fixer","replaceText","_default","exports","iterateJsdoc","context","applicableTags","options","includes","foundTags","getPresentTags","type","name","postDelimiter","line","number","charAt","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","postName","postTag","postType","items","module"],"sources":["../../src/rules/checkLineAlignment.js"],"sourcesContent":["import alignTransform from '../alignTransform.js';\nimport iterateJsdoc from '../iterateJsdoc.js';\nimport {\n transforms,\n} from 'comment-parser';\n\nconst {\n flow: commentFlow,\n} = transforms;\n\n/**\n * @typedef {{\n * postDelimiter: import('../iterateJsdoc.js').Integer,\n * postHyphen: import('../iterateJsdoc.js').Integer,\n * postName: import('../iterateJsdoc.js').Integer,\n * postTag: import('../iterateJsdoc.js').Integer,\n * postType: import('../iterateJsdoc.js').Integer,\n * }} CustomSpacings\n */\n\n/**\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('comment-parser').Spec & {\n * line: import('../iterateJsdoc.js').Integer\n * }} tag\n * @param {CustomSpacings} customSpacings\n */\nconst checkNotAlignedPerTag = (utils, tag, customSpacings) => {\n /*\n start +\n delimiter +\n postDelimiter +\n tag +\n postTag +\n type +\n postType +\n name +\n postName +\n description +\n end +\n lineEnd\n */\n\n /**\n * @typedef {\"tag\"|\"type\"|\"name\"|\"description\"} ContentProp\n */\n\n /** @type {(\"postDelimiter\"|\"postTag\"|\"postType\"|\"postName\")[]} */\n let spacerProps;\n /** @type {ContentProp[]} */\n let contentProps;\n const mightHaveNamepath = utils.tagMightHaveNamepath(tag.tag);\n if (mightHaveNamepath) {\n spacerProps = [\n 'postDelimiter', 'postTag', 'postType', 'postName',\n ];\n contentProps = [\n 'tag', 'type', 'name', 'description',\n ];\n } else {\n spacerProps = [\n 'postDelimiter', 'postTag', 'postType',\n ];\n contentProps = [\n 'tag', 'type', 'description',\n ];\n }\n\n const {\n tokens,\n } = tag.source[0];\n\n /**\n * @param {import('../iterateJsdoc.js').Integer} idx\n * @param {(notRet: boolean, contentProp: ContentProp) => void} [callbck]\n */\n const followedBySpace = (idx, callbck) => {\n const nextIndex = idx + 1;\n\n return spacerProps.slice(nextIndex).some((spacerProp, innerIdx) => {\n const contentProp = contentProps[nextIndex + innerIdx];\n\n const spacePropVal = tokens[spacerProp];\n\n const ret = spacePropVal;\n\n if (callbck) {\n callbck(!ret, contentProp);\n }\n\n return ret && (callbck || !contentProp);\n });\n };\n\n const postHyphenSpacing = customSpacings?.postHyphen ?? 1;\n const exactHyphenSpacing = new RegExp(`^\\\\s*-\\\\s{${postHyphenSpacing},${postHyphenSpacing}}(?!\\\\s)`, 'v');\n const hasNoHyphen = !(/^\\s*-(?!$)(?=\\s)/v).test(tokens.description);\n const hasExactHyphenSpacing = exactHyphenSpacing.test(\n tokens.description,\n );\n\n // If checking alignment on multiple lines, need to check other `source`\n // items\n // Go through `post*` spacing properties and exit to indicate problem if\n // extra spacing detected\n const ok = !spacerProps.some((spacerProp, idx) => {\n const contentProp = contentProps[idx];\n const contentPropVal = tokens[contentProp];\n const spacerPropVal = tokens[spacerProp];\n const spacing = customSpacings?.[spacerProp] || 1;\n\n // There will be extra alignment if...\n\n // 1. The spaces don't match the space it should have (1 or custom spacing) OR\n return spacerPropVal.length !== spacing && spacerPropVal.length !== 0 ||\n\n // 2. There is a (single) space, no immediate content, and yet another\n // space is found subsequently (not separated by intervening content)\n spacerPropVal && !contentPropVal && followedBySpace(idx);\n }) && (hasNoHyphen || hasExactHyphenSpacing);\n if (ok) {\n return;\n }\n\n const fix = () => {\n for (const [\n idx,\n spacerProp,\n ] of spacerProps.entries()) {\n const contentProp = contentProps[idx];\n const contentPropVal = tokens[contentProp];\n\n if (contentPropVal) {\n const spacing = customSpacings?.[spacerProp] || 1;\n tokens[spacerProp] = ''.padStart(spacing, ' ');\n followedBySpace(idx, (hasSpace, contentPrp) => {\n if (hasSpace) {\n tokens[contentPrp] = '';\n }\n });\n } else {\n tokens[spacerProp] = '';\n }\n }\n\n if (!hasExactHyphenSpacing) {\n const hyphenSpacing = /^\\s*-\\s+/v;\n tokens.description = tokens.description.replace(\n hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '),\n );\n }\n\n utils.setTag(tag, tokens);\n };\n\n utils.reportJSDoc('Expected JSDoc block lines to not be aligned.', tag, fix, true);\n};\n\n/**\n * @param {object} cfg\n * @param {CustomSpacings} cfg.customSpacings\n * @param {string} cfg.indent\n * @param {import('comment-parser').Block} cfg.jsdoc\n * @param {import('eslint').Rule.Node & {\n * range: [number, number]\n * }} cfg.jsdocNode\n * @param {boolean} cfg.preserveMainDescriptionPostDelimiter\n * @param {import('../iterateJsdoc.js').Report} cfg.report\n * @param {string[]} cfg.tags\n * @param {import('../iterateJsdoc.js').Utils} cfg.utils\n * @param {string} cfg.wrapIndent\n * @param {boolean} cfg.disableWrapIndent\n * @returns {void}\n */\nconst checkAlignment = ({\n customSpacings,\n disableWrapIndent,\n indent,\n jsdoc,\n jsdocNode,\n preserveMainDescriptionPostDelimiter,\n report,\n tags,\n utils,\n wrapIndent,\n}) => {\n const transform = commentFlow(\n alignTransform({\n customSpacings,\n disableWrapIndent,\n indent,\n preserveMainDescriptionPostDelimiter,\n tags,\n wrapIndent,\n }),\n );\n const transformedJsdoc = transform(jsdoc);\n\n const comment = '/*' +\n /**\n * @type {import('eslint').Rule.Node & {\n * range: [number, number], value: string\n * }}\n */ (jsdocNode).value + '*/';\n\n const formatted = utils.stringify(transformedJsdoc)\n .trimStart();\n\n if (comment !== formatted) {\n report(\n 'Expected JSDoc block lines to be aligned.',\n /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n return fixer.replaceText(jsdocNode, formatted);\n },\n );\n }\n};\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n jsdocNode,\n report,\n utils,\n}) => {\n const {\n customSpacings,\n disableWrapIndent = false,\n preserveMainDescriptionPostDelimiter,\n tags: applicableTags = [\n 'param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template',\n ],\n wrapIndent = '',\n } = context.options[1] || {};\n\n if (context.options[0] === 'always') {\n // Skip if it contains only a single line.\n if (!(\n /**\n * @type {import('eslint').Rule.Node & {\n * range: [number, number], value: string\n * }}\n */\n (jsdocNode).value.includes('\\n')\n )) {\n return;\n }\n\n checkAlignment({\n customSpacings,\n disableWrapIndent,\n indent,\n jsdoc,\n jsdocNode,\n preserveMainDescriptionPostDelimiter,\n report,\n tags: applicableTags,\n utils,\n wrapIndent,\n });\n\n return;\n }\n\n const foundTags = utils.getPresentTags(applicableTags);\n if (context.options[0] !== 'any') {\n for (const tag of foundTags) {\n checkNotAlignedPerTag(\n utils,\n /**\n * @type {import('comment-parser').Spec & {\n * line: import('../iterateJsdoc.js').Integer\n * }}\n */\n (tag),\n customSpacings,\n );\n }\n }\n\n for (const tag of foundTags) {\n if (tag.source.length > 1) {\n let idx = 0;\n for (const {\n tokens,\n // Avoid the tag line\n } of tag.source.slice(1)) {\n idx++;\n\n if (\n !tokens.description ||\n // Avoid first lines after multiline type\n tokens.type ||\n tokens.name\n ) {\n continue;\n }\n\n // Don't include a single separating space/tab\n if (!disableWrapIndent && tokens.postDelimiter.slice(1) !== wrapIndent) {\n utils.reportJSDoc('Expected wrap indent', {\n line: tag.source[0].number + idx,\n }, () => {\n tokens.postDelimiter = tokens.postDelimiter.charAt(0) + wrapIndent;\n });\n return;\n }\n }\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports invalid alignment of JSDoc block lines.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-line-alignment.md#repos-sticky-header',\n },\n fixable: 'whitespace',\n schema: [\n {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n customSpacings: {\n additionalProperties: false,\n properties: {\n postDelimiter: {\n type: 'integer',\n },\n postHyphen: {\n type: 'integer',\n },\n postName: {\n type: 'integer',\n },\n postTag: {\n type: 'integer',\n },\n postType: {\n type: 'integer',\n },\n },\n },\n disableWrapIndent: {\n type: 'boolean',\n },\n preserveMainDescriptionPostDelimiter: {\n default: false,\n type: 'boolean',\n },\n tags: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n wrapIndent: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAEwB,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExB,MAAM;EACJG,IAAI,EAAEC;AACR,CAAC,GAAGC,yBAAU;;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C,OAAO,EAAE,YAAY;IACrBC,MAAM,EAAE,CACN;MACEC,IAAI,EAAE,CACJ,QAAQ,EAAE,OAAO,EAAE,KAAK,CACzB;MACDZ,IAAI,EAAE;IACR,CAAC,EACD;MACEa,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVlF,cAAc,EAAE;UACdiF,oBAAoB,EAAE,KAAK;UAC3BC,UAAU,EAAE;YACVZ,aAAa,EAAE;cACbF,IAAI,EAAE;YACR,CAAC;YACDjD,UAAU,EAAE;cACViD,IAAI,EAAE;YACR,CAAC;YACDe,QAAQ,EAAE;cACRf,IAAI,EAAE;YACR,CAAC;YACDgB,OAAO,EAAE;cACPhB,IAAI,EAAE;YACR,CAAC;YACDiB,QAAQ,EAAE;cACRjB,IAAI,EAAE;YACR;UACF;QACF,CAAC;QACD3B,iBAAiB,EAAE;UACjB2B,IAAI,EAAE;QACR,CAAC;QACDvB,oCAAoC,EAAE;UACpCpD,OAAO,EAAE,KAAK;UACd2E,IAAI,EAAE;QACR,CAAC;QACDrB,IAAI,EAAE;UACJuC,KAAK,EAAE;YACLlB,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDpB,UAAU,EAAE;UACVoB,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAmB,MAAA,CAAA3B,OAAA,GAAAA,OAAA,CAAAnE,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"checkLineAlignment.cjs","names":["_alignTransform","_interopRequireDefault","require","_iterateJsdoc","_commentParser","e","__esModule","default","flow","commentFlow","transforms","checkNotAlignedPerTag","utils","tag","customSpacings","spacerProps","contentProps","mightHaveNamepath","tagMightHaveNamepath","tokens","source","followedBySpace","idx","callbck","nextIndex","slice","some","spacerProp","innerIdx","contentProp","spacePropVal","ret","postHyphenSpacing","postHyphen","exactHyphenSpacing","RegExp","hasNoHyphen","test","description","hasExactHyphenSpacing","ok","contentPropVal","spacerPropVal","spacing","length","fix","entries","padStart","hasSpace","contentPrp","hyphenSpacing","replace","setTag","reportJSDoc","checkAlignment","disableWrapIndent","indent","jsdoc","jsdocNode","preserveMainDescriptionPostDelimiter","report","tags","wrapIndent","transform","alignTransform","transformedJsdoc","comment","value","formatted","stringify","trimStart","fixer","replaceText","_default","exports","iterateJsdoc","context","applicableTags","options","includes","foundTags","getPresentTags","type","name","postDelimiter","line","number","charAt","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","postName","postTag","postType","items","module"],"sources":["../../src/rules/checkLineAlignment.js"],"sourcesContent":["import alignTransform from '../alignTransform.js';\nimport iterateJsdoc from '../iterateJsdoc.js';\nimport {\n transforms,\n} from 'comment-parser';\n\nconst {\n flow: commentFlow,\n} = transforms;\n\n/**\n * @typedef {{\n * postDelimiter: import('../iterateJsdoc.js').Integer,\n * postHyphen: import('../iterateJsdoc.js').Integer,\n * postName: import('../iterateJsdoc.js').Integer,\n * postTag: import('../iterateJsdoc.js').Integer,\n * postType: import('../iterateJsdoc.js').Integer,\n * }} CustomSpacings\n */\n\n/**\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('comment-parser').Spec & {\n * line: import('../iterateJsdoc.js').Integer\n * }} tag\n * @param {CustomSpacings} customSpacings\n */\nconst checkNotAlignedPerTag = (utils, tag, customSpacings) => {\n /*\n start +\n delimiter +\n postDelimiter +\n tag +\n postTag +\n type +\n postType +\n name +\n postName +\n description +\n end +\n lineEnd\n */\n\n /**\n * @typedef {\"tag\"|\"type\"|\"name\"|\"description\"} ContentProp\n */\n\n /** @type {(\"postDelimiter\"|\"postTag\"|\"postType\"|\"postName\")[]} */\n let spacerProps;\n /** @type {ContentProp[]} */\n let contentProps;\n const mightHaveNamepath = utils.tagMightHaveNamepath(tag.tag);\n if (mightHaveNamepath) {\n spacerProps = [\n 'postDelimiter', 'postTag', 'postType', 'postName',\n ];\n contentProps = [\n 'tag', 'type', 'name', 'description',\n ];\n } else {\n spacerProps = [\n 'postDelimiter', 'postTag', 'postType',\n ];\n contentProps = [\n 'tag', 'type', 'description',\n ];\n }\n\n const {\n tokens,\n } = tag.source[0];\n\n /**\n * @param {import('../iterateJsdoc.js').Integer} idx\n * @param {(notRet: boolean, contentProp: ContentProp) => void} [callbck]\n */\n const followedBySpace = (idx, callbck) => {\n const nextIndex = idx + 1;\n\n return spacerProps.slice(nextIndex).some((spacerProp, innerIdx) => {\n const contentProp = contentProps[nextIndex + innerIdx];\n\n const spacePropVal = tokens[spacerProp];\n\n const ret = spacePropVal;\n\n if (callbck) {\n callbck(!ret, contentProp);\n }\n\n return ret && (callbck || !contentProp);\n });\n };\n\n const postHyphenSpacing = customSpacings?.postHyphen ?? 1;\n const exactHyphenSpacing = new RegExp(`^\\\\s*-\\\\s{${postHyphenSpacing},${postHyphenSpacing}}(?!\\\\s)`, 'v');\n const hasNoHyphen = !(/^\\s*-(?!$)(?=\\s)/v).test(tokens.description);\n const hasExactHyphenSpacing = exactHyphenSpacing.test(\n tokens.description,\n );\n\n // If checking alignment on multiple lines, need to check other `source`\n // items\n // Go through `post*` spacing properties and exit to indicate problem if\n // extra spacing detected\n const ok = !spacerProps.some((spacerProp, idx) => {\n const contentProp = contentProps[idx];\n const contentPropVal = tokens[contentProp];\n const spacerPropVal = tokens[spacerProp];\n const spacing = customSpacings?.[spacerProp] || 1;\n\n // There will be extra alignment if...\n\n // 1. The spaces don't match the space it should have (1 or custom spacing) OR\n return spacerPropVal.length !== spacing && spacerPropVal.length !== 0 ||\n\n // 2. There is a (single) space, no immediate content, and yet another\n // space is found subsequently (not separated by intervening content)\n spacerPropVal && !contentPropVal && followedBySpace(idx);\n }) && (hasNoHyphen || hasExactHyphenSpacing);\n if (ok) {\n return;\n }\n\n const fix = () => {\n for (const [\n idx,\n spacerProp,\n ] of spacerProps.entries()) {\n const contentProp = contentProps[idx];\n const contentPropVal = tokens[contentProp];\n\n if (contentPropVal) {\n const spacing = customSpacings?.[spacerProp] || 1;\n tokens[spacerProp] = ''.padStart(spacing, ' ');\n followedBySpace(idx, (hasSpace, contentPrp) => {\n if (hasSpace) {\n tokens[contentPrp] = '';\n }\n });\n } else {\n tokens[spacerProp] = '';\n }\n }\n\n if (!hasExactHyphenSpacing) {\n const hyphenSpacing = /^\\s*-\\s+/v;\n tokens.description = tokens.description.replace(\n hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '),\n );\n }\n\n utils.setTag(tag, tokens);\n };\n\n utils.reportJSDoc('Expected JSDoc block lines to not be aligned.', tag, fix, true);\n};\n\n/**\n * @param {object} cfg\n * @param {CustomSpacings} cfg.customSpacings\n * @param {string} cfg.indent\n * @param {import('comment-parser').Block} cfg.jsdoc\n * @param {import('eslint').Rule.Node & {\n * range: [number, number]\n * }} cfg.jsdocNode\n * @param {boolean} cfg.preserveMainDescriptionPostDelimiter\n * @param {import('../iterateJsdoc.js').Report} cfg.report\n * @param {string[]} cfg.tags\n * @param {import('../iterateJsdoc.js').Utils} cfg.utils\n * @param {string} cfg.wrapIndent\n * @param {boolean} cfg.disableWrapIndent\n * @returns {void}\n */\nconst checkAlignment = ({\n customSpacings,\n disableWrapIndent,\n indent,\n jsdoc,\n jsdocNode,\n preserveMainDescriptionPostDelimiter,\n report,\n tags,\n utils,\n wrapIndent,\n}) => {\n const transform = commentFlow(\n alignTransform({\n customSpacings,\n disableWrapIndent,\n indent,\n preserveMainDescriptionPostDelimiter,\n tags,\n wrapIndent,\n }),\n );\n const transformedJsdoc = transform(jsdoc);\n\n const comment = '/*' +\n /**\n * @type {import('eslint').Rule.Node & {\n * range: [number, number], value: string\n * }}\n */ (jsdocNode).value + '*/';\n\n const formatted = utils.stringify(transformedJsdoc)\n .trimStart();\n\n if (comment !== formatted) {\n report(\n 'Expected JSDoc block lines to be aligned.',\n /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n return fixer.replaceText(jsdocNode, formatted);\n },\n );\n }\n};\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n jsdocNode,\n report,\n utils,\n}) => {\n const {\n customSpacings,\n disableWrapIndent = false,\n preserveMainDescriptionPostDelimiter,\n tags: applicableTags = [\n 'param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template',\n ],\n wrapIndent = '',\n } = context.options[1] || {};\n\n if (context.options[0] === 'always') {\n // Skip if it contains only a single line.\n if (!(\n /**\n * @type {import('eslint').Rule.Node & {\n * range: [number, number], value: string\n * }}\n */\n (jsdocNode).value.includes('\\n')\n )) {\n return;\n }\n\n checkAlignment({\n customSpacings,\n disableWrapIndent,\n indent,\n jsdoc,\n jsdocNode,\n preserveMainDescriptionPostDelimiter,\n report,\n tags: applicableTags,\n utils,\n wrapIndent,\n });\n\n return;\n }\n\n const foundTags = utils.getPresentTags(applicableTags);\n if (context.options[0] !== 'any') {\n for (const tag of foundTags) {\n checkNotAlignedPerTag(\n utils,\n /**\n * @type {import('comment-parser').Spec & {\n * line: import('../iterateJsdoc.js').Integer\n * }}\n */\n (tag),\n customSpacings,\n );\n }\n }\n\n for (const tag of foundTags) {\n if (tag.source.length > 1) {\n let idx = 0;\n for (const {\n tokens,\n // Avoid the tag line\n } of tag.source.slice(1)) {\n idx++;\n\n if (\n !tokens.description ||\n // Avoid first lines after multiline type\n tokens.type ||\n tokens.name\n ) {\n continue;\n }\n\n // Don't include a single separating space/tab\n if (!disableWrapIndent && tokens.postDelimiter.slice(1) !== wrapIndent) {\n utils.reportJSDoc('Expected wrap indent', {\n line: tag.source[0].number + idx,\n }, () => {\n tokens.postDelimiter = tokens.postDelimiter.charAt(0) + wrapIndent;\n });\n return;\n }\n }\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports invalid alignment of JSDoc block lines.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-line-alignment.md#repos-sticky-header',\n },\n fixable: 'whitespace',\n schema: [\n {\n description: `If the string value is\n\\`\"always\"\\` then a problem is raised when the lines are not aligned.\nIf it is \\`\"never\"\\` then a problem should be raised when there is more than\none space between each line's parts. If it is \\`\"any\"\\`, no alignment is made.\nDefaults to \\`\"never\"\\`.\n\nNote that in addition to alignment, the \"never\" and \"always\" options will both\nensure that at least one space is present after the asterisk delimiter.`,\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n customSpacings: {\n additionalProperties: false,\n description: `An object with any of the following spacing keys set to an integer.\nIf a spacing is not defined, it defaults to one.\n`,\n properties: {\n postDelimiter: {\n description: 'Affects spacing after the asterisk (e.g., `* @param`)',\n type: 'integer',\n },\n postHyphen: {\n description: 'Affects spacing after any hyphens in the description (e.g., `* @param {someType} name - A description`)',\n type: 'integer',\n },\n postName: {\n description: 'Affects spacing after the name (e.g., `* @param {someType} name `)',\n type: 'integer',\n },\n postTag: {\n description: 'Affects spacing after the tag (e.g., `* @param `)',\n type: 'integer',\n },\n postType: {\n description: 'Affects spacing after the type (e.g., `* @param {someType} `)',\n type: 'integer',\n },\n },\n type: 'object',\n },\n disableWrapIndent: {\n description: 'Disables `wrapIndent`; existing wrap indentation is preserved without changes.',\n type: 'boolean',\n },\n preserveMainDescriptionPostDelimiter: {\n default: false,\n description: `A boolean to determine whether to preserve the post-delimiter spacing of the\nmain description. If \\`false\\` or unset, will be set to a single space.`,\n type: 'boolean',\n },\n tags: {\n description: `Use this to change the tags which are sought for alignment changes. Defaults to an array of\n\\`['param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template']\\`.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n wrapIndent: {\n description: `The indent that will be applied for tag text after the first line.\nDefault to the empty string (no indent).`,\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GA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YACLlB,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDpB,UAAU,EAAE;UACVxB,WAAW,EAAE;AACzB,yCAAyC;UAC7B4C,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAmB,MAAA,CAAA3B,OAAA,GAAAA,OAAA,CAAAnE,OAAA","ignoreList":[]}
|
|
@@ -304,7 +304,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
304
304
|
contextDefaults: allowedNodes,
|
|
305
305
|
meta: {
|
|
306
306
|
docs: {
|
|
307
|
-
description: '
|
|
307
|
+
description: 'Checks for dupe `@param` names, that nested param names have roots, and that parameter names in function declarations match JSDoc param names.',
|
|
308
308
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-param-names.md#repos-sticky-header'
|
|
309
309
|
},
|
|
310
310
|
fixable: 'code',
|
|
@@ -312,27 +312,88 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
312
312
|
additionalProperties: false,
|
|
313
313
|
properties: {
|
|
314
314
|
allowExtraTrailingParamDocs: {
|
|
315
|
+
description: `If set to \`true\`, this option will allow extra \`@param\` definitions (e.g.,
|
|
316
|
+
representing future expected or virtual params) to be present without needing
|
|
317
|
+
their presence within the function signature. Other inconsistencies between
|
|
318
|
+
\`@param\`'s and present function parameters will still be reported.`,
|
|
315
319
|
type: 'boolean'
|
|
316
320
|
},
|
|
317
321
|
checkDestructured: {
|
|
322
|
+
description: 'Whether to check destructured properties. Defaults to `true`.',
|
|
318
323
|
type: 'boolean'
|
|
319
324
|
},
|
|
320
325
|
checkRestProperty: {
|
|
326
|
+
description: `If set to \`true\`, will require that rest properties are documented and
|
|
327
|
+
that any extraneous properties (which may have been within the rest property)
|
|
328
|
+
are documented. Defaults to \`false\`.`,
|
|
321
329
|
type: 'boolean'
|
|
322
330
|
},
|
|
323
331
|
checkTypesPattern: {
|
|
332
|
+
description: `Defines a regular expression pattern to indicate which types should be
|
|
333
|
+
checked for destructured content (and that those not matched should not
|
|
334
|
+
be checked).
|
|
335
|
+
|
|
336
|
+
When one specifies a type, unless it is of a generic type, like \`object\`
|
|
337
|
+
or \`array\`, it may be considered unnecessary to have that object's
|
|
338
|
+
destructured components required, especially where generated docs will
|
|
339
|
+
link back to the specified type. For example:
|
|
340
|
+
|
|
341
|
+
\`\`\`js
|
|
342
|
+
/**
|
|
343
|
+
* @param {SVGRect} bbox - a SVGRect
|
|
344
|
+
*/
|
|
345
|
+
export const bboxToObj = function ({x, y, width, height}) {
|
|
346
|
+
return {x, y, width, height};
|
|
347
|
+
};
|
|
348
|
+
\`\`\`
|
|
349
|
+
|
|
350
|
+
By default \`checkTypesPattern\` is set to
|
|
351
|
+
\`/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/v\`,
|
|
352
|
+
meaning that destructuring will be required only if the type of the \`@param\`
|
|
353
|
+
(the text between curly brackets) is a match for "Object" or "Array" (with or
|
|
354
|
+
without initial caps), "PlainObject", or "GenericObject", "GenericArray" (or
|
|
355
|
+
if no type is present). So in the above example, the lack of a match will
|
|
356
|
+
mean that no complaint will be given about the undocumented destructured
|
|
357
|
+
parameters.
|
|
358
|
+
|
|
359
|
+
Note that the \`/\` delimiters are optional, but necessary to add flags.
|
|
360
|
+
|
|
361
|
+
Defaults to using (only) the \`v\` flag, so to add your own flags, encapsulate
|
|
362
|
+
your expression as a string, but like a literal, e.g., \`/^object$/vi\`.
|
|
363
|
+
|
|
364
|
+
You could set this regular expression to a more expansive list, or you
|
|
365
|
+
could restrict it such that even types matching those strings would not
|
|
366
|
+
need destructuring.`,
|
|
324
367
|
type: 'string'
|
|
325
368
|
},
|
|
326
369
|
disableExtraPropertyReporting: {
|
|
370
|
+
description: `Whether to check for extra destructured properties. Defaults to \`false\`. Change
|
|
371
|
+
to \`true\` if you want to be able to document properties which are not actually
|
|
372
|
+
destructured. Keep as \`false\` if you expect properties to be documented in
|
|
373
|
+
their own types. Note that extra properties will always be reported if another
|
|
374
|
+
item at the same level is destructured as destructuring will prevent other
|
|
375
|
+
access and this option is only intended to permit documenting extra properties
|
|
376
|
+
that are available and actually used in the function.`,
|
|
327
377
|
type: 'boolean'
|
|
328
378
|
},
|
|
329
379
|
disableMissingParamChecks: {
|
|
380
|
+
description: 'Whether to avoid checks for missing `@param` definitions. Defaults to `false`. Change to `true` if you want to be able to omit properties.',
|
|
330
381
|
type: 'boolean'
|
|
331
382
|
},
|
|
332
383
|
enableFixer: {
|
|
384
|
+
description: `Set to \`true\` to auto-remove \`@param\` duplicates (based on identical
|
|
385
|
+
names).
|
|
386
|
+
|
|
387
|
+
Note that this option will remove duplicates of the same name even if
|
|
388
|
+
the definitions do not match in other ways (e.g., the second param will
|
|
389
|
+
be removed even if it has a different type or description).`,
|
|
333
390
|
type: 'boolean'
|
|
334
391
|
},
|
|
335
392
|
useDefaultObjectProperties: {
|
|
393
|
+
description: `Set to \`true\` if you wish to avoid reporting of child property documentation
|
|
394
|
+
where instead of destructuring, a whole plain object is supplied as default
|
|
395
|
+
value but you wish its keys to be considered as signalling that the properties
|
|
396
|
+
are present and can therefore be documented. Defaults to \`false\`.`,
|
|
336
397
|
type: 'boolean'
|
|
337
398
|
}
|
|
338
399
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkParamNames.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","validateParameterNames","targetTagName","allowExtraTrailingParamDocs","checkDestructured","checkRestProperty","checkTypesRegex","disableExtraPropertyReporting","disableMissingParamChecks","enableFixer","functionParameterNames","jsdoc","utils","report","paramTags","Object","entries","tags","filter","tag","paramTagsNonNested","name","includes","dotted","thisOffset","some","index","tagsIndex","dupeTagInfo","find","tgsIndex","tg","idx","Number","reportJSDoc","removeTag","functionParameterName","trim","Array","isArray","actualName","expectedName","type","search","parameterName","annotationParamName","hasPropertyRest","names","properties","rests","undefined","tagName","expectedNames","map","actualNames","paramTag","actualTypes","missingProperties","notCheckingNames","notCheckingName","startsWith","actualNameIdx","findIndex","comparePaths","missingIndex","pathDoesNotBeginWith","line","source","number","length","push","tagPlacement","hasMissing","missingProperty","extraProperties","match","prop","split","extraProperty","funcParamName","item","usedExpectedNames","a","toString","usedInOrder","every","restElement","join","validateParameterNamesDeep","_allowExtraTrailingParamDocs","jsdocParameterNames","lastRealParameter","jsdocParameterName","isPropertyPath","pathRootNodeName","slice","indexOf","endsWith","allowedNodes","_default","exports","iterateJsdoc","context","node","checkTypesPattern","useDefaultObjectProperties","options","getRegexFromString","jsdocParameterNamesDeep","getJsdocTagsDeep","getFunctionParameterNames","getPreferredTagName","isError","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","module"],"sources":["../../src/rules/checkParamNames.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {string} targetTagName\n * @param {boolean} allowExtraTrailingParamDocs\n * @param {boolean} checkDestructured\n * @param {boolean} checkRestProperty\n * @param {RegExp} checkTypesRegex\n * @param {boolean} disableExtraPropertyReporting\n * @param {boolean} disableMissingParamChecks\n * @param {boolean} enableFixer\n * @param {import('../jsdocUtils.js').ParamNameInfo[]} functionParameterNames\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('../iterateJsdoc.js').Report} report\n * @returns {boolean}\n */\nconst validateParameterNames = (\n targetTagName,\n allowExtraTrailingParamDocs,\n checkDestructured,\n checkRestProperty,\n checkTypesRegex,\n disableExtraPropertyReporting,\n disableMissingParamChecks,\n enableFixer,\n functionParameterNames, jsdoc, utils, report,\n) => {\n const paramTags = Object.entries(jsdoc.tags).filter(([\n , tag,\n ]) => {\n return tag.tag === targetTagName;\n });\n const paramTagsNonNested = paramTags.filter(([\n , tag,\n ]) => {\n return !tag.name.includes('.');\n });\n\n let dotted = 0;\n let thisOffset = 0;\n\n // eslint-disable-next-line complexity\n return paramTags.some(([\n , tag,\n ], index) => {\n /** @type {import('../iterateJsdoc.js').Integer} */\n let tagsIndex;\n const dupeTagInfo = paramTags.find(([\n tgsIndex,\n tg,\n ], idx) => {\n tagsIndex = Number(tgsIndex);\n\n return tg.name === tag.name && idx !== index;\n });\n if (dupeTagInfo) {\n utils.reportJSDoc(`Duplicate @${targetTagName} \"${tag.name}\"`, dupeTagInfo[1], enableFixer ? () => {\n utils.removeTag(tagsIndex);\n } : null);\n\n return true;\n }\n\n if (tag.name.includes('.')) {\n dotted++;\n\n return false;\n }\n\n let functionParameterName = functionParameterNames[index - dotted + thisOffset];\n if (functionParameterName === 'this' && tag.name.trim() !== 'this') {\n ++thisOffset;\n functionParameterName = functionParameterNames[index - dotted + thisOffset];\n }\n\n if (!functionParameterName) {\n if (allowExtraTrailingParamDocs) {\n return false;\n }\n\n report(\n `@${targetTagName} \"${tag.name}\" does not match an existing function parameter.`,\n null,\n tag,\n );\n\n return true;\n }\n\n if (\n typeof functionParameterName === 'object' &&\n 'name' in functionParameterName &&\n Array.isArray(functionParameterName.name)\n ) {\n const actualName = tag.name.trim();\n const expectedName = functionParameterName.name[index];\n if (actualName === expectedName) {\n thisOffset--;\n return false;\n }\n\n report(\n `Expected @${targetTagName} name to be \"${expectedName}\". Got \"${actualName}\".`,\n null,\n tag,\n );\n return true;\n }\n\n if (Array.isArray(functionParameterName)) {\n if (!checkDestructured) {\n return false;\n }\n\n if (tag.type && tag.type.search(checkTypesRegex) === -1) {\n return false;\n }\n\n const [\n parameterName,\n {\n annotationParamName,\n hasPropertyRest,\n names: properties,\n rests,\n },\n ] =\n /**\n * @type {[string | undefined, import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string | undefined;\n }]} */ (functionParameterName);\n if (annotationParamName !== undefined) {\n const name = tag.name.trim();\n if (name !== annotationParamName) {\n report(`@${targetTagName} \"${name}\" does not match parameter name \"${annotationParamName}\"`, null, tag);\n }\n }\n\n const tagName = parameterName === undefined ? tag.name.trim() : parameterName;\n const expectedNames = properties.map((name) => {\n return `${tagName}.${name}`;\n });\n const actualNames = paramTags.map(([\n , paramTag,\n ]) => {\n return paramTag.name.trim();\n });\n const actualTypes = paramTags.map(([\n , paramTag,\n ]) => {\n return paramTag.type;\n });\n\n const missingProperties = [];\n\n /** @type {string[]} */\n const notCheckingNames = [];\n\n for (const [\n idx,\n name,\n ] of expectedNames.entries()) {\n if (notCheckingNames.some((notCheckingName) => {\n return name.startsWith(notCheckingName);\n })) {\n continue;\n }\n\n const actualNameIdx = actualNames.findIndex((actualName) => {\n return utils.comparePaths(name)(actualName);\n });\n if (actualNameIdx === -1) {\n if (!checkRestProperty && rests[idx]) {\n continue;\n }\n\n const missingIndex = actualNames.findIndex((actualName) => {\n return utils.pathDoesNotBeginWith(name, actualName);\n });\n const line = tag.source[0].number - 1 + (missingIndex > -1 ? missingIndex : actualNames.length);\n missingProperties.push({\n name,\n tagPlacement: {\n line: line === 0 ? 1 : line,\n },\n });\n } else if (actualTypes[actualNameIdx].search(checkTypesRegex) === -1 && actualTypes[actualNameIdx] !== '') {\n notCheckingNames.push(name);\n }\n }\n\n const hasMissing = missingProperties.length;\n if (hasMissing) {\n for (const {\n name: missingProperty,\n tagPlacement,\n } of missingProperties) {\n report(`Missing @${targetTagName} \"${missingProperty}\"`, null, tagPlacement);\n }\n }\n\n if (!hasPropertyRest || checkRestProperty) {\n /** @type {[string, import('comment-parser').Spec][]} */\n const extraProperties = [];\n for (const [\n idx,\n name,\n ] of actualNames.entries()) {\n const match = name.startsWith(tag.name.trim() + '.');\n if (\n match && !expectedNames.some(\n utils.comparePaths(name),\n ) && !utils.comparePaths(name)(tag.name) &&\n (!disableExtraPropertyReporting || properties.some((prop) => {\n return prop.split('.').length >= name.split('.').length - 1;\n }))\n ) {\n extraProperties.push([\n name, paramTags[idx][1],\n ]);\n }\n }\n\n if (extraProperties.length) {\n for (const [\n extraProperty,\n tg,\n ] of extraProperties) {\n report(`@${targetTagName} \"${extraProperty}\" does not exist on ${tag.name}`, null, tg);\n }\n\n return true;\n }\n }\n\n return hasMissing;\n }\n\n let funcParamName;\n if (typeof functionParameterName === 'object') {\n const {\n name,\n } = functionParameterName;\n funcParamName = name;\n } else {\n funcParamName = functionParameterName;\n }\n\n if (funcParamName !== tag.name.trim()) {\n // Todo: Improve for array or object child items\n const actualNames = paramTagsNonNested.map(([\n , {\n name,\n },\n ]) => {\n return name.trim();\n });\n\n const expectedNames = functionParameterNames.map((item, idx) => {\n if (/**\n * @type {[string|undefined, (import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string,\n })]} */ (item)?.[1]?.names) {\n return actualNames[idx];\n }\n\n return item;\n }).filter((item) => {\n return item !== 'this';\n });\n\n // When disableMissingParamChecks is true tag names can be omitted.\n // Report when the tag names do not match the expected names or they are used out of order.\n if (disableMissingParamChecks) {\n const usedExpectedNames = expectedNames.map((a) => {\n return a?.toString();\n }).filter((expectedName) => {\n return expectedName && actualNames.includes(expectedName);\n });\n const usedInOrder = actualNames.every((actualName, idx) => {\n return actualName === usedExpectedNames[idx];\n });\n if (usedInOrder) {\n return false;\n }\n }\n\n report(\n `Expected @${targetTagName} names to be \"${\n expectedNames.map((expectedName) => {\n return typeof expectedName === 'object' &&\n 'name' in expectedName &&\n expectedName.restElement ?\n '...' + expectedName.name :\n expectedName;\n }).join(', ')\n }\". Got \"${actualNames.join(', ')}\".`,\n null,\n tag,\n );\n\n return true;\n }\n\n return false;\n });\n};\n\n/**\n * @param {string} targetTagName\n * @param {boolean} _allowExtraTrailingParamDocs\n * @param {{\n * name: string,\n * idx: import('../iterateJsdoc.js').Integer\n * }[]} jsdocParameterNames\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Report} report\n * @returns {boolean}\n */\nconst validateParameterNamesDeep = (\n targetTagName, _allowExtraTrailingParamDocs,\n jsdocParameterNames, jsdoc, report,\n) => {\n /** @type {string} */\n let lastRealParameter;\n\n return jsdocParameterNames.some(({\n idx,\n name: jsdocParameterName,\n }) => {\n const isPropertyPath = jsdocParameterName.includes('.');\n\n if (isPropertyPath) {\n if (!lastRealParameter) {\n report(`@${targetTagName} path declaration (\"${jsdocParameterName}\") appears before any real parameter.`, null, jsdoc.tags[idx]);\n\n return true;\n }\n\n let pathRootNodeName = jsdocParameterName.slice(0, jsdocParameterName.indexOf('.'));\n\n if (pathRootNodeName.endsWith('[]')) {\n pathRootNodeName = pathRootNodeName.slice(0, -2);\n }\n\n if (pathRootNodeName !== lastRealParameter) {\n report(\n `@${targetTagName} path declaration (\"${jsdocParameterName}\") root node name (\"${pathRootNodeName}\") ` +\n `does not match previous real parameter name (\"${lastRealParameter}\").`,\n null,\n jsdoc.tags[idx],\n );\n\n return true;\n }\n } else {\n lastRealParameter = jsdocParameterName;\n }\n\n return false;\n });\n};\n\nconst allowedNodes = [\n 'ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression', 'TSDeclareFunction',\n // Add this to above defaults\n 'TSMethodSignature',\n];\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n node,\n report,\n utils,\n}) => {\n const {\n allowExtraTrailingParamDocs,\n checkDestructured = true,\n checkRestProperty = false,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n disableExtraPropertyReporting = false,\n disableMissingParamChecks = false,\n enableFixer = false,\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n // Although we might just remove global settings contexts from applying to\n // this rule (as they can cause problems with `getFunctionParameterNames`\n // checks if they are not functions but say variables), the user may\n // instead wish to narrow contexts in those settings, so this check\n // is still useful\n if (!allowedNodes.includes(/** @type {import('estree').Node} */ (node).type)) {\n return;\n }\n\n const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);\n\n const jsdocParameterNamesDeep = utils.getJsdocTagsDeep('param');\n if (!jsdocParameterNamesDeep || !jsdocParameterNamesDeep.length) {\n return;\n }\n\n const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties);\n\n const targetTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n const isError = validateParameterNames(\n targetTagName,\n allowExtraTrailingParamDocs,\n checkDestructured,\n checkRestProperty,\n checkTypesRegex,\n disableExtraPropertyReporting,\n disableMissingParamChecks,\n enableFixer,\n functionParameterNames,\n jsdoc,\n utils,\n report,\n );\n\n if (isError || !checkDestructured) {\n return;\n }\n\n validateParameterNamesDeep(\n targetTagName, allowExtraTrailingParamDocs, jsdocParameterNamesDeep, jsdoc, report,\n );\n}, {\n contextDefaults: allowedNodes,\n meta: {\n docs: {\n description: 'Ensures that parameter names in JSDoc match those in the function declaration.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-param-names.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowExtraTrailingParamDocs: {\n type: 'boolean',\n },\n checkDestructured: {\n type: 'boolean',\n },\n checkRestProperty: {\n type: 'boolean',\n },\n checkTypesPattern: {\n type: 'string',\n },\n disableExtraPropertyReporting: {\n type: 'boolean',\n },\n disableMissingParamChecks: {\n type: 'boolean',\n },\n enableFixer: {\n type: 'boolean',\n },\n useDefaultObjectProperties: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,sBAAsB,GAAGA,CAC7BC,aAAa,EACbC,2BAA2B,EAC3BC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,6BAA6B,EAC7BC,yBAAyB,EACzBC,WAAW,EACXC,sBAAsB,EAAEC,KAAK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,MAAA,CAAArB,OAAA,GAAAA,OAAA,CAAApG,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"checkParamNames.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","validateParameterNames","targetTagName","allowExtraTrailingParamDocs","checkDestructured","checkRestProperty","checkTypesRegex","disableExtraPropertyReporting","disableMissingParamChecks","enableFixer","functionParameterNames","jsdoc","utils","report","paramTags","Object","entries","tags","filter","tag","paramTagsNonNested","name","includes","dotted","thisOffset","some","index","tagsIndex","dupeTagInfo","find","tgsIndex","tg","idx","Number","reportJSDoc","removeTag","functionParameterName","trim","Array","isArray","actualName","expectedName","type","search","parameterName","annotationParamName","hasPropertyRest","names","properties","rests","undefined","tagName","expectedNames","map","actualNames","paramTag","actualTypes","missingProperties","notCheckingNames","notCheckingName","startsWith","actualNameIdx","findIndex","comparePaths","missingIndex","pathDoesNotBeginWith","line","source","number","length","push","tagPlacement","hasMissing","missingProperty","extraProperties","match","prop","split","extraProperty","funcParamName","item","usedExpectedNames","a","toString","usedInOrder","every","restElement","join","validateParameterNamesDeep","_allowExtraTrailingParamDocs","jsdocParameterNames","lastRealParameter","jsdocParameterName","isPropertyPath","pathRootNodeName","slice","indexOf","endsWith","allowedNodes","_default","exports","iterateJsdoc","context","node","checkTypesPattern","useDefaultObjectProperties","options","getRegexFromString","jsdocParameterNamesDeep","getJsdocTagsDeep","getFunctionParameterNames","getPreferredTagName","isError","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","module"],"sources":["../../src/rules/checkParamNames.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {string} targetTagName\n * @param {boolean} allowExtraTrailingParamDocs\n * @param {boolean} checkDestructured\n * @param {boolean} checkRestProperty\n * @param {RegExp} checkTypesRegex\n * @param {boolean} disableExtraPropertyReporting\n * @param {boolean} disableMissingParamChecks\n * @param {boolean} enableFixer\n * @param {import('../jsdocUtils.js').ParamNameInfo[]} functionParameterNames\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('../iterateJsdoc.js').Report} report\n * @returns {boolean}\n */\nconst validateParameterNames = (\n targetTagName,\n allowExtraTrailingParamDocs,\n checkDestructured,\n checkRestProperty,\n checkTypesRegex,\n disableExtraPropertyReporting,\n disableMissingParamChecks,\n enableFixer,\n functionParameterNames, jsdoc, utils, report,\n) => {\n const paramTags = Object.entries(jsdoc.tags).filter(([\n , tag,\n ]) => {\n return tag.tag === targetTagName;\n });\n const paramTagsNonNested = paramTags.filter(([\n , tag,\n ]) => {\n return !tag.name.includes('.');\n });\n\n let dotted = 0;\n let thisOffset = 0;\n\n // eslint-disable-next-line complexity\n return paramTags.some(([\n , tag,\n ], index) => {\n /** @type {import('../iterateJsdoc.js').Integer} */\n let tagsIndex;\n const dupeTagInfo = paramTags.find(([\n tgsIndex,\n tg,\n ], idx) => {\n tagsIndex = Number(tgsIndex);\n\n return tg.name === tag.name && idx !== index;\n });\n if (dupeTagInfo) {\n utils.reportJSDoc(`Duplicate @${targetTagName} \"${tag.name}\"`, dupeTagInfo[1], enableFixer ? () => {\n utils.removeTag(tagsIndex);\n } : null);\n\n return true;\n }\n\n if (tag.name.includes('.')) {\n dotted++;\n\n return false;\n }\n\n let functionParameterName = functionParameterNames[index - dotted + thisOffset];\n if (functionParameterName === 'this' && tag.name.trim() !== 'this') {\n ++thisOffset;\n functionParameterName = functionParameterNames[index - dotted + thisOffset];\n }\n\n if (!functionParameterName) {\n if (allowExtraTrailingParamDocs) {\n return false;\n }\n\n report(\n `@${targetTagName} \"${tag.name}\" does not match an existing function parameter.`,\n null,\n tag,\n );\n\n return true;\n }\n\n if (\n typeof functionParameterName === 'object' &&\n 'name' in functionParameterName &&\n Array.isArray(functionParameterName.name)\n ) {\n const actualName = tag.name.trim();\n const expectedName = functionParameterName.name[index];\n if (actualName === expectedName) {\n thisOffset--;\n return false;\n }\n\n report(\n `Expected @${targetTagName} name to be \"${expectedName}\". Got \"${actualName}\".`,\n null,\n tag,\n );\n return true;\n }\n\n if (Array.isArray(functionParameterName)) {\n if (!checkDestructured) {\n return false;\n }\n\n if (tag.type && tag.type.search(checkTypesRegex) === -1) {\n return false;\n }\n\n const [\n parameterName,\n {\n annotationParamName,\n hasPropertyRest,\n names: properties,\n rests,\n },\n ] =\n /**\n * @type {[string | undefined, import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string | undefined;\n }]} */ (functionParameterName);\n if (annotationParamName !== undefined) {\n const name = tag.name.trim();\n if (name !== annotationParamName) {\n report(`@${targetTagName} \"${name}\" does not match parameter name \"${annotationParamName}\"`, null, tag);\n }\n }\n\n const tagName = parameterName === undefined ? tag.name.trim() : parameterName;\n const expectedNames = properties.map((name) => {\n return `${tagName}.${name}`;\n });\n const actualNames = paramTags.map(([\n , paramTag,\n ]) => {\n return paramTag.name.trim();\n });\n const actualTypes = paramTags.map(([\n , paramTag,\n ]) => {\n return paramTag.type;\n });\n\n const missingProperties = [];\n\n /** @type {string[]} */\n const notCheckingNames = [];\n\n for (const [\n idx,\n name,\n ] of expectedNames.entries()) {\n if (notCheckingNames.some((notCheckingName) => {\n return name.startsWith(notCheckingName);\n })) {\n continue;\n }\n\n const actualNameIdx = actualNames.findIndex((actualName) => {\n return utils.comparePaths(name)(actualName);\n });\n if (actualNameIdx === -1) {\n if (!checkRestProperty && rests[idx]) {\n continue;\n }\n\n const missingIndex = actualNames.findIndex((actualName) => {\n return utils.pathDoesNotBeginWith(name, actualName);\n });\n const line = tag.source[0].number - 1 + (missingIndex > -1 ? missingIndex : actualNames.length);\n missingProperties.push({\n name,\n tagPlacement: {\n line: line === 0 ? 1 : line,\n },\n });\n } else if (actualTypes[actualNameIdx].search(checkTypesRegex) === -1 && actualTypes[actualNameIdx] !== '') {\n notCheckingNames.push(name);\n }\n }\n\n const hasMissing = missingProperties.length;\n if (hasMissing) {\n for (const {\n name: missingProperty,\n tagPlacement,\n } of missingProperties) {\n report(`Missing @${targetTagName} \"${missingProperty}\"`, null, tagPlacement);\n }\n }\n\n if (!hasPropertyRest || checkRestProperty) {\n /** @type {[string, import('comment-parser').Spec][]} */\n const extraProperties = [];\n for (const [\n idx,\n name,\n ] of actualNames.entries()) {\n const match = name.startsWith(tag.name.trim() + '.');\n if (\n match && !expectedNames.some(\n utils.comparePaths(name),\n ) && !utils.comparePaths(name)(tag.name) &&\n (!disableExtraPropertyReporting || properties.some((prop) => {\n return prop.split('.').length >= name.split('.').length - 1;\n }))\n ) {\n extraProperties.push([\n name, paramTags[idx][1],\n ]);\n }\n }\n\n if (extraProperties.length) {\n for (const [\n extraProperty,\n tg,\n ] of extraProperties) {\n report(`@${targetTagName} \"${extraProperty}\" does not exist on ${tag.name}`, null, tg);\n }\n\n return true;\n }\n }\n\n return hasMissing;\n }\n\n let funcParamName;\n if (typeof functionParameterName === 'object') {\n const {\n name,\n } = functionParameterName;\n funcParamName = name;\n } else {\n funcParamName = functionParameterName;\n }\n\n if (funcParamName !== tag.name.trim()) {\n // Todo: Improve for array or object child items\n const actualNames = paramTagsNonNested.map(([\n , {\n name,\n },\n ]) => {\n return name.trim();\n });\n\n const expectedNames = functionParameterNames.map((item, idx) => {\n if (/**\n * @type {[string|undefined, (import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string,\n })]} */ (item)?.[1]?.names) {\n return actualNames[idx];\n }\n\n return item;\n }).filter((item) => {\n return item !== 'this';\n });\n\n // When disableMissingParamChecks is true tag names can be omitted.\n // Report when the tag names do not match the expected names or they are used out of order.\n if (disableMissingParamChecks) {\n const usedExpectedNames = expectedNames.map((a) => {\n return a?.toString();\n }).filter((expectedName) => {\n return expectedName && actualNames.includes(expectedName);\n });\n const usedInOrder = actualNames.every((actualName, idx) => {\n return actualName === usedExpectedNames[idx];\n });\n if (usedInOrder) {\n return false;\n }\n }\n\n report(\n `Expected @${targetTagName} names to be \"${\n expectedNames.map((expectedName) => {\n return typeof expectedName === 'object' &&\n 'name' in expectedName &&\n expectedName.restElement ?\n '...' + expectedName.name :\n expectedName;\n }).join(', ')\n }\". Got \"${actualNames.join(', ')}\".`,\n null,\n tag,\n );\n\n return true;\n }\n\n return false;\n });\n};\n\n/**\n * @param {string} targetTagName\n * @param {boolean} _allowExtraTrailingParamDocs\n * @param {{\n * name: string,\n * idx: import('../iterateJsdoc.js').Integer\n * }[]} jsdocParameterNames\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Report} report\n * @returns {boolean}\n */\nconst validateParameterNamesDeep = (\n targetTagName, _allowExtraTrailingParamDocs,\n jsdocParameterNames, jsdoc, report,\n) => {\n /** @type {string} */\n let lastRealParameter;\n\n return jsdocParameterNames.some(({\n idx,\n name: jsdocParameterName,\n }) => {\n const isPropertyPath = jsdocParameterName.includes('.');\n\n if (isPropertyPath) {\n if (!lastRealParameter) {\n report(`@${targetTagName} path declaration (\"${jsdocParameterName}\") appears before any real parameter.`, null, jsdoc.tags[idx]);\n\n return true;\n }\n\n let pathRootNodeName = jsdocParameterName.slice(0, jsdocParameterName.indexOf('.'));\n\n if (pathRootNodeName.endsWith('[]')) {\n pathRootNodeName = pathRootNodeName.slice(0, -2);\n }\n\n if (pathRootNodeName !== lastRealParameter) {\n report(\n `@${targetTagName} path declaration (\"${jsdocParameterName}\") root node name (\"${pathRootNodeName}\") ` +\n `does not match previous real parameter name (\"${lastRealParameter}\").`,\n null,\n jsdoc.tags[idx],\n );\n\n return true;\n }\n } else {\n lastRealParameter = jsdocParameterName;\n }\n\n return false;\n });\n};\n\nconst allowedNodes = [\n 'ArrowFunctionExpression', 'FunctionDeclaration', 'FunctionExpression', 'TSDeclareFunction',\n // Add this to above defaults\n 'TSMethodSignature',\n];\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n node,\n report,\n utils,\n}) => {\n const {\n allowExtraTrailingParamDocs,\n checkDestructured = true,\n checkRestProperty = false,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n disableExtraPropertyReporting = false,\n disableMissingParamChecks = false,\n enableFixer = false,\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n // Although we might just remove global settings contexts from applying to\n // this rule (as they can cause problems with `getFunctionParameterNames`\n // checks if they are not functions but say variables), the user may\n // instead wish to narrow contexts in those settings, so this check\n // is still useful\n if (!allowedNodes.includes(/** @type {import('estree').Node} */ (node).type)) {\n return;\n }\n\n const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);\n\n const jsdocParameterNamesDeep = utils.getJsdocTagsDeep('param');\n if (!jsdocParameterNamesDeep || !jsdocParameterNamesDeep.length) {\n return;\n }\n\n const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties);\n\n const targetTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n const isError = validateParameterNames(\n targetTagName,\n allowExtraTrailingParamDocs,\n checkDestructured,\n checkRestProperty,\n checkTypesRegex,\n disableExtraPropertyReporting,\n disableMissingParamChecks,\n enableFixer,\n functionParameterNames,\n jsdoc,\n utils,\n report,\n );\n\n if (isError || !checkDestructured) {\n return;\n }\n\n validateParameterNamesDeep(\n targetTagName, allowExtraTrailingParamDocs, jsdocParameterNamesDeep, jsdoc, report,\n );\n}, {\n contextDefaults: allowedNodes,\n meta: {\n docs: {\n description: 'Checks for dupe `@param` names, that nested param names have roots, and that parameter names in function declarations match JSDoc param names.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-param-names.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowExtraTrailingParamDocs: {\n description: `If set to \\`true\\`, this option will allow extra \\`@param\\` definitions (e.g.,\nrepresenting future expected or virtual params) to be present without needing\ntheir presence within the function signature. Other inconsistencies between\n\\`@param\\`'s and present function parameters will still be reported.`,\n type: 'boolean',\n },\n checkDestructured: {\n description: 'Whether to check destructured properties. Defaults to `true`.',\n type: 'boolean',\n },\n checkRestProperty: {\n description: `If set to \\`true\\`, will require that rest properties are documented and\nthat any extraneous properties (which may have been within the rest property)\nare documented. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n checkTypesPattern: {\n description: `Defines a regular expression pattern to indicate which types should be\nchecked for destructured content (and that those not matched should not\nbe checked).\n\nWhen one specifies a type, unless it is of a generic type, like \\`object\\`\nor \\`array\\`, it may be considered unnecessary to have that object's\ndestructured components required, especially where generated docs will\nlink back to the specified type. For example:\n\n\\`\\`\\`js\n/**\n * @param {SVGRect} bbox - a SVGRect\n */\nexport const bboxToObj = function ({x, y, width, height}) {\n return {x, y, width, height};\n};\n\\`\\`\\`\n\nBy default \\`checkTypesPattern\\` is set to\n\\`/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/v\\`,\nmeaning that destructuring will be required only if the type of the \\`@param\\`\n(the text between curly brackets) is a match for \"Object\" or \"Array\" (with or\nwithout initial caps), \"PlainObject\", or \"GenericObject\", \"GenericArray\" (or\nif no type is present). So in the above example, the lack of a match will\nmean that no complaint will be given about the undocumented destructured\nparameters.\n\nNote that the \\`/\\` delimiters are optional, but necessary to add flags.\n\nDefaults to using (only) the \\`v\\` flag, so to add your own flags, encapsulate\nyour expression as a string, but like a literal, e.g., \\`/^object$/vi\\`.\n\nYou could set this regular expression to a more expansive list, or you\ncould restrict it such that even types matching those strings would not\nneed destructuring.`,\n type: 'string',\n },\n disableExtraPropertyReporting: {\n description: `Whether to check for extra destructured properties. Defaults to \\`false\\`. Change\nto \\`true\\` if you want to be able to document properties which are not actually\ndestructured. Keep as \\`false\\` if you expect properties to be documented in\ntheir own types. Note that extra properties will always be reported if another\nitem at the same level is destructured as destructuring will prevent other\naccess and this option is only intended to permit documenting extra properties\nthat are available and actually used in the function.`,\n type: 'boolean',\n },\n disableMissingParamChecks: {\n description: 'Whether to avoid checks for missing `@param` definitions. Defaults to `false`. Change to `true` if you want to be able to omit properties.',\n type: 'boolean',\n },\n enableFixer: {\n description: `Set to \\`true\\` to auto-remove \\`@param\\` duplicates (based on identical\nnames).\n\nNote that this option will remove duplicates of the same name even if\nthe definitions do not match in other ways (e.g., the second param will\nbe removed even if it has a different type or description).`,\n type: 'boolean',\n },\n useDefaultObjectProperties: {\n description: `Set to \\`true\\` if you wish to avoid reporting of child property documentation\nwhere instead of destructuring, a whole plain object is supplied as default\nvalue but you wish its keys to be considered as signalling that the properties\nare present and can therefore be documented. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,sBAAsB,GAAGA,CAC7BC,aAAa,EACbC,2BAA2B,EAC3BC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,6BAA6B,EAC7BC,yBAAyB,EACzBC,WAAW,EACXC,sBAAsB,EAAEC,KAAK,EAAEC,KAAK,EAAEC,MAAM,KACzC;EACH,MAAMC,SAAS,GAAGC,MAAM,CAACC,OAAO,CAACL,KAAK,CAACM,IAAI,CAAC,CAACC,MAAM,CAAC,CAAC,GACjDC,GAAG,CACN,KAAK;IACJ,OAAOA,GAAG,CAACA,GAAG,KAAKjB,aAAa;EAClC,CAAC,CAAC;EACF,MAAMkB,kBAAkB,GAAGN,SAAS,CAACI,MAAM,CAAC,CAAC,GACzCC,GAAG,CACN,KAAK;IACJ,OAAO,CAACA,GAAG,CAACE,IAAI,CAACC,QAAQ,CAAC,GAAG,CAAC;EAChC,CAAC,CAAC;EAEF,IAAIC,MAAM,GAAG,CAAC;EACd,IAAIC,UAAU,GAAG,CAAC;;EAElB;EACA,OAAOV,SAAS,CAACW,IAAI,CAAC,CAAC,G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AA,CAAArB,OAAA,GAAAA,OAAA,CAAApG,OAAA","ignoreList":[]}
|
|
@@ -104,6 +104,12 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
104
104
|
additionalProperties: false,
|
|
105
105
|
properties: {
|
|
106
106
|
enableFixer: {
|
|
107
|
+
description: `Set to \`true\` to auto-remove \`@property\` duplicates (based on
|
|
108
|
+
identical names).
|
|
109
|
+
|
|
110
|
+
Note that this option will remove duplicates of the same name even if
|
|
111
|
+
the definitions do not match in other ways (e.g., the second property will
|
|
112
|
+
be removed even if it has a different type or description).`,
|
|
107
113
|
type: 'boolean'
|
|
108
114
|
}
|
|
109
115
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkPropertyNames.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","validatePropertyNames","targetTagName","enableFixer","jsdoc","utils","propertyTags","Object","entries","tags","filter","tag","some","index","tagsIndex","dupeTagInfo","find","tgsIndex","tg","idx","Number","name","reportJSDoc","removeTag","validatePropertyNamesDeep","jsdocPropertyNames","report","lastRealProperty","jsdocPropertyName","isPropertyPath","includes","pathRootNodeName","slice","indexOf","endsWith","_default","exports","iterateJsdoc","context","options","jsdocPropertyNamesDeep","getJsdocTagsDeep","length","getPreferredTagName","tagName","isError","iterateAllJsdocs","meta","docs","description","url","fixable","schema","additionalProperties","properties","type","module"],"sources":["../../src/rules/checkPropertyNames.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {string} targetTagName\n * @param {boolean} enableFixer\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @returns {boolean}\n */\nconst validatePropertyNames = (\n targetTagName,\n enableFixer,\n jsdoc, utils,\n) => {\n const propertyTags = Object.entries(jsdoc.tags).filter(([\n , tag,\n ]) => {\n return tag.tag === targetTagName;\n });\n\n return propertyTags.some(([\n , tag,\n ], index) => {\n /** @type {import('../iterateJsdoc.js').Integer} */\n let tagsIndex;\n const dupeTagInfo = propertyTags.find(([\n tgsIndex,\n tg,\n ], idx) => {\n tagsIndex = Number(tgsIndex);\n\n return tg.name === tag.name && idx !== index;\n });\n if (dupeTagInfo) {\n utils.reportJSDoc(`Duplicate @${targetTagName} \"${tag.name}\"`, dupeTagInfo[1], enableFixer ? () => {\n utils.removeTag(tagsIndex);\n } : null);\n\n return true;\n }\n\n return false;\n });\n};\n\n/**\n * @param {string} targetTagName\n * @param {{\n * idx: number;\n * name: string;\n * type: string;\n * }[]} jsdocPropertyNames\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Report} report\n */\nconst validatePropertyNamesDeep = (\n targetTagName,\n jsdocPropertyNames, jsdoc, report,\n) => {\n /** @type {string} */\n let lastRealProperty;\n\n return jsdocPropertyNames.some(({\n idx,\n name: jsdocPropertyName,\n }) => {\n const isPropertyPath = jsdocPropertyName.includes('.');\n\n if (isPropertyPath) {\n if (!lastRealProperty) {\n report(`@${targetTagName} path declaration (\"${jsdocPropertyName}\") appears before any real property.`, null, jsdoc.tags[idx]);\n\n return true;\n }\n\n let pathRootNodeName = jsdocPropertyName.slice(0, jsdocPropertyName.indexOf('.'));\n\n if (pathRootNodeName.endsWith('[]')) {\n pathRootNodeName = pathRootNodeName.slice(0, -2);\n }\n\n if (pathRootNodeName !== lastRealProperty) {\n report(\n `@${targetTagName} path declaration (\"${jsdocPropertyName}\") root node name (\"${pathRootNodeName}\") ` +\n `does not match previous real property name (\"${lastRealProperty}\").`,\n null,\n jsdoc.tags[idx],\n );\n\n return true;\n }\n } else {\n lastRealProperty = jsdocPropertyName;\n }\n\n return false;\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n utils,\n}) => {\n const {\n enableFixer = false,\n } = context.options[0] || {};\n const jsdocPropertyNamesDeep = utils.getJsdocTagsDeep('property');\n if (!jsdocPropertyNamesDeep || !jsdocPropertyNamesDeep.length) {\n return;\n }\n\n const targetTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'property',\n }));\n const isError = validatePropertyNames(\n targetTagName,\n enableFixer,\n jsdoc,\n utils,\n );\n\n if (isError) {\n return;\n }\n\n validatePropertyNamesDeep(\n targetTagName, jsdocPropertyNamesDeep, jsdoc, report,\n );\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Ensures that property names in JSDoc are not duplicated on the same block and that nested properties have defined roots.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-property-names.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,qBAAqB,GAAGA,CAC5BC,aAAa,EACbC,WAAW,EACXC,KAAK,EAAEC,KAAK,KACT;EACH,MAAMC,YAAY,GAAGC,MAAM,CAACC,OAAO,CAACJ,KAAK,CAACK,IAAI,CAAC,CAACC,MAAM,CAAC,CAAC,GACpDC,GAAG,CACN,KAAK;IACJ,OAAOA,GAAG,CAACA,GAAG,KAAKT,aAAa;EAClC,CAAC,CAAC;EAEF,OAAOI,YAAY,CAACM,IAAI,CAAC,CAAC,GACtBD,GAAG,CACN,EAAEE,KAAK,KAAK;IACX;IACA,IAAIC,SAAS;IACb,MAAMC,WAAW,GAAGT,YAAY,CAACU,IAAI,CAAC,CAAC,CACrCC,QAAQ,EACRC,EAAE,CACH,EAAEC,GAAG,KAAK;MACTL,SAAS,GAAGM,MAAM,CAACH,QAAQ,CAAC;MAE5B,OAAOC,EAAE,CAACG,IAAI,KAAKV,GAAG,CAAC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file":"checkPropertyNames.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","validatePropertyNames","targetTagName","enableFixer","jsdoc","utils","propertyTags","Object","entries","tags","filter","tag","some","index","tagsIndex","dupeTagInfo","find","tgsIndex","tg","idx","Number","name","reportJSDoc","removeTag","validatePropertyNamesDeep","jsdocPropertyNames","report","lastRealProperty","jsdocPropertyName","isPropertyPath","includes","pathRootNodeName","slice","indexOf","endsWith","_default","exports","iterateJsdoc","context","options","jsdocPropertyNamesDeep","getJsdocTagsDeep","length","getPreferredTagName","tagName","isError","iterateAllJsdocs","meta","docs","description","url","fixable","schema","additionalProperties","properties","type","module"],"sources":["../../src/rules/checkPropertyNames.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {string} targetTagName\n * @param {boolean} enableFixer\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @returns {boolean}\n */\nconst validatePropertyNames = (\n targetTagName,\n enableFixer,\n jsdoc, utils,\n) => {\n const propertyTags = Object.entries(jsdoc.tags).filter(([\n , tag,\n ]) => {\n return tag.tag === targetTagName;\n });\n\n return propertyTags.some(([\n , tag,\n ], index) => {\n /** @type {import('../iterateJsdoc.js').Integer} */\n let tagsIndex;\n const dupeTagInfo = propertyTags.find(([\n tgsIndex,\n tg,\n ], idx) => {\n tagsIndex = Number(tgsIndex);\n\n return tg.name === tag.name && idx !== index;\n });\n if (dupeTagInfo) {\n utils.reportJSDoc(`Duplicate @${targetTagName} \"${tag.name}\"`, dupeTagInfo[1], enableFixer ? () => {\n utils.removeTag(tagsIndex);\n } : null);\n\n return true;\n }\n\n return false;\n });\n};\n\n/**\n * @param {string} targetTagName\n * @param {{\n * idx: number;\n * name: string;\n * type: string;\n * }[]} jsdocPropertyNames\n * @param {import('comment-parser').Block} jsdoc\n * @param {import('../iterateJsdoc.js').Report} report\n */\nconst validatePropertyNamesDeep = (\n targetTagName,\n jsdocPropertyNames, jsdoc, report,\n) => {\n /** @type {string} */\n let lastRealProperty;\n\n return jsdocPropertyNames.some(({\n idx,\n name: jsdocPropertyName,\n }) => {\n const isPropertyPath = jsdocPropertyName.includes('.');\n\n if (isPropertyPath) {\n if (!lastRealProperty) {\n report(`@${targetTagName} path declaration (\"${jsdocPropertyName}\") appears before any real property.`, null, jsdoc.tags[idx]);\n\n return true;\n }\n\n let pathRootNodeName = jsdocPropertyName.slice(0, jsdocPropertyName.indexOf('.'));\n\n if (pathRootNodeName.endsWith('[]')) {\n pathRootNodeName = pathRootNodeName.slice(0, -2);\n }\n\n if (pathRootNodeName !== lastRealProperty) {\n report(\n `@${targetTagName} path declaration (\"${jsdocPropertyName}\") root node name (\"${pathRootNodeName}\") ` +\n `does not match previous real property name (\"${lastRealProperty}\").`,\n null,\n jsdoc.tags[idx],\n );\n\n return true;\n }\n } else {\n lastRealProperty = jsdocPropertyName;\n }\n\n return false;\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n utils,\n}) => {\n const {\n enableFixer = false,\n } = context.options[0] || {};\n const jsdocPropertyNamesDeep = utils.getJsdocTagsDeep('property');\n if (!jsdocPropertyNamesDeep || !jsdocPropertyNamesDeep.length) {\n return;\n }\n\n const targetTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'property',\n }));\n const isError = validatePropertyNames(\n targetTagName,\n enableFixer,\n jsdoc,\n utils,\n );\n\n if (isError) {\n return;\n }\n\n validatePropertyNamesDeep(\n targetTagName, jsdocPropertyNamesDeep, jsdoc, report,\n );\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Ensures that property names in JSDoc are not duplicated on the same block and that nested properties have defined roots.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-property-names.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n description: `Set to \\`true\\` to auto-remove \\`@property\\` duplicates (based on\nidentical names).\n\nNote that this option will remove duplicates of the same name even if\nthe definitions do not match in other ways (e.g., the second property will\nbe removed even if it has a different type or description).`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,qBAAqB,GAAGA,CAC5BC,aAAa,EACbC,WAAW,EACXC,KAAK,EAAEC,KAAK,KACT;EACH,MAAMC,YAAY,GAAGC,MAAM,CAACC,OAAO,CAACJ,KAAK,CAACK,IAAI,CAAC,CAACC,MAAM,CAAC,CAAC,GACpDC,GAAG,CACN,KAAK;IACJ,OAAOA,GAAG,CAACA,GAAG,KAAKT,aAAa;EAClC,CAAC,CAAC;EAEF,OAAOI,YAAY,CAACM,IAAI,CAAC,CAAC,GACtBD,GAAG,CACN,EAAEE,KAAK,KAAK;IACX;IACA,IAAIC,SAAS;IACb,MAAMC,WAAW,GAAGT,YAAY,CAACU,IAAI,CAAC,CAAC,CACrCC,QAAQ,EACRC,EAAE,CACH,EAAEC,GAAG,KAAK;MACTL,SAAS,GAAGM,MAAM,CAACH,QAAQ,CAAC;MAE5B,OAAOC,EAAE,CAACG,IAAI,KAAKV,GAAG,CAACU,IAAI,IAAIF,GAAG,KAAKN,KAAK;IAC9C,CAAC,CAAC;IACF,IAAIE,WAAW,EAAE;MACfV,KAAK,CAACiB,WAAW,CAAC,cAAcpB,aAAa,KAAKS,GAAG,CAACU,IAAI,GAAG,EAAEN,WAAW,CAAC,CAAC,CAAC,EAAEZ,WAAW,GAAG,MAAM;QACjGE,KAAK,CAACkB,SAAS,CAACT,SAAS,CAAC;MAC5B,CAAC,GAAG,IAAI,CAAC;MAET,OAAO,IAAI;IACb;IAEA,OAAO,KAAK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C,CAAC;EAC3BC,OAAO;EACPlC,KAAK;EACLsB,MAAM;EACNrB;AACF,CAAC,KAAK;EACJ,MAAM;IACJF,WAAW,GAAG;EAChB,CAAC,GAAGmC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAC5B,MAAMC,sBAAsB,GAAGnC,KAAK,CAACoC,gBAAgB,CAAC,UAAU,CAAC;EACjE,IAAI,CAACD,sBAAsB,IAAI,CAACA,sBAAsB,CAACE,MAAM,EAAE;IAC7D;EACF;EAEA,MAAMxC,aAAa,GAAG,qBAAuBG,KAAK,CAACsC,mBAAmB,CAAC;IACrEC,OAAO,EAAE;EACX,CAAC,CAAE;EACH,MAAMC,OAAO,GAAG5C,qBAAqB,CACnCC,aAAa,EACbC,WAAW,EACXC,KAAK,EACLC,KACF,CAAC;EAED,IAAIwC,OAAO,EAAE;IACX;EACF;EAEArB,yBAAyB,CACvBtB,aAAa,EAAEsC,sBAAsB,EAAEpC,KAAK,EAAEsB,MAChD,CAAC;AACH,CAAC,EAAE;EACDoB,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,0HAA0H;MACvIC,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVnD,WAAW,EAAE;UACX8C,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,4DAA4D;UAChDM,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,MAAA,CAAApB,OAAA,GAAAA,OAAA,CAAApC,OAAA","ignoreList":[]}
|
|
@@ -190,18 +190,89 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
190
190
|
additionalProperties: false,
|
|
191
191
|
properties: {
|
|
192
192
|
definedTags: {
|
|
193
|
+
description: `Use an array of \`definedTags\` strings to configure additional, allowed tags.
|
|
194
|
+
The format is as follows:
|
|
195
|
+
|
|
196
|
+
\`\`\`json
|
|
197
|
+
{
|
|
198
|
+
"definedTags": ["note", "record"]
|
|
199
|
+
}
|
|
200
|
+
\`\`\``,
|
|
193
201
|
items: {
|
|
194
202
|
type: 'string'
|
|
195
203
|
},
|
|
196
204
|
type: 'array'
|
|
197
205
|
},
|
|
198
206
|
enableFixer: {
|
|
207
|
+
description: 'Set to `false` to disable auto-removal of types that are redundant with the [`typed` option](#typed).',
|
|
199
208
|
type: 'boolean'
|
|
200
209
|
},
|
|
201
210
|
jsxTags: {
|
|
211
|
+
description: `If this is set to \`true\`, all of the following tags used to control JSX output are allowed:
|
|
212
|
+
|
|
213
|
+
\`\`\`
|
|
214
|
+
jsx
|
|
215
|
+
jsxFrag
|
|
216
|
+
jsxImportSource
|
|
217
|
+
jsxRuntime
|
|
218
|
+
\`\`\`
|
|
219
|
+
|
|
220
|
+
For more information, see the [babel documentation](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx).`,
|
|
202
221
|
type: 'boolean'
|
|
203
222
|
},
|
|
204
223
|
typed: {
|
|
224
|
+
description: `If this is set to \`true\`, additionally checks for tag names that are redundant when using a type checker such as TypeScript.
|
|
225
|
+
|
|
226
|
+
These tags are always unnecessary when using TypeScript or similar:
|
|
227
|
+
|
|
228
|
+
\`\`\`
|
|
229
|
+
augments
|
|
230
|
+
callback
|
|
231
|
+
class
|
|
232
|
+
enum
|
|
233
|
+
implements
|
|
234
|
+
private
|
|
235
|
+
property
|
|
236
|
+
protected
|
|
237
|
+
public
|
|
238
|
+
readonly
|
|
239
|
+
this
|
|
240
|
+
type
|
|
241
|
+
typedef
|
|
242
|
+
\`\`\`
|
|
243
|
+
|
|
244
|
+
These tags are unnecessary except when inside a TypeScript \`declare\` context:
|
|
245
|
+
|
|
246
|
+
\`\`\`
|
|
247
|
+
abstract
|
|
248
|
+
access
|
|
249
|
+
class
|
|
250
|
+
constant
|
|
251
|
+
constructs
|
|
252
|
+
default
|
|
253
|
+
enum
|
|
254
|
+
export
|
|
255
|
+
exports
|
|
256
|
+
function
|
|
257
|
+
global
|
|
258
|
+
inherits
|
|
259
|
+
instance
|
|
260
|
+
interface
|
|
261
|
+
member
|
|
262
|
+
memberof
|
|
263
|
+
memberOf
|
|
264
|
+
method
|
|
265
|
+
mixes
|
|
266
|
+
mixin
|
|
267
|
+
module
|
|
268
|
+
name
|
|
269
|
+
namespace
|
|
270
|
+
override
|
|
271
|
+
property
|
|
272
|
+
requires
|
|
273
|
+
static
|
|
274
|
+
this
|
|
275
|
+
\`\`\``,
|
|
205
276
|
type: 'boolean'
|
|
206
277
|
}
|
|
207
278
|
},
|