eslint-plugin-jsdoc 63.0.9 → 63.0.11

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.
Files changed (174) hide show
  1. package/dist/WarnSettings.cjs +1 -8
  2. package/dist/WarnSettings.cjs.map +1 -1
  3. package/dist/alignTransform.cjs +6 -10
  4. package/dist/alignTransform.cjs.map +1 -1
  5. package/dist/buildForbidRuleDefinition.cjs +3 -10
  6. package/dist/buildForbidRuleDefinition.cjs.map +1 -1
  7. package/dist/buildRejectOrPreferRuleDefinition.cjs +7 -14
  8. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
  9. package/dist/defaultTagOrder.cjs +1 -8
  10. package/dist/defaultTagOrder.cjs.map +1 -1
  11. package/dist/exportParser.cjs +6 -14
  12. package/dist/exportParser.cjs.map +1 -1
  13. package/dist/generateDocs.cjs +36 -44
  14. package/dist/generateDocs.cjs.map +1 -1
  15. package/dist/generateOptions.cjs +15 -18
  16. package/dist/generateOptions.cjs.map +1 -1
  17. package/dist/generateRule.cjs +24 -24
  18. package/dist/generateRule.cjs.map +1 -1
  19. package/dist/generateRuleTypes.cjs +6 -9
  20. package/dist/generateRuleTypes.cjs.map +1 -1
  21. package/dist/getDefaultTagStructureForMode.cjs +1 -8
  22. package/dist/getDefaultTagStructureForMode.cjs.map +1 -1
  23. package/dist/getJsdocProcessorPlugin.cjs +20 -28
  24. package/dist/getJsdocProcessorPlugin.cjs.map +1 -1
  25. package/dist/index-cjs.cjs +152 -159
  26. package/dist/index-cjs.cjs.map +1 -1
  27. package/dist/index-esm.cjs +16 -27
  28. package/dist/index-esm.cjs.map +1 -1
  29. package/dist/index.cjs +159 -172
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/iterateJsdoc.cjs +22 -32
  32. package/dist/iterateJsdoc.cjs.map +1 -1
  33. package/dist/jsdocUtils.cjs +18 -86
  34. package/dist/jsdocUtils.cjs.map +1 -1
  35. package/dist/rules/checkAccess.cjs +2 -10
  36. package/dist/rules/checkAccess.cjs.map +1 -1
  37. package/dist/rules/checkAlignment.cjs +2 -10
  38. package/dist/rules/checkAlignment.cjs.map +1 -1
  39. package/dist/rules/checkExamples.cjs +6 -15
  40. package/dist/rules/checkExamples.cjs.map +1 -1
  41. package/dist/rules/checkIndentation.cjs +2 -9
  42. package/dist/rules/checkIndentation.cjs.map +1 -1
  43. package/dist/rules/checkLineAlignment.cjs +6 -14
  44. package/dist/rules/checkLineAlignment.cjs.map +1 -1
  45. package/dist/rules/checkParamNames.cjs +2 -9
  46. package/dist/rules/checkParamNames.cjs.map +1 -1
  47. package/dist/rules/checkPropertyNames.cjs +2 -9
  48. package/dist/rules/checkPropertyNames.cjs.map +1 -1
  49. package/dist/rules/checkSyntax.cjs +2 -10
  50. package/dist/rules/checkSyntax.cjs.map +1 -1
  51. package/dist/rules/checkTagNames.cjs +4 -11
  52. package/dist/rules/checkTagNames.cjs.map +1 -1
  53. package/dist/rules/checkTemplateNames.cjs +12 -21
  54. package/dist/rules/checkTemplateNames.cjs.map +1 -1
  55. package/dist/rules/checkTypes.cjs +4 -10
  56. package/dist/rules/checkTypes.cjs.map +1 -1
  57. package/dist/rules/checkValues.cjs +9 -17
  58. package/dist/rules/checkValues.cjs.map +1 -1
  59. package/dist/rules/convertToJsdocComments.cjs +13 -19
  60. package/dist/rules/convertToJsdocComments.cjs.map +1 -1
  61. package/dist/rules/emptyTags.cjs +2 -10
  62. package/dist/rules/emptyTags.cjs.map +1 -1
  63. package/dist/rules/escapeInlineTags.cjs +96 -42
  64. package/dist/rules/escapeInlineTags.cjs.map +1 -1
  65. package/dist/rules/implementsOnClasses.cjs +2 -10
  66. package/dist/rules/implementsOnClasses.cjs.map +1 -1
  67. package/dist/rules/importsAsDependencies.cjs +12 -20
  68. package/dist/rules/importsAsDependencies.cjs.map +1 -1
  69. package/dist/rules/informativeDocs.cjs +4 -12
  70. package/dist/rules/informativeDocs.cjs.map +1 -1
  71. package/dist/rules/linesBeforeBlock.cjs +2 -9
  72. package/dist/rules/linesBeforeBlock.cjs.map +1 -1
  73. package/dist/rules/matchDescription.cjs +2 -9
  74. package/dist/rules/matchDescription.cjs.map +1 -1
  75. package/dist/rules/matchName.cjs +2 -10
  76. package/dist/rules/matchName.cjs.map +1 -1
  77. package/dist/rules/multilineBlocks.cjs +2 -9
  78. package/dist/rules/multilineBlocks.cjs.map +1 -1
  79. package/dist/rules/noBadBlocks.cjs +4 -11
  80. package/dist/rules/noBadBlocks.cjs.map +1 -1
  81. package/dist/rules/noBlankBlockDescriptions.cjs +2 -10
  82. package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
  83. package/dist/rules/noBlankBlocks.cjs +2 -10
  84. package/dist/rules/noBlankBlocks.cjs.map +1 -1
  85. package/dist/rules/noDefaults.cjs +2 -10
  86. package/dist/rules/noDefaults.cjs.map +1 -1
  87. package/dist/rules/noMissingSyntax.cjs +2 -9
  88. package/dist/rules/noMissingSyntax.cjs.map +1 -1
  89. package/dist/rules/noMultiAsterisks.cjs +2 -10
  90. package/dist/rules/noMultiAsterisks.cjs.map +1 -1
  91. package/dist/rules/noRestrictedSyntax.cjs +2 -9
  92. package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
  93. package/dist/rules/noTypes.cjs +2 -9
  94. package/dist/rules/noTypes.cjs.map +1 -1
  95. package/dist/rules/noUndefinedTypes.cjs +13 -21
  96. package/dist/rules/noUndefinedTypes.cjs.map +1 -1
  97. package/dist/rules/preferImportTag.cjs +21 -28
  98. package/dist/rules/preferImportTag.cjs.map +1 -1
  99. package/dist/rules/requireAsteriskPrefix.cjs +2 -10
  100. package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
  101. package/dist/rules/requireDescription.cjs +2 -9
  102. package/dist/rules/requireDescription.cjs.map +1 -1
  103. package/dist/rules/requireDescriptionCompleteSentence.cjs +7 -15
  104. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
  105. package/dist/rules/requireExample.cjs +2 -10
  106. package/dist/rules/requireExample.cjs.map +1 -1
  107. package/dist/rules/requireFileOverview.cjs +2 -10
  108. package/dist/rules/requireFileOverview.cjs.map +1 -1
  109. package/dist/rules/requireHyphenBeforeParamDescription.cjs +2 -10
  110. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
  111. package/dist/rules/requireJsdoc.cjs +17 -25
  112. package/dist/rules/requireJsdoc.cjs.map +1 -1
  113. package/dist/rules/requireParam.cjs +2 -9
  114. package/dist/rules/requireParam.cjs.map +1 -1
  115. package/dist/rules/requireParamDescription.cjs +2 -10
  116. package/dist/rules/requireParamDescription.cjs.map +1 -1
  117. package/dist/rules/requireParamName.cjs +2 -10
  118. package/dist/rules/requireParamName.cjs.map +1 -1
  119. package/dist/rules/requireParamType.cjs +2 -10
  120. package/dist/rules/requireParamType.cjs.map +1 -1
  121. package/dist/rules/requireProperty.cjs +2 -10
  122. package/dist/rules/requireProperty.cjs.map +1 -1
  123. package/dist/rules/requirePropertyDescription.cjs +2 -10
  124. package/dist/rules/requirePropertyDescription.cjs.map +1 -1
  125. package/dist/rules/requirePropertyName.cjs +2 -10
  126. package/dist/rules/requirePropertyName.cjs.map +1 -1
  127. package/dist/rules/requirePropertyType.cjs +2 -10
  128. package/dist/rules/requirePropertyType.cjs.map +1 -1
  129. package/dist/rules/requireRejects.cjs +2 -9
  130. package/dist/rules/requireRejects.cjs.map +1 -1
  131. package/dist/rules/requireReturns.cjs +4 -11
  132. package/dist/rules/requireReturns.cjs.map +1 -1
  133. package/dist/rules/requireReturnsCheck.cjs +8 -15
  134. package/dist/rules/requireReturnsCheck.cjs.map +1 -1
  135. package/dist/rules/requireReturnsDescription.cjs +2 -10
  136. package/dist/rules/requireReturnsDescription.cjs.map +1 -1
  137. package/dist/rules/requireReturnsType.cjs +2 -10
  138. package/dist/rules/requireReturnsType.cjs.map +1 -1
  139. package/dist/rules/requireTags.cjs +2 -9
  140. package/dist/rules/requireTags.cjs.map +1 -1
  141. package/dist/rules/requireTemplate.cjs +5 -13
  142. package/dist/rules/requireTemplate.cjs.map +1 -1
  143. package/dist/rules/requireThrows.cjs +2 -9
  144. package/dist/rules/requireThrows.cjs.map +1 -1
  145. package/dist/rules/requireYields.cjs +2 -9
  146. package/dist/rules/requireYields.cjs.map +1 -1
  147. package/dist/rules/requireYieldsCheck.cjs +2 -9
  148. package/dist/rules/requireYieldsCheck.cjs.map +1 -1
  149. package/dist/rules/sortTags.cjs +4 -12
  150. package/dist/rules/sortTags.cjs.map +1 -1
  151. package/dist/rules/tagLines.cjs +2 -9
  152. package/dist/rules/tagLines.cjs.map +1 -1
  153. package/dist/rules/textEscaping.cjs +2 -9
  154. package/dist/rules/textEscaping.cjs.map +1 -1
  155. package/dist/rules/tsMethodSignatureStyle.cjs +10 -18
  156. package/dist/rules/tsMethodSignatureStyle.cjs.map +1 -1
  157. package/dist/rules/tsNoEmptyObjectType.cjs +5 -13
  158. package/dist/rules/tsNoEmptyObjectType.cjs.map +1 -1
  159. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs +8 -16
  160. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs.map +1 -1
  161. package/dist/rules/tsPreferFunctionType.cjs +8 -16
  162. package/dist/rules/tsPreferFunctionType.cjs.map +1 -1
  163. package/dist/rules/typeFormatting.cjs +9 -17
  164. package/dist/rules/typeFormatting.cjs.map +1 -1
  165. package/dist/rules/validTypes.cjs +10 -18
  166. package/dist/rules/validTypes.cjs.map +1 -1
  167. package/dist/tagNames.cjs +4 -9
  168. package/dist/tagNames.cjs.map +1 -1
  169. package/dist/utils/hasReturnValue.cjs +1 -8
  170. package/dist/utils/hasReturnValue.cjs.map +1 -1
  171. package/package.json +21 -21
  172. package/src/rules/checkTemplateNames.js +0 -1
  173. package/src/rules/escapeInlineTags.js +142 -45
  174. package/src/rules/requireJsdoc.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"generateOptions.cjs","names":["_escodegen","require","_decamelize","_interopRequireDefault","_espree","_esquery","_promises","_nodePath","e","__esModule","default","rulesDir","dirContents","readdir","file","endsWith","fileContents","readFile","join","ast","parse","ecmaVersion","sourceType","results","esquery","query","value","schema","generate","format","json","quotes","parsed","JSON","initial","Array","isArray","length","console","log","type","enum","map","item","shift","obj","hyphenatedRule","decamelize","separator","replace","docPath","ruleDocs","Object","keys","properties","key","writeFile"],"sources":["../src/bin/generateOptions.js"],"sourcesContent":["import {\n generate,\n} from '@es-joy/escodegen';\nimport decamelize from 'decamelize';\nimport {\n parse,\n} from 'espree';\nimport esquery from 'esquery';\nimport {\n readdir,\n readFile,\n writeFile,\n} from 'node:fs/promises';\nimport {\n join,\n} from 'node:path';\n\nconst rulesDir = './src/rules';\n\nconst dirContents = await readdir(rulesDir);\n\nfor (const file of dirContents) {\n if (!file.endsWith('.js')) {\n continue;\n }\n\n const fileContents = await readFile(join(rulesDir, file), 'utf8');\n // console.log('file', file);\n const ast = parse(fileContents, {\n ecmaVersion: 2_024,\n sourceType: 'module',\n });\n const results = esquery.query(\n ast,\n 'ExportDefaultDeclaration[declaration.callee.name=\"iterateJsdoc\"]' +\n ' Property[key.name=\"meta\"] Property[key.name=\"schema\"]',\n );\n if (results[0]?.value) {\n const schema = generate(results[0]?.value, {\n format: {\n json: true,\n quotes: 'double',\n },\n });\n const parsed = JSON.parse(schema);\n\n let initial = '';\n if (Array.isArray(parsed)) {\n if (!parsed.length) {\n // eslint-disable-next-line no-console -- CLI\n console.log('skipping no options', file);\n continue;\n }\n\n if (parsed.length >= 2) {\n if (parsed.length >= 3 || parsed[0].type !== 'string') {\n // eslint-disable-next-line no-console -- CLI\n console.log('unexpectedly large schema', file);\n continue;\n // throw new Error('Unexpected long schema array');\n }\n\n initial = `string (${parsed[0].enum.map((item) => {\n return `\"${item}\"`;\n }).join(', ')}) followed by object with `;\n parsed.shift();\n }\n }\n\n const obj = Array.isArray(parsed) ? parsed[0] : parsed;\n\n const hyphenatedRule = decamelize(file, {\n separator: '-',\n }).replace(/\\.js$/v, '.md');\n const docPath = join('.README/rules', hyphenatedRule);\n\n const ruleDocs = (await readFile(docPath, 'utf8'))\n .replace(/(\\|\\s*Options\\s*\\|)([^\\|]*)(\\|)?/v, `$1${\n initial +\n Object.keys(obj.properties).map((key) => {\n return `\\`${key}\\``;\n }).join(', ')\n }$3`);\n\n await writeFile(docPath, ruleDocs);\n }\n}\n"],"mappings":";;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAGA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,SAAA,GAAAN,OAAA;AAEmB,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,QAAQ,GAAG,aAAa;AAE9B,MAAMC,WAAW,GAAG,MAAM,IAAAC,iBAAO,EAACF,QAAQ,CAAC;AAE3C,KAAK,MAAMG,IAAI,IAAIF,WAAW,EAAE;EAC9B,IAAI,CAACE,IAAI,CAACC,QAAQ,CAAC,KAAK,CAAC,EAAE;IACzB;EACF;EAEA,MAAMC,YAAY,GAAG,MAAM,IAAAC,kBAAQ,EAAC,IAAAC,cAAI,EAACP,QAAQ,EAAEG,IAAI,CAAC,EAAE,MAAM,CAAC;EACjE;EACA,MAAMK,GAAG,GAAG,IAAAC,aAAK,EAACJ,YAAY,EAAE;IAC9BK,WAAW,EAAE,KAAK;IAClBC,UAAU,EAAE;EACd,CAAC,CAAC;EACF,MAAMC,OAAO,GAAGC,gBAAO,CAACC,KAAK,CAC3BN,GAAG,EACH,kEAAkE,GACjE,wDACH,CAAC;EACD,IAAII,OAAO,CAAC,CAAC,CAAC,EAAEG,KAAK,EAAE;IACrB,MAAMC,MAAM,GAAG,IAAAC,mBAAQ,EAACL,OAAO,CAAC,CAAC,CAAC,EAAEG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,MAAM,CAAC,EAC9CD,OAAO,CAAC,mCAAmC,EAAE,KAC5Cf,OAAO,GACPkB,MAAM,CAACC,IAAI,CAACR,GAAG,CAACS,UAAU,CAAC,CAACZ,GAAG,CAAEa,GAAG,IAAK;MACvC,OAAO,KAAKA,GAAG,IAAI;IACrB,CAAC,CAAC,CAACrC,IAAI,CAAC,IAAI,CAAC,IACX,CAAC;IAEP,MAAM,IAAAsC,mBAAS,EAACN,OAAO,EAAEC,QAAQ,CAAC;EACpC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"generateOptions.cjs","names":[],"sources":["../src/bin/generateOptions.js"],"sourcesContent":["import {\n generate,\n} from '@es-joy/escodegen';\nimport decamelize from 'decamelize';\nimport {\n parse,\n} from 'espree';\nimport esquery from 'esquery';\nimport {\n readdir,\n readFile,\n writeFile,\n} from 'node:fs/promises';\nimport {\n join,\n} from 'node:path';\n\nconst rulesDir = './src/rules';\n\nconst dirContents = await readdir(rulesDir);\n\nfor (const file of dirContents) {\n if (!file.endsWith('.js')) {\n continue;\n }\n\n const fileContents = await readFile(join(rulesDir, file), 'utf8');\n // console.log('file', file);\n const ast = parse(fileContents, {\n ecmaVersion: 2_024,\n sourceType: 'module',\n });\n const results = esquery.query(\n ast,\n 'ExportDefaultDeclaration[declaration.callee.name=\"iterateJsdoc\"]' +\n ' Property[key.name=\"meta\"] Property[key.name=\"schema\"]',\n );\n if (results[0]?.value) {\n const schema = generate(results[0]?.value, {\n format: {\n json: true,\n quotes: 'double',\n },\n });\n const parsed = JSON.parse(schema);\n\n let initial = '';\n if (Array.isArray(parsed)) {\n if (!parsed.length) {\n // eslint-disable-next-line no-console -- CLI\n console.log('skipping no options', file);\n continue;\n }\n\n if (parsed.length >= 2) {\n if (parsed.length >= 3 || parsed[0].type !== 'string') {\n // eslint-disable-next-line no-console -- CLI\n console.log('unexpectedly large schema', file);\n continue;\n // throw new Error('Unexpected long schema array');\n }\n\n initial = `string (${parsed[0].enum.map((item) => {\n return `\"${item}\"`;\n }).join(', ')}) followed by object with `;\n parsed.shift();\n }\n }\n\n const obj = Array.isArray(parsed) ? parsed[0] : parsed;\n\n const hyphenatedRule = decamelize(file, {\n separator: '-',\n }).replace(/\\.js$/v, '.md');\n const docPath = join('.README/rules', hyphenatedRule);\n\n const ruleDocs = (await readFile(docPath, 'utf8'))\n .replace(/(\\|\\s*Options\\s*\\|)([^\\|]*)(\\|)?/v, `$1${\n initial +\n Object.keys(obj.properties).map((key) => {\n return `\\`${key}\\``;\n }).join(', ')\n }$3`);\n\n await writeFile(docPath, ruleDocs);\n }\n}\n"],"mappings":"AAAA,SACE,QAAQ,QACH,mBAAmB;AAC1B,OAAO,UAAU,MAAM,YAAY;AACnC,SACE,KAAK,QACA,QAAQ;AACf,OAAO,OAAO,MAAM,SAAS;AAC7B,SACE,OAAO,EACP,QAAQ,EACR,SAAS,QACJ,kBAAkB;AACzB,SACE,IAAI,QACC,WAAW;AAElB,MAAM,QAAQ,GAAG,aAAa;AAE9B,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC;AAE3C,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;EAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;IACzB;EACF;EAEA,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC;EACjE;EACA,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE;IAC9B,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE;EACd,CAAC,CAAC;EACF,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAC3B,GAAG,EACH,kEAAkE,GACjE,wDACH,CAAC;EACD,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE;IACrB,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE;MACzC,MAAM,EAAE;QACN,IA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CAAC,GAAG,CAAE,GAAG,IAAK;MACvC,OAAO,KAAK,GAAG,IAAI;IACrB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IACX,CAAC;IAEP,MAAM,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC;EACpC;AACF","ignoreList":[]}
@@ -1,17 +1,17 @@
1
- "use strict";
2
-
3
- var _camelcase = _interopRequireDefault(require("camelcase"));
4
- var _nodeFs = require("node:fs");
5
- var _promises = _interopRequireDefault(require("node:fs/promises"));
6
- var _nodePath = require("node:path");
7
- var _openEditor = _interopRequireDefault(require("open-editor"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } /* eslint-disable no-console -- CLI */ /**
1
+ /* eslint-disable no-console -- CLI */
2
+ /**
10
3
  * @example
11
4
  * ```shell
12
5
  * pnpm run create-rule my-new-rule -- --recommended
13
6
  * ```
14
7
  */
8
+
9
+ import camelCase from 'camelcase';
10
+ import { existsSync } from 'node:fs';
11
+ import fs from 'node:fs/promises';
12
+ import { resolve } from 'node:path';
13
+ import open from 'open-editor';
14
+
15
15
  // Todo: Would ideally have prompts, e.g., to ask for whether
16
16
  // type was problem/layout, etc.
17
17
 
@@ -27,14 +27,14 @@ const recommended = options.includes('--recommended');
27
27
  return;
28
28
  }
29
29
  const ruleNamesPath = './test/rules/ruleNames.json';
30
- const ruleNames = JSON.parse(await _promises.default.readFile(
30
+ const ruleNames = JSON.parse(await fs.readFile(
31
31
  // eslint-disable-next-line unicorn/prefer-json-parse-buffer -- TypeScript
32
32
  ruleNamesPath, 'utf8'));
33
33
  if (!ruleNames.includes(ruleName)) {
34
34
  ruleNames.push(ruleName);
35
35
  ruleNames.sort();
36
36
  }
37
- await _promises.default.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\n');
37
+ await fs.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\n');
38
38
  console.log('ruleNames', ruleNames);
39
39
  const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc.js';
40
40
 
@@ -63,10 +63,10 @@ export default iterateJsdoc(({
63
63
  },
64
64
  });
65
65
  `;
66
- const camelCasedRuleName = (0, _camelcase.default)(ruleName);
66
+ const camelCasedRuleName = camelCase(ruleName);
67
67
  const rulePath = `./src/rules/${camelCasedRuleName}.js`;
68
- if (!(0, _nodeFs.existsSync)(rulePath)) {
69
- await _promises.default.writeFile(rulePath, ruleTemplate);
68
+ if (!existsSync(rulePath)) {
69
+ await fs.writeFile(rulePath, ruleTemplate);
70
70
  }
71
71
  const ruleTestTemplate = `export default {
72
72
  invalid: [
@@ -90,8 +90,8 @@ export default iterateJsdoc(({
90
90
  };
91
91
  `;
92
92
  const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;
93
- if (!(0, _nodeFs.existsSync)(ruleTestPath)) {
94
- await _promises.default.writeFile(ruleTestPath, ruleTestTemplate);
93
+ if (!existsSync(ruleTestPath)) {
94
+ await fs.writeFile(ruleTestPath, ruleTestTemplate);
95
95
  }
96
96
  const ruleReadmeTemplate = `# \`${ruleName}\`
97
97
 
@@ -116,8 +116,8 @@ export default iterateJsdoc(({
116
116
  <!-- assertions-passing ${camelCasedRuleName} -->
117
117
  `;
118
118
  const ruleReadmePath = `./.README/rules/${ruleName}.md`;
119
- if (!(0, _nodeFs.existsSync)(ruleReadmePath)) {
120
- await _promises.default.writeFile(ruleReadmePath, ruleReadmeTemplate);
119
+ if (!existsSync(ruleReadmePath)) {
120
+ await fs.writeFile(ruleReadmePath, ruleReadmeTemplate);
121
121
  }
122
122
 
123
123
  /**
@@ -150,7 +150,7 @@ export default iterateJsdoc(({
150
150
  * @type {OffsetInfo[]}
151
151
  */
152
152
  const offsets = [];
153
- let readme = await _promises.default.readFile(path, 'utf8');
153
+ let readme = await fs.readFile(path, 'utf8');
154
154
  readme.replace(oldRegex,
155
155
  /**
156
156
  * @param {string} matchedLine
@@ -199,7 +199,7 @@ export default iterateJsdoc(({
199
199
  console.log(`Rule name is already present in ${checkName}.`);
200
200
  } else {
201
201
  readme = readme.slice(0, item.offset) + (item.offset ? '\n' : '') + newLine + (item.offset ? '' : '\n') + readme.slice(item.offset);
202
- await _promises.default.writeFile(path, readme);
202
+ await fs.writeFile(path, readme);
203
203
  }
204
204
  };
205
205
 
@@ -229,8 +229,8 @@ export default iterateJsdoc(({
229
229
  oldRegex: /\n\s{2}'(?<oldRule>[^']*)': [^,]*,/gv,
230
230
  path: './src/index-cjs.js'
231
231
  });
232
- await Promise.resolve().then(() => _interopRequireWildcard(require('./buildEntryFileForTS.js')));
233
- await Promise.resolve().then(() => _interopRequireWildcard(require('./generateDocs.js')));
232
+ await import('./buildEntryFileForTS.js');
233
+ await import('./generateDocs.js');
234
234
 
235
235
  /*
236
236
  console.log('Paths to open for further editing\n');
@@ -240,8 +240,8 @@ export default iterateJsdoc(({
240
240
  */
241
241
 
242
242
  // Set chdir as somehow still in operation from other test
243
- process.chdir((0, _nodePath.resolve)(__dirname, '../../'));
244
- await (0, _openEditor.default)([
243
+ process.chdir(resolve(__dirname, '../../'));
244
+ await open([
245
245
  // Could even add editor line column numbers like `${rulePath}:1:1`
246
246
  ruleReadmePath, ruleTestPath, rulePath]);
247
247
  })();
@@ -1 +1 @@
1
- {"version":3,"file":"generateRule.cjs","names":["_camelcase","_interopRequireDefault","require","_nodeFs","_promises","_nodePath","_openEditor","e","__esModule","default","_interopRequireWildcard","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ruleName","options","process","argv","recommended","includes","console","error","test","ruleNamesPath","ruleNames","JSON","parse","fs","readFile","push","sort","writeFile","stringify","log","ruleTemplate","camelCasedRuleName","camelCase","rulePath","existsSync","ruleTestTemplate","ruleTestPath","ruleReadmeTemplate","ruleReadmePath","replaceInOrder","checkName","newLine","oldIsCamel","oldRegex","path","offsets","readme","replace","matchedLine","n1","offset","str","oldRule","oldRuleB","alreadyIncluded","itemIndex","findIndex","item","undefined","pop","length","slice","repeat","Promise","resolve","then","chdir","__dirname","open"],"sources":["../src/bin/generateRule.js"],"sourcesContent":["/* eslint-disable no-console -- CLI */\n/**\n * @example\n * ```shell\n * pnpm run create-rule my-new-rule -- --recommended\n * ```\n */\n\nimport camelCase from 'camelcase';\nimport {\n existsSync,\n} from 'node:fs';\nimport fs from 'node:fs/promises';\nimport {\n resolve,\n} from 'node:path';\nimport open from 'open-editor';\n\n// Todo: Would ideally have prompts, e.g., to ask for whether\n// type was problem/layout, etc.\n\nconst [\n , , ruleName,\n ...options\n] = process.argv;\n\nconst recommended = options.includes('--recommended');\n\n(async () => {\n if (!ruleName) {\n console.error('Please supply a rule name');\n\n return;\n }\n\n if ((/[A-Z]/v).test(ruleName)) {\n console.error('Please ensure the rule has no capital letters');\n\n return;\n }\n\n const ruleNamesPath = './test/rules/ruleNames.json';\n const ruleNames = JSON.parse(await fs.readFile(\n // eslint-disable-next-line unicorn/prefer-json-parse-buffer -- TypeScript\n ruleNamesPath, 'utf8',\n ));\n if (!ruleNames.includes(ruleName)) {\n ruleNames.push(ruleName);\n ruleNames.sort();\n }\n\n await fs.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\\n');\n console.log('ruleNames', ruleNames);\n\n const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n // Rule here\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/${ruleName}.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n // Option properties here (or remove the object)\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n`;\n\n const camelCasedRuleName = camelCase(ruleName);\n\n const rulePath = `./src/rules/${camelCasedRuleName}.js`;\n\n if (!existsSync(rulePath)) {\n await fs.writeFile(rulePath, ruleTemplate);\n }\n\n const ruleTestTemplate = `export default {\n invalid: [\n {\n code: \\`\n \\`,\n errors: [\n {\n line: 2,\n message: '',\n },\n ],\n },\n ],\n valid: [\n {\n code: \\`\n \\`,\n },\n ],\n};\n`;\n\n const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;\n if (!existsSync(ruleTestPath)) {\n await fs.writeFile(ruleTestPath, ruleTestTemplate);\n }\n\n const ruleReadmeTemplate = `# \\`${ruleName}\\`\n\n## Options\n\n{\"gitdown\": \"options\"}\n\n|||\n|---|---|\n|Context|everywhere|\n|Tags|\\`\\`|\n|Recommended|${recommended ? 'true' : 'false'}|\n|Settings||\n|Options||\n\n## Failing examples\n\n<!-- assertions-failing ${camelCasedRuleName} -->\n\n## Passing examples\n\n<!-- assertions-passing ${camelCasedRuleName} -->\n`;\n\n const ruleReadmePath = `./.README/rules/${ruleName}.md`;\n if (!existsSync(ruleReadmePath)) {\n await fs.writeFile(ruleReadmePath, ruleReadmeTemplate);\n }\n\n /**\n * @param {object} cfg\n * @param {string} cfg.path\n * @param {RegExp} cfg.oldRegex\n * @param {string} cfg.checkName\n * @param {string} cfg.newLine\n * @param {boolean} [cfg.oldIsCamel]\n * @returns {Promise<void>}\n */\n const replaceInOrder = async ({\n checkName,\n newLine,\n oldIsCamel,\n oldRegex,\n path,\n }) => {\n /**\n * @typedef {number} Integer\n */\n /**\n * @typedef {{\n * matchedLine: string,\n * offset: Integer,\n * oldRule: string,\n * }} OffsetInfo\n */\n /**\n * @type {OffsetInfo[]}\n */\n const offsets = [];\n\n let readme = await fs.readFile(path, 'utf8');\n readme.replace(\n oldRegex,\n /**\n * @param {string} matchedLine\n * @param {string} n1\n * @param {Integer} offset\n * @param {string} str\n * @param {object} groups\n * @param {string} groups.oldRule\n * @returns {string}\n */\n (matchedLine, n1, offset, str, {\n oldRule,\n }) => {\n offsets.push({\n matchedLine,\n offset,\n oldRule,\n });\n\n return matchedLine;\n },\n );\n\n offsets.sort(({\n oldRule,\n }, {\n oldRule: oldRuleB,\n }) => {\n return oldRule < oldRuleB ? -1 : (oldRule > oldRuleB ? 1 : 0);\n });\n\n let alreadyIncluded = false;\n const itemIndex = offsets.findIndex(({\n oldRule,\n }) => {\n alreadyIncluded ||= oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule;\n\n return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule;\n });\n let item = itemIndex !== undefined && offsets[itemIndex];\n if (item && itemIndex === 0 &&\n\n // This property would not always be sufficient but in this case it is.\n oldIsCamel\n ) {\n item.offset = 0;\n }\n\n if (!item) {\n item = /** @type {OffsetInfo} */ (offsets.pop());\n item.offset += item.matchedLine.length;\n }\n\n if (alreadyIncluded) {\n console.log(`Rule name is already present in ${checkName}.`);\n } else {\n readme = readme.slice(0, item.offset) +\n (item.offset ? '\\n' : '') +\n newLine +\n (item.offset ? '' : '\\n') +\n readme.slice(item.offset);\n\n await fs.writeFile(path, readme);\n }\n };\n\n // await replaceInOrder({\n // checkName: 'README',\n // newLine: `{\"gitdown\": \"include\", \"file\": \"./rules/${ruleName}.md\"}`,\n // oldRegex: /\\n\\{\"gitdown\": \"include\", \"file\": \".\\/rules\\/(?<oldRule>[^.]*).md\"\\}/gv,\n // path: './.README/README.md',\n // });\n\n await replaceInOrder({\n checkName: 'index import',\n newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}.js';`,\n oldIsCamel: true,\n oldRegex: /\\nimport (?<oldRule>[^ ]*) from '.\\/rules\\/\\1\\.js';/gv,\n path: './src/index-cjs.js',\n });\n\n await replaceInOrder({\n checkName: 'index recommended',\n newLine: `${' '.repeat(6)}'jsdoc/${ruleName}': ${recommended ? 'warnOrError' : '\\'off\\''},`,\n oldRegex: /\\n\\s{6}'jsdoc\\/(?<oldRule>[^']*)': .*?,/gv,\n path: './src/index-cjs.js',\n });\n\n await replaceInOrder({\n checkName: 'index rules',\n newLine: `${' '.repeat(2)}'${ruleName}': ${camelCasedRuleName},`,\n oldRegex: /\\n\\s{2}'(?<oldRule>[^']*)': [^,]*,/gv,\n path: './src/index-cjs.js',\n });\n\n await import('./buildEntryFileForTS.js');\n\n await import('./generateDocs.js');\n\n /*\n console.log('Paths to open for further editing\\n');\n console.log(`open ${ruleReadmePath}`);\n console.log(`open ${rulePath}`);\n console.log(`open ${ruleTestPath}\\n`);\n */\n\n // Set chdir as somehow still in operation from other test\n process.chdir(resolve(import.meta.dirname, '../../'));\n await open([\n // Could even add editor line column numbers like `${rulePath}:1:1`\n ruleReadmePath,\n ruleTestPath,\n rulePath,\n ]);\n})();\n"],"mappings":";;AAQA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAGA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA+B,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,wBAAAH,CAAA,EAAAI,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,uBAAA,YAAAA,CAAAH,CAAA,EAAAI,CAAA,SAAAA,CAAA,IAAAJ,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAQ,CAAA,EAAAC,CAAA,EAAA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;EAEF,MAAML,cAAc,CAAC;IACnBC,SAAS,EAAE,mBAAmB;IAC9BC,OAAO,EAAE,GAAG,GAAG,CAACqB,MAAM,CAAC,CAAC,CAAC,UAAUpD,QAAQ,MAAMI,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG;IAC3F6B,QAAQ,EAAE,2CAA2C;IACrDC,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAML,cAAc,CAAC;IACnBC,SAAS,EAAE,aAAa;IACxBC,OAAO,EAAE,GAAG,GAAG,CAACqB,MAAM,CAAC,CAAC,CAAC,IAAIpD,QAAQ,MAAMqB,kBAAkB,GAAG;IAChEY,QAAQ,EAAE,sCAAsC;IAChDC,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAAmB,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAxE,uBAAA,CAAAR,OAAA,CAAa,0BAA0B,GAAC;EAExC,MAAA8E,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAxE,uBAAA,CAAAR,OAAA,CAAa,mBAAmB,GAAC;;EAEjC;AACF;AACA;AACA;AACA;AACA;;EAEE;EACA2B,OAAO,CAACsD,KAAK,CAAC,IAAAF,iBAAO,EAAAG,SAAA,EAAsB,QAAQ,CAAC,CAAC;EACrD,MAAM,IAAAC,mBAAI,EAAC;EACT;EACA9B,cAAc,EACdF,YAAY,EACZH,QAAQ,CACT,CAAC;AACJ,CAAC,EAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"generateRule.cjs","names":[],"sources":["../src/bin/generateRule.js"],"sourcesContent":["/* eslint-disable no-console -- CLI */\n/**\n * @example\n * ```shell\n * pnpm run create-rule my-new-rule -- --recommended\n * ```\n */\n\nimport camelCase from 'camelcase';\nimport {\n existsSync,\n} from 'node:fs';\nimport fs from 'node:fs/promises';\nimport {\n resolve,\n} from 'node:path';\nimport open from 'open-editor';\n\n// Todo: Would ideally have prompts, e.g., to ask for whether\n// type was problem/layout, etc.\n\nconst [\n , , ruleName,\n ...options\n] = process.argv;\n\nconst recommended = options.includes('--recommended');\n\n(async () => {\n if (!ruleName) {\n console.error('Please supply a rule name');\n\n return;\n }\n\n if ((/[A-Z]/v).test(ruleName)) {\n console.error('Please ensure the rule has no capital letters');\n\n return;\n }\n\n const ruleNamesPath = './test/rules/ruleNames.json';\n const ruleNames = JSON.parse(await fs.readFile(\n // eslint-disable-next-line unicorn/prefer-json-parse-buffer -- TypeScript\n ruleNamesPath, 'utf8',\n ));\n if (!ruleNames.includes(ruleName)) {\n ruleNames.push(ruleName);\n ruleNames.sort();\n }\n\n await fs.writeFile(ruleNamesPath, JSON.stringify(ruleNames, null, 2) + '\\n');\n console.log('ruleNames', ruleNames);\n\n const ruleTemplate = `import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n // Rule here\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/${ruleName}.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n // Option properties here (or remove the object)\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n`;\n\n const camelCasedRuleName = camelCase(ruleName);\n\n const rulePath = `./src/rules/${camelCasedRuleName}.js`;\n\n if (!existsSync(rulePath)) {\n await fs.writeFile(rulePath, ruleTemplate);\n }\n\n const ruleTestTemplate = `export default {\n invalid: [\n {\n code: \\`\n \\`,\n errors: [\n {\n line: 2,\n message: '',\n },\n ],\n },\n ],\n valid: [\n {\n code: \\`\n \\`,\n },\n ],\n};\n`;\n\n const ruleTestPath = `./test/rules/assertions/${camelCasedRuleName}.js`;\n if (!existsSync(ruleTestPath)) {\n await fs.writeFile(ruleTestPath, ruleTestTemplate);\n }\n\n const ruleReadmeTemplate = `# \\`${ruleName}\\`\n\n## Options\n\n{\"gitdown\": \"options\"}\n\n|||\n|---|---|\n|Context|everywhere|\n|Tags|\\`\\`|\n|Recommended|${recommended ? 'true' : 'false'}|\n|Settings||\n|Options||\n\n## Failing examples\n\n<!-- assertions-failing ${camelCasedRuleName} -->\n\n## Passing examples\n\n<!-- assertions-passing ${camelCasedRuleName} -->\n`;\n\n const ruleReadmePath = `./.README/rules/${ruleName}.md`;\n if (!existsSync(ruleReadmePath)) {\n await fs.writeFile(ruleReadmePath, ruleReadmeTemplate);\n }\n\n /**\n * @param {object} cfg\n * @param {string} cfg.path\n * @param {RegExp} cfg.oldRegex\n * @param {string} cfg.checkName\n * @param {string} cfg.newLine\n * @param {boolean} [cfg.oldIsCamel]\n * @returns {Promise<void>}\n */\n const replaceInOrder = async ({\n checkName,\n newLine,\n oldIsCamel,\n oldRegex,\n path,\n }) => {\n /**\n * @typedef {number} Integer\n */\n /**\n * @typedef {{\n * matchedLine: string,\n * offset: Integer,\n * oldRule: string,\n * }} OffsetInfo\n */\n /**\n * @type {OffsetInfo[]}\n */\n const offsets = [];\n\n let readme = await fs.readFile(path, 'utf8');\n readme.replace(\n oldRegex,\n /**\n * @param {string} matchedLine\n * @param {string} n1\n * @param {Integer} offset\n * @param {string} str\n * @param {object} groups\n * @param {string} groups.oldRule\n * @returns {string}\n */\n (matchedLine, n1, offset, str, {\n oldRule,\n }) => {\n offsets.push({\n matchedLine,\n offset,\n oldRule,\n });\n\n return matchedLine;\n },\n );\n\n offsets.sort(({\n oldRule,\n }, {\n oldRule: oldRuleB,\n }) => {\n return oldRule < oldRuleB ? -1 : (oldRule > oldRuleB ? 1 : 0);\n });\n\n let alreadyIncluded = false;\n const itemIndex = offsets.findIndex(({\n oldRule,\n }) => {\n alreadyIncluded ||= oldIsCamel ? camelCasedRuleName === oldRule : ruleName === oldRule;\n\n return oldIsCamel ? camelCasedRuleName < oldRule : ruleName < oldRule;\n });\n let item = itemIndex !== undefined && offsets[itemIndex];\n if (item && itemIndex === 0 &&\n\n // This property would not always be sufficient but in this case it is.\n oldIsCamel\n ) {\n item.offset = 0;\n }\n\n if (!item) {\n item = /** @type {OffsetInfo} */ (offsets.pop());\n item.offset += item.matchedLine.length;\n }\n\n if (alreadyIncluded) {\n console.log(`Rule name is already present in ${checkName}.`);\n } else {\n readme = readme.slice(0, item.offset) +\n (item.offset ? '\\n' : '') +\n newLine +\n (item.offset ? '' : '\\n') +\n readme.slice(item.offset);\n\n await fs.writeFile(path, readme);\n }\n };\n\n // await replaceInOrder({\n // checkName: 'README',\n // newLine: `{\"gitdown\": \"include\", \"file\": \"./rules/${ruleName}.md\"}`,\n // oldRegex: /\\n\\{\"gitdown\": \"include\", \"file\": \".\\/rules\\/(?<oldRule>[^.]*).md\"\\}/gv,\n // path: './.README/README.md',\n // });\n\n await replaceInOrder({\n checkName: 'index import',\n newLine: `import ${camelCasedRuleName} from './rules/${camelCasedRuleName}.js';`,\n oldIsCamel: true,\n oldRegex: /\\nimport (?<oldRule>[^ ]*) from '.\\/rules\\/\\1\\.js';/gv,\n path: './src/index-cjs.js',\n });\n\n await replaceInOrder({\n checkName: 'index recommended',\n newLine: `${' '.repeat(6)}'jsdoc/${ruleName}': ${recommended ? 'warnOrError' : '\\'off\\''},`,\n oldRegex: /\\n\\s{6}'jsdoc\\/(?<oldRule>[^']*)': .*?,/gv,\n path: './src/index-cjs.js',\n });\n\n await replaceInOrder({\n checkName: 'index rules',\n newLine: `${' '.repeat(2)}'${ruleName}': ${camelCasedRuleName},`,\n oldRegex: /\\n\\s{2}'(?<oldRule>[^']*)': [^,]*,/gv,\n path: './src/index-cjs.js',\n });\n\n await import('./buildEntryFileForTS.js');\n\n await import('./generateDocs.js');\n\n /*\n console.log('Paths to open for further editing\\n');\n console.log(`open ${ruleReadmePath}`);\n console.log(`open ${rulePath}`);\n console.log(`open ${ruleTestPath}\\n`);\n */\n\n // Set chdir as somehow still in operation from other test\n process.chdir(resolve(import.meta.dirname, '../../'));\n await open([\n // Could even add editor line column numbers like `${rulePath}:1:1`\n ruleReadmePath,\n ruleTestPath,\n rulePath,\n ]);\n})();\n"],"mappings":"AAAA;AACA;AACA;A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jsonSchemaToTypescript = require("json-schema-to-typescript");
5
- var _promises = require("node:fs/promises");
6
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
1
+ import index from '../index.js';
2
+ import { compile } from 'json-schema-to-typescript';
3
+ import { writeFile } from 'node:fs/promises';
7
4
  let str = 'export interface Rules {\n';
8
5
  for (const [ruleName, rule] of Object.entries(/** @type {Record<string, import('@eslint/core').RuleDefinition<import('@eslint/core').RuleDefinitionTypeOptions>>} */
9
- _index.default.rules)) {
6
+ index.rules)) {
10
7
  str += ` /** ${rule.meta?.docs?.description ?? ''} */\n`;
11
8
  str += ` "jsdoc/${ruleName}": `;
12
- const ts = await (0, _jsonSchemaToTypescript.compile)({
9
+ const ts = await compile({
13
10
  items: rule?.meta?.schema || [],
14
11
  type: 'array'
15
12
  }, 'Test', {
@@ -18,7 +15,7 @@ _index.default.rules)) {
18
15
  str += ts.replace(/^export type Test = ?/v, '').replace(/^export interface Test /v, '').replaceAll('\n', '\n ').trimEnd().replace(/;$/v, '') + ';\n\n';
19
16
  }
20
17
  str = str.replace(/\n$/v, '') + '}\n';
21
- await (0, _promises.writeFile)(__dirname + '/../rules.d.ts', str);
18
+ await writeFile(__dirname + '/../rules.d.ts', str);
22
19
 
23
20
  // console.log('str', str);
24
21
  //# sourceMappingURL=generateRuleTypes.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateRuleTypes.cjs","names":["_index","_interopRequireDefault","require","_jsonSchemaToTypescript","_promises","e","__esModule","default","str","ruleName","rule","Object","entries","index","rules","meta","docs","description","ts","compile","items","schema","type","bannerComment","replace","replaceAll","trimEnd","writeFile","__dirname"],"sources":["../src/bin/generateRuleTypes.js"],"sourcesContent":["import index from '../index.js';\nimport {\n compile,\n} from 'json-schema-to-typescript';\nimport {\n writeFile,\n} from 'node:fs/promises';\n\nlet str = 'export interface Rules {\\n';\n\nfor (const [\n ruleName,\n rule,\n] of Object.entries(\n /** @type {Record<string, import('@eslint/core').RuleDefinition<import('@eslint/core').RuleDefinitionTypeOptions>>} */ (\n index.rules\n ),\n )\n) {\n str += ` /** ${rule.meta?.docs?.description ?? ''} */\\n`;\n str += ` \"jsdoc/${ruleName}\": `;\n const ts = await compile({\n items: rule?.meta?.schema || [],\n type: 'array',\n }, 'Test', {\n bannerComment: '',\n });\n\n str += ts\n .replace(/^export type Test = ?/v, '')\n .replace(/^export interface Test /v, '')\n .replaceAll('\\n', '\\n ').trimEnd().replace(/;$/v, '') +\n ';\\n\\n';\n}\n\nstr = str.replace(/\\n$/v, '') + '}\\n';\n\nawait writeFile(import.meta.dirname + '/../rules.d.ts', str);\n\n// console.log('str', str);\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAF,OAAA;AAE0B,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1B,IAAIG,GAAG,GAAG,4BAA4B;AAEtC,KAAK,MAAM,CACTC,QAAQ,EACRC,IAAI,CACL,IAAIC,MAAM,CAACC,OAAO,CACjB;AACIC,cAAK,CAACC,KAEV,CAAC,EACD;EACAN,GAAG,IAAI,SAASE,IAAI,CAACK,IAAI,EAAEC,IAAI,EAAEC,WAAW,IAAI,EAAE,OAAO;EACzDT,GAAG,IAAI,YAAYC,QAAQ,KAAK;EAChC,MAAMS,EAAE,GAAG,MAAM,IAAAC,+BAAO,EAAC;IACvBC,KAAK,EAAEV,IAAI,EAAEK,IAAI,EAAEM,MAAM,IAAI,EAAE;IAC/BC,IAAI,EAAE;EACR,CAAC,EAAE,MAAM,EAAE;IACTC,aAAa,EAAE;EACjB,CAAC,CAAC;EAEFf,GAAG,IAAIU,EAAE,CACNM,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CACrCA,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CACvCC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAACC,OAAO,CAAC,CAAC,CAACF,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GACpD,OAAO;AACb;AAEAhB,GAAG,GAAGA,GAAG,CAACgB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,KAAK;AAErC,MAAM,IAAAG,mBAAS,EAACC,SAAA,GAAsB,gBAAgB,EAAEpB,GAAG,CAAC;;AAE5D","ignoreList":[]}
1
+ {"version":3,"file":"generateRuleTypes.cjs","names":[],"sources":["../src/bin/generateRuleTypes.js"],"sourcesContent":["import index from '../index.js';\nimport {\n compile,\n} from 'json-schema-to-typescript';\nimport {\n writeFile,\n} from 'node:fs/promises';\n\nlet str = 'export interface Rules {\\n';\n\nfor (const [\n ruleName,\n rule,\n] of Object.entries(\n /** @type {Record<string, import('@eslint/core').RuleDefinition<import('@eslint/core').RuleDefinitionTypeOptions>>} */ (\n index.rules\n ),\n )\n) {\n str += ` /** ${rule.meta?.docs?.description ?? ''} */\\n`;\n str += ` \"jsdoc/${ruleName}\": `;\n const ts = await compile({\n items: rule?.meta?.schema || [],\n type: 'array',\n }, 'Test', {\n bannerComment: '',\n });\n\n str += ts\n .replace(/^export type Test = ?/v, '')\n .replace(/^export interface Test /v, '')\n .replaceAll('\\n', '\\n ').trimEnd().replace(/;$/v, '') +\n ';\\n\\n';\n}\n\nstr = str.replace(/\\n$/v, '') + '}\\n';\n\nawait writeFile(import.meta.dirname + '/../rules.d.ts', str);\n\n// console.log('str', str);\n"],"mappings":"AAAA,OAAO,KAAK,MAAM,aAAa;AAC/B,SACE,OAAO,QACF,2BAA2B;AAClC,SACE,SAAS,QACJ,kBAAkB;AAEzB,IAAI,GAAG,GAAG,4BAA4B;AAEtC,KAAK,MAAM,CACT,QAAQ,EACR,IAAI,CACL,IAAI,MAAM,CAAC,OAAO,CACjB;AACI,KAAK,CAAC,KAEV,CAAC,EACD;EACA,GAAG,IAAI,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,IAAI,EAAE,OAAO;EACzD,GAAG,IAAI,YAAY,QAAQ,KAAK;EAChC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;IACvB,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE;IAC/B,IAAI,EAAE;EACR,CAAC,EAAE,MAAM,EAAE;IACT,aAAa,EAAE;EACjB,CAAC,CAAC;EAEF,GAAG,IAAI,EAAE,CACN,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CACrC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CACvC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GACpD,OAAO;AACb;AAEA,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,KAAK;AAErC,MAAM,SAAS,CAAC,YAAsB,gBAAgB,EAAE,GAAG,CAAC;;AAE5D","ignoreList":[]}
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
1
  /**
8
2
  * @typedef {Map<string, Map<string, (string|boolean)>>} TagStructure
9
3
  */
@@ -284,6 +278,5 @@ const getDefaultTagStructureForMode = mode => {
284
278
  // Shows curly brackets in the signature and in the examples
285
279
  ['typeAllowed', true]])]]);
286
280
  };
287
- var _default = exports.default = getDefaultTagStructureForMode;
288
- module.exports = exports.default;
281
+ export default getDefaultTagStructureForMode;
289
282
  //# sourceMappingURL=getDefaultTagStructureForMode.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultTagStructureForMode.cjs","names":["getDefaultTagStructureForMode","mode","isJsdoc","isClosure","isTypescript","isPermissive","isJsdocOrPermissive","isJsdocOrTypescript","isTypescriptOrClosure","isClosureOrPermissive","isJsdocTypescriptOrPermissive","Map","_default","exports","default","module"],"sources":["../src/getDefaultTagStructureForMode.js"],"sourcesContent":["/**\n * @typedef {Map<string, Map<string, (string|boolean)>>} TagStructure\n */\n/**\n * @param {import('./jsdocUtils.js').ParserMode} mode\n * @returns {TagStructure}\n */\nconst getDefaultTagStructureForMode = (mode) => {\n const isJsdoc = mode === 'jsdoc';\n const isClosure = mode === 'closure';\n const isTypescript = mode === 'typescript';\n const isPermissive = mode === 'permissive';\n\n const isJsdocOrPermissive = isJsdoc || isPermissive;\n const isJsdocOrTypescript = isJsdoc || isTypescript;\n const isTypescriptOrClosure = isTypescript || isClosure;\n const isClosureOrPermissive = isClosure || isPermissive;\n const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive;\n\n // Properties:\n // `namepathRole` - 'namepath-referencing'|'name-defining'|'namepath-defining'|'namepath-or-url-referencing'|'text'|false\n // `typeAllowed` - boolean\n // `nameRequired` - boolean\n // `typeRequired` - boolean\n // `typeOrNameRequired` - boolean\n\n // All of `typeAllowed` have a signature with \"type\" except for\n // `augments`/`extends` (\"namepath\")\n // `param`/`arg`/`argument` (no signature)\n // `property`/`prop` (no signature)\n // `modifies` (undocumented)\n\n // None of the `namepathRole: 'namepath-defining'` show as having curly\n // brackets for their name/namepath\n\n // Among `namepath-defining` and `namepath-referencing`, these do not seem\n // to allow curly brackets in their doc signature or examples (`modifies`\n // references namepaths within its type brackets)\n\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n /**\n * @type {TagStructure}\n */\n return new Map([\n [\n 'alias', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'arg', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'argument', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'augments', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'borrows', new Map(/** @type {[string, string|boolean][]} */ ([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'callback', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples); TypeScript does not enforce but seems\n // problematic as not attached so presumably not useable without it\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ])),\n ],\n\n [\n 'class', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', true,\n ],\n\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'const', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'constant', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'constructor', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'constructs', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'define', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'typeRequired', isClosure,\n ],\n ])),\n ],\n\n [\n 'emits', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'enum', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'name-defining',\n ],\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'event', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n ])),\n ],\n\n [\n 'exception', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n // Closure\n [\n 'export', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'exports', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'extends', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ])),\n ],\n\n [\n 'external', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"name\" (and a special syntax for the `external` name)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'fires', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'func', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n ])),\n ],\n [\n 'function', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'host', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'implements', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'interface', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', isClosure,\n ],\n\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'namepathRole',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'internal', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', false,\n ],\n // https://www.typescriptlang.org/tsconfig/#stripInternal\n [\n 'namepathRole', false,\n ],\n ])),\n ],\n\n [\n 'lends', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'link', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n\n ])),\n ],\n\n [\n 'linkcode', new Map(/** @type {[string, string|boolean][]} */ ([\n // Synonym for \"link\"\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n ])),\n ],\n\n [\n 'linkplain', new Map(/** @type {[string, string|boolean][]} */ ([\n // Synonym for \"link\"\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n ])),\n ],\n\n [\n 'listens', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'member', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'memberof!', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n [\n 'memberof', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'method', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n ])),\n ],\n [\n 'mixes', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'mixin', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'modifies', new Map(/** @type {[string, string|boolean][]} */ ([\n // Has no documentation, but test example has curly brackets, and\n // \"name\" would be suggested rather than \"namepath\" based on example;\n // not sure if name is required\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'module', new Map(/** @type {[string, string|boolean][]} */ ([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNameOrNamepathDefiningTag|tagMightHaveNameOrNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'namepathRole', isJsdoc ? 'namepath-defining' : 'text',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'name', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'namespace', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'package', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'param', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Though no signature provided requiring, per\n // https://jsdoc.app/tags-param.html:\n // \"The @param tag requires you to specify the name of the parameter you\n // are documenting.\"\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'private', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'prop', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `property`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'property', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // No docs indicate required, but since parallel to `param`, we treat as\n // such:\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'protected', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'public', new Map(/** @type {[string, string|boolean][]} */ ([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'requires', new Map(/** @type {[string, string|boolean][]} */ ([\n // <someModuleName>\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'return', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'returns', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'satisfies', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'see', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'namepathRole', 'text',\n ],\n ])),\n ],\n\n [\n 'static', new Map(/** @type {[string, string|boolean][]} */ ([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'suppress', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ])),\n ],\n\n [\n 'template', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n [\n 'nameRequired', !isJsdoc,\n ],\n\n // Though defines `namepathRole: 'namepath-defining'` in a sense, it is\n // not parseable in the same way for template (e.g., allowing commas),\n // so not adding\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n ])),\n ],\n\n [\n 'this', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'namepathRole', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n ])),\n ],\n\n [\n 'throws', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'tutorial', new Map(/** @type {[string, string|boolean][]} */ ([\n // (a tutorial ID)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'type', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n // \"typeName\"\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'typedef', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'namepathRole', 'name-defining',\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member;\n // also shown as missing in Closure\n // \"namepath\"\n [\n 'nameRequired', isJsdocOrPermissive,\n ],\n\n // Is not `typeRequired` for TypeScript because it gives an error:\n // JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member\n // \"namepath\"\n [\n 'typeOrNameRequired', !isTypescript,\n ],\n ])),\n ],\n\n [\n 'var', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'yield', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'yields', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n ]);\n};\n\nexport default getDefaultTagStructureForMode;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,6BAA6B,GAAIC,IAAI,IAAK;EAC9C,MAAMC,OAAO,GAAGD,IAAI,KAAK,OAAO;EAChC,MAAME,SAAS,GAAGF,IAAI,KAAK,SAAS;EACpC,MAAMG,YAAY,GAAGH,IAAI,KAAK,YAAY;EAC1C,MAAMI,YAAY,GAAGJ,IAAI,KAAK,YAAY;EAE1C,MAAMK,mBAAmB,GAAGJ,OAAO,IAAIG,YAAY;EACnD,MAAME,mBAAmB,GAAGL,OAAO,IAAIE,YAAY;EACnD,MAAMI,qBAAqB,GAAGJ,YAAY,IAAID,SAAS;EACvD,MAAMM,qBAAqB,GAAGN,SAAS,IAAIE,YAAY;EACvD,MAAMK,6BAA6B,GAAGH,mBAAmB,IAAIF,YAAY;;EAEzE;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;;EAEA;EACA;EACA;;EAEA;EACA;;EAEA;AACF;AACA;EACE,OAAO,IAAIM,GAAG,CAAC,CACb,CACE,OAAO,EAAE,IAAIA,GA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AAa,EAAE,IAAI,CACpB,CACD,CAAC,CACJ,CACF,CAAC;AACJ,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,6BAA6B;AAAAe,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"getDefaultTagStructureForMode.cjs","names":[],"sources":["../src/getDefaultTagStructureForMode.js"],"sourcesContent":["/**\n * @typedef {Map<string, Map<string, (string|boolean)>>} TagStructure\n */\n/**\n * @param {import('./jsdocUtils.js').ParserMode} mode\n * @returns {TagStructure}\n */\nconst getDefaultTagStructureForMode = (mode) => {\n const isJsdoc = mode === 'jsdoc';\n const isClosure = mode === 'closure';\n const isTypescript = mode === 'typescript';\n const isPermissive = mode === 'permissive';\n\n const isJsdocOrPermissive = isJsdoc || isPermissive;\n const isJsdocOrTypescript = isJsdoc || isTypescript;\n const isTypescriptOrClosure = isTypescript || isClosure;\n const isClosureOrPermissive = isClosure || isPermissive;\n const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive;\n\n // Properties:\n // `namepathRole` - 'namepath-referencing'|'name-defining'|'namepath-defining'|'namepath-or-url-referencing'|'text'|false\n // `typeAllowed` - boolean\n // `nameRequired` - boolean\n // `typeRequired` - boolean\n // `typeOrNameRequired` - boolean\n\n // All of `typeAllowed` have a signature with \"type\" except for\n // `augments`/`extends` (\"namepath\")\n // `param`/`arg`/`argument` (no signature)\n // `property`/`prop` (no signature)\n // `modifies` (undocumented)\n\n // None of the `namepathRole: 'namepath-defining'` show as having curly\n // brackets for their name/namepath\n\n // Among `namepath-defining` and `namepath-referencing`, these do not seem\n // to allow curly brackets in their doc signature or examples (`modifies`\n // references namepaths within its type brackets)\n\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n /**\n * @type {TagStructure}\n */\n return new Map([\n [\n 'alias', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'arg', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'argument', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'augments', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'borrows', new Map(/** @type {[string, string|boolean][]} */ ([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'callback', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples); TypeScript does not enforce but seems\n // problematic as not attached so presumably not useable without it\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ])),\n ],\n\n [\n 'class', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', true,\n ],\n\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'const', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'constant', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'constructor', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'constructs', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'define', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'typeRequired', isClosure,\n ],\n ])),\n ],\n\n [\n 'emits', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'enum', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'name-defining',\n ],\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'event', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n ])),\n ],\n\n [\n 'exception', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n // Closure\n [\n 'export', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'exports', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'extends', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ])),\n ],\n\n [\n 'external', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"name\" (and a special syntax for the `external` name)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'fires', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'func', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n ])),\n ],\n [\n 'function', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'host', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'implements', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'interface', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', isClosure,\n ],\n\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'namepathRole',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'internal', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', false,\n ],\n // https://www.typescriptlang.org/tsconfig/#stripInternal\n [\n 'namepathRole', false,\n ],\n ])),\n ],\n\n [\n 'lends', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'link', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n\n ])),\n ],\n\n [\n 'linkcode', new Map(/** @type {[string, string|boolean][]} */ ([\n // Synonym for \"link\"\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n ])),\n ],\n\n [\n 'linkplain', new Map(/** @type {[string, string|boolean][]} */ ([\n // Synonym for \"link\"\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n ])),\n ],\n\n [\n 'listens', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'member', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'memberof!', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n [\n 'memberof', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'method', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n ])),\n ],\n [\n 'mixes', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'mixin', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'modifies', new Map(/** @type {[string, string|boolean][]} */ ([\n // Has no documentation, but test example has curly brackets, and\n // \"name\" would be suggested rather than \"namepath\" based on example;\n // not sure if name is required\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'module', new Map(/** @type {[string, string|boolean][]} */ ([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNameOrNamepathDefiningTag|tagMightHaveNameOrNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'namepathRole', isJsdoc ? 'namepath-defining' : 'text',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'name', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'namespace', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'package', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'param', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Though no signature provided requiring, per\n // https://jsdoc.app/tags-param.html:\n // \"The @param tag requires you to specify the name of the parameter you\n // are documenting.\"\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'private', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'prop', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `property`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'property', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // No docs indicate required, but since parallel to `param`, we treat as\n // such:\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'protected', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'public', new Map(/** @type {[string, string|boolean][]} */ ([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'requires', new Map(/** @type {[string, string|boolean][]} */ ([\n // <someModuleName>\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'return', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'returns', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'satisfies', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'see', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'namepathRole', 'text',\n ],\n ])),\n ],\n\n [\n 'static', new Map(/** @type {[string, string|boolean][]} */ ([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'suppress', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ])),\n ],\n\n [\n 'template', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n [\n 'nameRequired', !isJsdoc,\n ],\n\n // Though defines `namepathRole: 'namepath-defining'` in a sense, it is\n // not parseable in the same way for template (e.g., allowing commas),\n // so not adding\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n ])),\n ],\n\n [\n 'this', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'namepathRole', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n ])),\n ],\n\n [\n 'throws', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'tutorial', new Map(/** @type {[string, string|boolean][]} */ ([\n // (a tutorial ID)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'type', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n // \"typeName\"\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'typedef', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'namepathRole', 'name-defining',\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member;\n // also shown as missing in Closure\n // \"namepath\"\n [\n 'nameRequired', isJsdocOrPermissive,\n ],\n\n // Is not `typeRequired` for TypeScript because it gives an error:\n // JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member\n // \"namepath\"\n [\n 'typeOrNameRequired', !isTypescript,\n ],\n ])),\n ],\n\n [\n 'var', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'yield', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'yields', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n ]);\n};\n\nexport default getDefaultTagStructureForMode;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,6BAA6B,GAAI,IAAI,IAAK;EAC9C,MAAM,OAAO,GAAG,IAAI,KAAK,OAAO;EAChC,MAAM,SAAS,GAAG,IAAI,KAAK,SAAS;EACpC,MAAM,YAAY,GAAG,IAAI,KAAK,YAAY;EAC1C,MAAM,YAAY,GAAG,IAAI,KAAK,YAAY;EAE1C,MAAM,mBAAmB,GAAG,OAAO,IAAI,YAAY;EACnD,MAAM,mBAAmB,GAAG,OAAO,IAAI,YAAY;EACnD,MAAM,qBAAqB,GAAG,YAAY,IAAI,SAAS;EACvD,MAAM,qBAAqB,GAAG,SAAS,IAAI,YAAY;EACvD,MAAM,6BAA6B,GAAG,mBAAmB,I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,CACD,CAAC,CACJ,EACD,CACE,QAAQ,EAAE,IAAI,GAAG,CAAC,yCAA2C;EAC3D;EACA,CACE,aAAa,EAAE,IAAI,CACpB,CACD,CAAC,CACJ,CACF,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B","ignoreList":[]}
@@ -1,16 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getJsdocProcessorPlugin = void 0;
7
- var _jsdocUtils = require("./jsdocUtils.cjs");
8
- var _jsdoccomment = require("@es-joy/jsdoccomment");
9
- var espree = _interopRequireWildcard(require("espree"));
10
- var _htmlEntities = require("html-entities");
11
- var _nodeFs = require("node:fs");
12
- var _nodePath = require("node:path");
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
1
+ import { forEachPreferredTag, getPreferredTagName, getRegexFromString, getTagDescription, hasTag } from './jsdocUtils.js';
2
+ import { parseComment } from '@es-joy/jsdoccomment';
3
+ import * as espree from 'espree';
4
+ import { decode } from 'html-entities';
5
+ import { readFileSync } from 'node:fs';
6
+ import { join } from 'node:path';
14
7
  /**
15
8
  * @import {
16
9
  * Integer,
@@ -24,7 +17,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
24
17
 
25
18
  const {
26
19
  version
27
- } = JSON.parse((0, _nodeFs.readFileSync)((0, _nodePath.join)(__dirname, '../package.json'), 'utf8'));
20
+ } = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
28
21
 
29
22
  // const zeroBasedLineIndexAdjust = -1;
30
23
  const likelyNestedJSDocIndentSpace = 1;
@@ -92,7 +85,7 @@ const getLinesCols = text => {
92
85
  * @param {JsdocProcessorOptions} [options]
93
86
  * @returns {ESLint.Plugin}
94
87
  */
95
- const getJsdocProcessorPlugin = (options = {}) => {
88
+ export const getJsdocProcessorPlugin = (options = {}) => {
96
89
  /**
97
90
  * @typedef {{
98
91
  * text: string,
@@ -123,10 +116,10 @@ const getJsdocProcessorPlugin = (options = {}) => {
123
116
  /** @type {RegExp} */
124
117
  let rejectExampleCodeRegExp;
125
118
  if (exampleCodeRegex) {
126
- exampleCodeRegExp = typeof exampleCodeRegex === 'string' ? (0, _jsdocUtils.getRegexFromString)(exampleCodeRegex) : exampleCodeRegex;
119
+ exampleCodeRegExp = typeof exampleCodeRegex === 'string' ? getRegexFromString(exampleCodeRegex) : exampleCodeRegex;
127
120
  }
128
121
  if (rejectExampleCodeRegex) {
129
- rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === 'string' ? (0, _jsdocUtils.getRegexFromString)(rejectExampleCodeRegex) : rejectExampleCodeRegex;
122
+ rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === 'string' ? getRegexFromString(rejectExampleCodeRegex) : rejectExampleCodeRegex;
130
123
  }
131
124
 
132
125
  /**
@@ -242,7 +235,7 @@ const getJsdocProcessorPlugin = (options = {}) => {
242
235
  if (/^#x\d+$/v.test(code)) {
243
236
  return String.fromCodePoint(Number.parseInt(code.slice(2), 16));
244
237
  }
245
- return (0, _htmlEntities.decode)(_, {
238
+ return decode(_, {
246
239
  level: 'html5'
247
240
  });
248
241
  })
@@ -290,12 +283,12 @@ const getJsdocProcessorPlugin = (options = {}) => {
290
283
  };
291
284
  if (checkDefaults) {
292
285
  const filenameInfo = getFilenameInfo(matchingFileNameDefaults, 'jsdoc-defaults');
293
- (0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'default', (tag, targetTagName) => {
286
+ forEachPreferredTag(jsdoc, 'default', (tag, targetTagName) => {
294
287
  if (!tag.description.trim()) {
295
288
  return;
296
289
  }
297
290
  checkSource({
298
- source: `(${(0, _jsdocUtils.getTagDescription)(tag)})`,
291
+ source: `(${getTagDescription(tag)})`,
299
292
  targetTagName,
300
293
  ...filenameInfo
301
294
  });
@@ -303,7 +296,7 @@ const getJsdocProcessorPlugin = (options = {}) => {
303
296
  }
304
297
  if (checkParams) {
305
298
  const filenameInfo = getFilenameInfo(matchingFileNameParams, 'jsdoc-params');
306
- (0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'param', (tag, targetTagName) => {
299
+ forEachPreferredTag(jsdoc, 'param', (tag, targetTagName) => {
307
300
  if (!tag.default || !tag.default.trim()) {
308
301
  return;
309
302
  }
@@ -316,7 +309,7 @@ const getJsdocProcessorPlugin = (options = {}) => {
316
309
  }
317
310
  if (checkProperties) {
318
311
  const filenameInfo = getFilenameInfo(matchingFileNameProperties, 'jsdoc-properties');
319
- (0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'property', (tag, targetTagName) => {
312
+ forEachPreferredTag(jsdoc, 'property', (tag, targetTagName) => {
320
313
  if (!tag.default || !tag.default.trim()) {
321
314
  return;
322
315
  }
@@ -330,15 +323,15 @@ const getJsdocProcessorPlugin = (options = {}) => {
330
323
  if (!checkExamples) {
331
324
  return textsAndFileNames;
332
325
  }
333
- const tagName = /** @type {string} */(0, _jsdocUtils.getPreferredTagName)(jsdoc, {
326
+ const tagName = /** @type {string} */getPreferredTagName(jsdoc, {
334
327
  tagName: 'example'
335
328
  });
336
- if (!(0, _jsdocUtils.hasTag)(jsdoc, tagName)) {
329
+ if (!hasTag(jsdoc, tagName)) {
337
330
  return textsAndFileNames;
338
331
  }
339
332
  const matchingFilenameInfo = getFilenameInfo(matchingFileName);
340
- (0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'example', (tag, targetTagName) => {
341
- let source = /** @type {string} */(0, _jsdocUtils.getTagDescription)(tag);
333
+ forEachPreferredTag(jsdoc, 'example', (tag, targetTagName) => {
334
+ let source = /** @type {string} */getTagDescription(tag);
342
335
  const match = source.match(hasCaptionRegex);
343
336
  if (captionRequired && (!match || !match[1].trim())) {
344
337
  extraMessages.push({
@@ -559,7 +552,7 @@ const getJsdocProcessorPlugin = (options = {}) => {
559
552
  // ? 0
560
553
  // : textToStart.slice(lastLinePos).length;
561
554
  commentLineCols.push([lines, cols]);
562
- return (0, _jsdoccomment.parseComment)(comment);
555
+ return parseComment(comment);
563
556
  });
564
557
  return [text, ...jsdocComments.flatMap((jsdoc, idx) => {
565
558
  return getTextsAndFileNames(jsdoc, filename, commentLineCols[idx]);
@@ -583,5 +576,4 @@ const getJsdocProcessorPlugin = (options = {}) => {
583
576
  }
584
577
  };
585
578
  };
586
- exports.getJsdocProcessorPlugin = getJsdocProcessorPlugin;
587
579
  //# sourceMappingURL=getJsdocProcessorPlugin.cjs.map