eslint-plugin-jsdoc 37.9.0 → 37.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1 -1
- package/README.md +25 -1
- package/dist/exportParser.js +3 -3
- package/dist/exportParser.js.map +1 -1
- package/dist/getDefaultTagStructureForMode.js +19 -14
- package/dist/getDefaultTagStructureForMode.js.map +1 -1
- package/dist/iterateJsdoc.js +4 -0
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/jsdocUtils.js +143 -0
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/checkParamNames.js +24 -0
- package/dist/rules/checkParamNames.js.map +1 -1
- package/dist/rules/checkPropertyNames.js +15 -0
- package/dist/rules/checkPropertyNames.js.map +1 -1
- package/dist/rules/requireParam.js +6 -0
- package/dist/rules/requireParam.js.map +1 -1
- package/dist/rules/validTypes.js +1 -0
- package/dist/rules/validTypes.js.map +1 -1
- package/package.json +21 -12
package/CONTRIBUTING.md
CHANGED
|
@@ -55,7 +55,7 @@ can use `npm run test-index`.
|
|
|
55
55
|
To test specific rules, you can supply a comma-separated list with the `--rule`
|
|
56
56
|
flag passed to `test-index`, e.g., for `check-examples` and `require-example`:
|
|
57
57
|
|
|
58
|
-
`npm run --rule=check-examples,require-example
|
|
58
|
+
`npm run test-index --rule=check-examples,require-example`.
|
|
59
59
|
|
|
60
60
|
You can further limit this by providing `--invalid` and/or `--valid` flags
|
|
61
61
|
with a comma-separated list of 0-based indexes that you wish to include (also
|
package/README.md
CHANGED
|
@@ -9261,6 +9261,12 @@ const MY_ENUM = Object.freeze({
|
|
|
9261
9261
|
VAL_A: "myvala"
|
|
9262
9262
|
} as const);
|
|
9263
9263
|
// "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag ~ JsdocTag[tag=/private|protected/])","context":"any","message":"Access modifier tags must come first"},{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"enum\"])","context":":declaration:not(TSEnumDeclaration):not(:has(ObjectExpression)), :function","message":"@enum is only allowed on potential enum types"}]}]
|
|
9264
|
+
|
|
9265
|
+
/**
|
|
9266
|
+
* @param {(...args: any[]) => any} fn
|
|
9267
|
+
* @returns {(...args: any[]) => any}
|
|
9268
|
+
*/
|
|
9269
|
+
// "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock:has(JsdocTag[tag=\"type\"]:has([value=/FunctionComponent/]))","context":"any","message":"The `FunctionComponent` type is not allowed. Please use `FC` instead."}]}]
|
|
9264
9270
|
````
|
|
9265
9271
|
|
|
9266
9272
|
|
|
@@ -13316,6 +13322,24 @@ export const outer = () => {
|
|
|
13316
13322
|
};
|
|
13317
13323
|
// "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
|
|
13318
13324
|
// Message: Missing JSDoc comment.
|
|
13325
|
+
|
|
13326
|
+
/**
|
|
13327
|
+
*
|
|
13328
|
+
*/
|
|
13329
|
+
export class InovaAutoCompleteComponent {
|
|
13330
|
+
public disabled = false;
|
|
13331
|
+
}
|
|
13332
|
+
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"],"publicOnly":true}]
|
|
13333
|
+
// Message: Missing JSDoc comment.
|
|
13334
|
+
|
|
13335
|
+
/**
|
|
13336
|
+
* Some comment.
|
|
13337
|
+
*/
|
|
13338
|
+
export class Component {
|
|
13339
|
+
public foo?: number;
|
|
13340
|
+
}
|
|
13341
|
+
// "jsdoc/require-jsdoc": ["error"|"warn", {"checkConstructors":false,"contexts":["PropertyDefinition"],"publicOnly":true}]
|
|
13342
|
+
// Message: Missing JSDoc comment.
|
|
13319
13343
|
````
|
|
13320
13344
|
|
|
13321
13345
|
The following patterns are not considered problems:
|
|
@@ -21275,7 +21299,7 @@ function quux() {
|
|
|
21275
21299
|
|
|
21276
21300
|
/**
|
|
21277
21301
|
*
|
|
21278
|
-
* @fires
|
|
21302
|
+
* @fires module:namespace.SomeClass#event:ext_anevent
|
|
21279
21303
|
*/
|
|
21280
21304
|
function quux() {
|
|
21281
21305
|
|
package/dist/exportParser.js
CHANGED
|
@@ -489,11 +489,11 @@ const getExportAncestor = function (nde) {
|
|
|
489
489
|
return false;
|
|
490
490
|
};
|
|
491
491
|
|
|
492
|
-
const
|
|
493
|
-
const canExportChildrenType = new Set(['TSInterfaceBody', 'TSInterfaceDeclaration', 'ClassDefinition', 'ClassExpression', 'Program']);
|
|
492
|
+
const canBeExportedByAncestorType = new Set(['TSPropertySignature', 'TSMethodSignature', 'ClassProperty', 'PropertyDefinition', 'Method']);
|
|
493
|
+
const canExportChildrenType = new Set(['TSInterfaceBody', 'TSInterfaceDeclaration', 'ClassDeclaration', 'ClassBody', 'ClassDefinition', 'ClassExpression', 'Program']);
|
|
494
494
|
|
|
495
495
|
const isExportByAncestor = function (nde) {
|
|
496
|
-
if (!
|
|
496
|
+
if (!canBeExportedByAncestorType.has(nde.type)) {
|
|
497
497
|
return false;
|
|
498
498
|
}
|
|
499
499
|
|
package/dist/exportParser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/exportParser.js"],"names":["debug","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","obj","object","propertySymbol","property","computed","propertyValue","val","prototype","left","right","method","body","key","prop","properties","includes","propVal","createBlockSymbol","isGlobal","window","special","id","valueSymbol","initVariables","childNode","expression","declaration","declarations","initWindow","kind","mapVariables","isExport","ancestorsOnly","init","exported","ANONYMOUS_DEFAULT","specifier","specifiers","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","ignorableNestedTypes","getExportAncestor","nde","idx","ignorableIfDeep","has","parent","canExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","isNodeExported","initModuleExports","module","exports","esm","parseRecursive","globalVars","parse","ast","isUncommentedExport","sourceCode","settings","exportNode","parseResult"],"mappings":";;;;;;;AAAA;;AAGA;;;;AAEA,MAAMA,KAAK,GAAG,oBAAY,oBAAZ,CAAd;;AAEA,MAAMC,UAAU,GAAG,YAAY;AAC7B,SAAO;AACLC,IAAAA,KAAK,EAAE;AADF,GAAP;AAGD,CAJD;;AAMA,MAAMC,cAAc,GAAG,UAAUC,MAAV,EAAkB;AACvC;AACA,MAAI,CAACA,MAAL,EAAa;AACX;AACA,WAAO,IAAP;AACD;AAED;;;AACA,MAAIA,MAAM,CAACC,IAAP,KAAgB,SAApB,EAA+B;AAC7B,WAAOD,MAAM,CAACE,KAAP,CAAaA,KAApB;AACD;AAED;;;AACA,SAAO,IAAP;AACD,CAdD;;AAgBA,MAAMC,aAAa,GAAG,UAAUC,IAAV,EAAgBC,OAAhB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsC;AAC1D,MAAIA,IAAI,CAACC,gBAAT,EAA2B;AACzB;AACA,UAAMC,iBAAiB,GAAGZ,UAAU,EAApC;AACAY,IAAAA,iBAAiB,CAACR,IAAlB,GAAyB,SAAzB;AACAQ,IAAAA,iBAAiB,CAACP,KAAlB,GAA0B;AACxBA,MAAAA,KAAK,EAAEE,IAAI,CAACM;AADY,KAA1B;AAIA,WAAOD,iBAAP;AACD;AAED;;;AACA,QAAME,KAAK,GAAGL,KAAK,IAAID,OAAvB,CAb0D,CAe1D;;AACA,MAAIM,KAAK,CAACb,KAAN,CAAYM,IAAI,CAACM,IAAjB,CAAJ,EAA4B;AAC1B,WAAOC,KAAK,CAACb,KAAN,CAAYM,IAAI,CAACM,IAAjB,CAAP;AACD,GAlByD,CAoB1D;;AACA;;;AACA,MAAIL,OAAO,CAACP,KAAR,CAAcM,IAAI,CAACM,IAAnB,CAAJ,EAA8B;AAC5B,WAAOL,OA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UnF,IAAV,EAAgBoF,UAAhB,EAA4B1E,GAA5B,EAAiC2E,QAAjC,EAA2C;AACrE;AACA;AACA,MAAI3E,GAAG,CAACoE,GAAR,EAAa;AACX,UAAMQ,UAAU,GAAGtB,iBAAiB,CAAChE,IAAD,CAApC,CADW,CAGX;;AACA,QAAIsF,UAAU,IAAI,CAAC,oCAAiBA,UAAjB,EAA6BF,UAA7B,EAAyCC,QAAzC,CAAnB,EAAuE;AACrE,aAAO,IAAP;AACD;AAED;AACJ;AACA;;;AACI,QACEb,kBAAkB,CAACxE,IAAD,CAAlB,IACA,CAAC,oCAAiBA,IAAjB,EAAuBoF,UAAvB,EAAmCC,QAAnC,CAFH,EAGE;AACA,aAAO,IAAP;AACD;AACF;;AAED,QAAME,WAAW,GAAGN,KAAK,CAACG,UAAU,CAACF,GAAZ,EAAiBlF,IAAjB,EAAuBU,GAAvB,CAAzB;AAEA,SAAOgE,cAAc,CAAC1E,IAAD,EAAOuF,WAAW,CAACP,UAAnB,EAA+BtE,GAA/B,CAArB;AACD,CAzBD;;eA2Be;AACbyE,EAAAA,mBADa;AAEbF,EAAAA;AAFa,C","sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\nconst getSymbolValue = function (symbol) {\n /* istanbul ignore next */\n if (!symbol) {\n /* istanbul ignore next */\n return null;\n }\n\n /* istanbul ignore next */\n if (symbol.type === 'literal') {\n return symbol.value.value;\n }\n\n /* istanbul ignore next */\n return null;\n};\n\nconst getIdentifier = function (node, globals, scope, opts) {\n if (opts.simpleIdentifier) {\n // Type is Identier for noncomputed properties\n const identifierLiteral = createNode();\n identifierLiteral.type = 'literal';\n identifierLiteral.value = {\n value: node.name,\n };\n\n return identifierLiteral;\n }\n\n /* istanbul ignore next */\n const block = scope || globals;\n\n // As scopes are not currently supported, they are not traversed upwards recursively\n if (block.props[node.name]) {\n return block.props[node.name];\n }\n\n // Seems this will only be entered once scopes added and entered\n /* istanbul ignore next */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\nlet createSymbol = null;\n\n// eslint-disable-next-line complexity\nconst getSymbol = function (node, globals, scope, opt) {\n const opts = opt || {};\n /* istanbul ignore next */\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n }\n\n case 'MemberExpression': {\n const obj = getSymbol(node.object, globals, scope, opts);\n const propertySymbol = getSymbol(node.property, globals, scope, {\n simpleIdentifier: !node.computed,\n });\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* istanbul ignore next */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n /* istanbul ignore next */\n debug(`MemberExpression: Missing property ${node.property.name}`);\n\n /* istanbul ignore next */\n return null;\n }\n\n case 'TSTypeAliasDeclaration':\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n case 'ClassDeclaration': case 'ClassExpression':\n case 'FunctionExpression': case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n const val = createNode();\n val.props.prototype = createNode();\n val.props.prototype.type = 'object';\n val.type = 'object';\n val.value = node;\n\n return val;\n }\n\n case 'AssignmentExpression': {\n return createSymbol(node.left, globals, node.right, scope, opts);\n }\n\n case 'ClassBody': {\n const val = createNode();\n for (const method of node.body) {\n val.props[method.key.name] = createNode();\n val.props[method.key.name].type = 'object';\n val.props[method.key.name].value = method.value;\n }\n\n val.type = 'object';\n val.value = node;\n\n return val;\n }\n\n case 'ObjectExpression': {\n const val = createNode();\n val.type = 'object';\n for (const prop of node.properties) {\n if ([\n // @typescript-eslint/parser, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n continue;\n }\n\n const propVal = getSymbol(prop.value, globals, scope, opts);\n /* istanbul ignore next */\n if (propVal) {\n val.props[prop.key.name] = propVal;\n }\n }\n\n return val;\n }\n\n case 'Literal': {\n const val = createNode();\n val.type = 'literal';\n val.value = node;\n\n return val;\n }\n }\n\n /* istanbul ignore next */\n return null;\n};\n\nconst createBlockSymbol = function (block, name, value, globals, isGlobal) {\n block.props[name] = value;\n if (isGlobal && globals.props.window && globals.props.window.special) {\n globals.props.window.props[name] = value;\n }\n};\n\ncreateSymbol = function (node, globals, value, scope, isGlobal) {\n const block = scope || globals;\n let symbol;\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'FunctionDeclaration':\n /* istanbul ignore next */\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* istanbul ignore next */\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n /* istanbul ignore next */\n if (node.id && node.id.type === 'Identifier') {\n return createSymbol(node.id, globals, node, globals);\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'Identifier': {\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* istanbul ignore next */\n if (valueSymbol) {\n createBlockSymbol(block, node.name, valueSymbol, globals, isGlobal);\n\n return block.props[node.name];\n }\n\n /* istanbul ignore next */\n debug('Identifier: Missing value symbol for %s', node.name);\n } else {\n createBlockSymbol(block, node.name, createNode(), globals, isGlobal);\n\n return block.props[node.name];\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'MemberExpression': {\n symbol = getSymbol(node.object, globals, block);\n\n const propertySymbol = getSymbol(node.property, globals, block, {\n simpleIdentifier: !node.computed,\n });\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(value, globals, block), globals, isGlobal);\n\n return symbol.props[propertyValue];\n }\n\n /* istanbul ignore next */\n debug('MemberExpression: Missing symbol: %s', node.property.name);\n break;\n }\n }\n\n return null;\n};\n\n// Creates variables from variable definitions\nconst initVariables = function (node, globals, opts) {\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Program': {\n for (const childNode of node.body) {\n initVariables(childNode, globals, opts);\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n initVariables(node.expression, globals, opts);\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n // let and const\n const symbol = createSymbol(declaration.id, globals, null, globals);\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[declaration.id.name] = symbol;\n }\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(node.declaration, globals, opts);\n }\n\n break;\n }\n }\n};\n\n// Populates variable maps using AST\n// eslint-disable-next-line complexity\nconst mapVariables = function (node, globals, opt, isExport) {\n /* istanbul ignore next */\n const opts = opt || {};\n /* istanbul ignore next */\n switch (node.type) {\n case 'Program': {\n if (opts.ancestorsOnly) {\n return false;\n }\n\n for (const childNode of node.body) {\n mapVariables(childNode, globals, opts);\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n mapVariables(node.expression, globals, opts);\n break;\n }\n\n case 'AssignmentExpression': {\n createSymbol(node.left, globals, node.right);\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n const isGlobal = opts.initWindow && node.kind === 'var' && globals.props.window;\n const symbol = createSymbol(declaration.id, globals, declaration.init, globals, isGlobal);\n if (symbol && isExport) {\n symbol.exported = true;\n }\n }\n\n break;\n }\n\n case 'FunctionDeclaration': {\n /* istanbul ignore next */\n if (node.id.type === 'Identifier') {\n createSymbol(node.id, globals, node, globals, true);\n }\n\n break;\n }\n\n case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(node.declaration, globals, node.declaration);\n if (symbol) {\n symbol.exported = true;\n } else if (!node.id) {\n globals.ANONYMOUS_DEFAULT = node.declaration;\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(node.declaration, globals, opts, true);\n } else {\n const symbol = createSymbol(node.declaration, globals, node.declaration);\n /* istanbul ignore next */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n\n for (const specifier of node.specifiers) {\n mapVariables(specifier, globals, opts);\n }\n\n break;\n }\n\n case 'ExportSpecifier': {\n const symbol = getSymbol(node.local, globals, globals);\n /* istanbul ignore next */\n if (symbol) {\n symbol.exported = true;\n }\n\n break;\n }\n\n case 'ClassDeclaration': {\n createSymbol(node.id, globals, node.body, globals);\n break;\n }\n\n default: {\n /* istanbul ignore next */\n return false;\n }\n }\n\n return true;\n};\n\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n /* istanbul ignore next */\n if (!block || blockCache.includes(block)) {\n return false;\n }\n\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n const {\n props = block.body,\n } = block;\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* istanbul ignore if */\n if (propval.some((val) => {\n return findNode(node, val, blockCache);\n })) {\n return true;\n }\n } else if (findNode(node, propval, blockCache)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst exportTypes = new Set([\n 'ExportNamedDeclaration', 'ExportDefaultDeclaration',\n]);\nconst ignorableNestedTypes = new Set([\n 'FunctionDeclaration', 'ArrowFunctionExpression', 'FunctionExpression',\n]);\nconst getExportAncestor = function (nde) {\n let node = nde;\n let idx = 0;\n const ignorableIfDeep = ignorableNestedTypes.has(nde?.type);\n while (node) {\n // Ignore functions nested more deeply than say `export default function () {}`\n if (idx >= 2 && ignorableIfDeep) {\n break;\n }\n\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n node = node.parent;\n idx++;\n }\n\n return false;\n};\n\nconst canExportedByAncestorType = new Set([\n 'TSPropertySignature',\n 'TSMethodSignature',\n 'ClassProperty',\n 'Method',\n]);\n\nconst canExportChildrenType = new Set([\n 'TSInterfaceBody',\n 'TSInterfaceDeclaration',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\nconst isExportByAncestor = function (nde) {\n if (!canExportedByAncestorType.has(nde.type)) {\n return false;\n }\n\n let node = nde.parent;\n while (node) {\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n if (!canExportChildrenType.has(node.type)) {\n return false;\n }\n\n node = node.parent;\n }\n\n return false;\n};\n\nconst findExportedNode = function (block, node, cache) {\n /* istanbul ignore next */\n if (block === null) {\n return false;\n }\n\n const blockCache = cache || [];\n const {\n props,\n } = block;\n for (const propval of Object.values(props)) {\n blockCache.push(propval);\n if (propval.exported && (node === propval.value || findNode(node, propval.value))) {\n return true;\n }\n\n // No need to check `propval` for exported nodes as ESM\n // exports are only global\n }\n\n return false;\n};\n\nconst isNodeExported = function (node, globals, opt) {\n if (\n opt.initModuleExports && globals.props.module && globals.props.module.props.exports &&\n findNode(node, globals.props.module.props.exports)\n ) {\n return true;\n }\n\n if (opt.initWindow && globals.props.window && findNode(node, globals.props.window)) {\n return true;\n }\n\n if (opt.esm && findExportedNode(globals, node)) {\n return true;\n }\n\n return false;\n};\n\nconst parseRecursive = function (node, globalVars, opts) {\n // Iterate from top using recursion - stop at first processed node from top\n if (node.parent && parseRecursive(node.parent, globalVars, opts)) {\n return true;\n }\n\n return mapVariables(node, globalVars, opts);\n};\n\nconst parse = function (ast, node, opt) {\n /* istanbul ignore next */\n const opts = opt || {\n ancestorsOnly: false,\n esm: true,\n initModuleExports: true,\n initWindow: true,\n };\n\n const globalVars = createNode();\n if (opts.initModuleExports) {\n globalVars.props.module = createNode();\n globalVars.props.module.props.exports = createNode();\n globalVars.props.exports = globalVars.props.module.props.exports;\n }\n\n if (opts.initWindow) {\n globalVars.props.window = createNode();\n globalVars.props.window.special = true;\n }\n\n if (opts.ancestorsOnly) {\n parseRecursive(node, globalVars, opts);\n } else {\n initVariables(ast, globalVars, opts);\n mapVariables(ast, globalVars, opts);\n }\n\n return {\n globalVars,\n };\n};\n\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n const exportNode = getExportAncestor(node);\n\n // Is export node comment\n if (exportNode && !findJSDocComment(exportNode, sourceCode, settings)) {\n return true;\n }\n\n /**\n * Some typescript types are not in variable map, but inherit exported (interface property and method)\n */\n if (\n isExportByAncestor(node) &&\n !findJSDocComment(node, sourceCode, settings)\n ) {\n return true;\n }\n }\n\n const parseResult = parse(sourceCode.ast, node, opt);\n\n return isNodeExported(node, parseResult.globalVars, opt);\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"file":"exportParser.js"}
|
|
1
|
+
{"version":3,"sources":["../src/exportParser.js"],"names":["debug","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","obj","object","propertySymbol","property","computed","propertyValue","val","prototype","left","right","method","body","key","prop","properties","includes","propVal","createBlockSymbol","isGlobal","window","special","id","valueSymbol","initVariables","childNode","expression","declaration","declarations","initWindow","kind","mapVariables","isExport","ancestorsOnly","init","exported","ANONYMOUS_DEFAULT","specifier","specifiers","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","ignorableNestedTypes","getExportAncestor","nde","idx","ignorableIfDeep","has","parent","canBeExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","isNodeExported","initModuleExports","module","exports","esm","parseRecursive","globalVars","parse","ast","isUncommentedExport","sourceCode","settings","exportNode","parseResult"],"mappings":";;;;;;;AAAA;;AAGA;;;;AAEA,MAAMA,KAAK,GAAG,oBAAY,oBAAZ,CAAd;;AAEA,MAAMC,UAAU,GAAG,YAAY;AAC7B,SAAO;AACLC,IAAAA,KAAK,EAAE;AADF,GAAP;AAGD,CAJD;;AAMA,MAAMC,cAAc,GAAG,UAAUC,MAAV,EAAkB;AACvC;AACA,MAAI,CAACA,MAAL,EA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AACxE,IAAD,CAAlB,IACA,CAAC,oCAAiBA,IAAjB,EAAuBoF,UAAvB,EAAmCC,QAAnC,CAFH,EAGE;AACA,aAAO,IAAP;AACD;AACF;;AAED,QAAME,WAAW,GAAGN,KAAK,CAACG,UAAU,CAACF,GAAZ,EAAiBlF,IAAjB,EAAuBU,GAAvB,CAAzB;AAEA,SAAOgE,cAAc,CAAC1E,IAAD,EAAOuF,WAAW,CAACP,UAAnB,EAA+BtE,GAA/B,CAArB;AACD,CAzBD;;eA2Be;AACbyE,EAAAA,mBADa;AAEbF,EAAAA;AAFa,C","sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\nconst getSymbolValue = function (symbol) {\n /* istanbul ignore next */\n if (!symbol) {\n /* istanbul ignore next */\n return null;\n }\n\n /* istanbul ignore next */\n if (symbol.type === 'literal') {\n return symbol.value.value;\n }\n\n /* istanbul ignore next */\n return null;\n};\n\nconst getIdentifier = function (node, globals, scope, opts) {\n if (opts.simpleIdentifier) {\n // Type is Identier for noncomputed properties\n const identifierLiteral = createNode();\n identifierLiteral.type = 'literal';\n identifierLiteral.value = {\n value: node.name,\n };\n\n return identifierLiteral;\n }\n\n /* istanbul ignore next */\n const block = scope || globals;\n\n // As scopes are not currently supported, they are not traversed upwards recursively\n if (block.props[node.name]) {\n return block.props[node.name];\n }\n\n // Seems this will only be entered once scopes added and entered\n /* istanbul ignore next */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\nlet createSymbol = null;\n\n// eslint-disable-next-line complexity\nconst getSymbol = function (node, globals, scope, opt) {\n const opts = opt || {};\n /* istanbul ignore next */\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n }\n\n case 'MemberExpression': {\n const obj = getSymbol(node.object, globals, scope, opts);\n const propertySymbol = getSymbol(node.property, globals, scope, {\n simpleIdentifier: !node.computed,\n });\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* istanbul ignore next */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n /* istanbul ignore next */\n debug(`MemberExpression: Missing property ${node.property.name}`);\n\n /* istanbul ignore next */\n return null;\n }\n\n case 'TSTypeAliasDeclaration':\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n case 'ClassDeclaration': case 'ClassExpression':\n case 'FunctionExpression': case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n const val = createNode();\n val.props.prototype = createNode();\n val.props.prototype.type = 'object';\n val.type = 'object';\n val.value = node;\n\n return val;\n }\n\n case 'AssignmentExpression': {\n return createSymbol(node.left, globals, node.right, scope, opts);\n }\n\n case 'ClassBody': {\n const val = createNode();\n for (const method of node.body) {\n val.props[method.key.name] = createNode();\n val.props[method.key.name].type = 'object';\n val.props[method.key.name].value = method.value;\n }\n\n val.type = 'object';\n val.value = node;\n\n return val;\n }\n\n case 'ObjectExpression': {\n const val = createNode();\n val.type = 'object';\n for (const prop of node.properties) {\n if ([\n // @typescript-eslint/parser, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n continue;\n }\n\n const propVal = getSymbol(prop.value, globals, scope, opts);\n /* istanbul ignore next */\n if (propVal) {\n val.props[prop.key.name] = propVal;\n }\n }\n\n return val;\n }\n\n case 'Literal': {\n const val = createNode();\n val.type = 'literal';\n val.value = node;\n\n return val;\n }\n }\n\n /* istanbul ignore next */\n return null;\n};\n\nconst createBlockSymbol = function (block, name, value, globals, isGlobal) {\n block.props[name] = value;\n if (isGlobal && globals.props.window && globals.props.window.special) {\n globals.props.window.props[name] = value;\n }\n};\n\ncreateSymbol = function (node, globals, value, scope, isGlobal) {\n const block = scope || globals;\n let symbol;\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'FunctionDeclaration':\n /* istanbul ignore next */\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* istanbul ignore next */\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n /* istanbul ignore next */\n if (node.id && node.id.type === 'Identifier') {\n return createSymbol(node.id, globals, node, globals);\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'Identifier': {\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* istanbul ignore next */\n if (valueSymbol) {\n createBlockSymbol(block, node.name, valueSymbol, globals, isGlobal);\n\n return block.props[node.name];\n }\n\n /* istanbul ignore next */\n debug('Identifier: Missing value symbol for %s', node.name);\n } else {\n createBlockSymbol(block, node.name, createNode(), globals, isGlobal);\n\n return block.props[node.name];\n }\n\n /* istanbul ignore next */\n break;\n }\n\n case 'MemberExpression': {\n symbol = getSymbol(node.object, globals, block);\n\n const propertySymbol = getSymbol(node.property, globals, block, {\n simpleIdentifier: !node.computed,\n });\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(value, globals, block), globals, isGlobal);\n\n return symbol.props[propertyValue];\n }\n\n /* istanbul ignore next */\n debug('MemberExpression: Missing symbol: %s', node.property.name);\n break;\n }\n }\n\n return null;\n};\n\n// Creates variables from variable definitions\nconst initVariables = function (node, globals, opts) {\n // eslint-disable-next-line default-case\n switch (node.type) {\n case 'Program': {\n for (const childNode of node.body) {\n initVariables(childNode, globals, opts);\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n initVariables(node.expression, globals, opts);\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n // let and const\n const symbol = createSymbol(declaration.id, globals, null, globals);\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[declaration.id.name] = symbol;\n }\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(node.declaration, globals, opts);\n }\n\n break;\n }\n }\n};\n\n// Populates variable maps using AST\n// eslint-disable-next-line complexity\nconst mapVariables = function (node, globals, opt, isExport) {\n /* istanbul ignore next */\n const opts = opt || {};\n /* istanbul ignore next */\n switch (node.type) {\n case 'Program': {\n if (opts.ancestorsOnly) {\n return false;\n }\n\n for (const childNode of node.body) {\n mapVariables(childNode, globals, opts);\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n mapVariables(node.expression, globals, opts);\n break;\n }\n\n case 'AssignmentExpression': {\n createSymbol(node.left, globals, node.right);\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n const isGlobal = opts.initWindow && node.kind === 'var' && globals.props.window;\n const symbol = createSymbol(declaration.id, globals, declaration.init, globals, isGlobal);\n if (symbol && isExport) {\n symbol.exported = true;\n }\n }\n\n break;\n }\n\n case 'FunctionDeclaration': {\n /* istanbul ignore next */\n if (node.id.type === 'Identifier') {\n createSymbol(node.id, globals, node, globals, true);\n }\n\n break;\n }\n\n case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(node.declaration, globals, node.declaration);\n if (symbol) {\n symbol.exported = true;\n } else if (!node.id) {\n globals.ANONYMOUS_DEFAULT = node.declaration;\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(node.declaration, globals, opts, true);\n } else {\n const symbol = createSymbol(node.declaration, globals, node.declaration);\n /* istanbul ignore next */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n\n for (const specifier of node.specifiers) {\n mapVariables(specifier, globals, opts);\n }\n\n break;\n }\n\n case 'ExportSpecifier': {\n const symbol = getSymbol(node.local, globals, globals);\n /* istanbul ignore next */\n if (symbol) {\n symbol.exported = true;\n }\n\n break;\n }\n\n case 'ClassDeclaration': {\n createSymbol(node.id, globals, node.body, globals);\n break;\n }\n\n default: {\n /* istanbul ignore next */\n return false;\n }\n }\n\n return true;\n};\n\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n /* istanbul ignore next */\n if (!block || blockCache.includes(block)) {\n return false;\n }\n\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n const {\n props = block.body,\n } = block;\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* istanbul ignore if */\n if (propval.some((val) => {\n return findNode(node, val, blockCache);\n })) {\n return true;\n }\n } else if (findNode(node, propval, blockCache)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst exportTypes = new Set([\n 'ExportNamedDeclaration', 'ExportDefaultDeclaration',\n]);\nconst ignorableNestedTypes = new Set([\n 'FunctionDeclaration', 'ArrowFunctionExpression', 'FunctionExpression',\n]);\nconst getExportAncestor = function (nde) {\n let node = nde;\n let idx = 0;\n const ignorableIfDeep = ignorableNestedTypes.has(nde?.type);\n while (node) {\n // Ignore functions nested more deeply than say `export default function () {}`\n if (idx >= 2 && ignorableIfDeep) {\n break;\n }\n\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n node = node.parent;\n idx++;\n }\n\n return false;\n};\n\nconst canBeExportedByAncestorType = new Set([\n 'TSPropertySignature',\n 'TSMethodSignature',\n 'ClassProperty',\n 'PropertyDefinition',\n 'Method',\n]);\n\nconst canExportChildrenType = new Set([\n 'TSInterfaceBody',\n 'TSInterfaceDeclaration',\n 'ClassDeclaration',\n 'ClassBody',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\nconst isExportByAncestor = function (nde) {\n if (!canBeExportedByAncestorType.has(nde.type)) {\n return false;\n }\n\n let node = nde.parent;\n while (node) {\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n if (!canExportChildrenType.has(node.type)) {\n return false;\n }\n\n node = node.parent;\n }\n\n return false;\n};\n\nconst findExportedNode = function (block, node, cache) {\n /* istanbul ignore next */\n if (block === null) {\n return false;\n }\n\n const blockCache = cache || [];\n const {\n props,\n } = block;\n for (const propval of Object.values(props)) {\n blockCache.push(propval);\n if (propval.exported && (node === propval.value || findNode(node, propval.value))) {\n return true;\n }\n\n // No need to check `propval` for exported nodes as ESM\n // exports are only global\n }\n\n return false;\n};\n\nconst isNodeExported = function (node, globals, opt) {\n if (\n opt.initModuleExports && globals.props.module && globals.props.module.props.exports &&\n findNode(node, globals.props.module.props.exports)\n ) {\n return true;\n }\n\n if (opt.initWindow && globals.props.window && findNode(node, globals.props.window)) {\n return true;\n }\n\n if (opt.esm && findExportedNode(globals, node)) {\n return true;\n }\n\n return false;\n};\n\nconst parseRecursive = function (node, globalVars, opts) {\n // Iterate from top using recursion - stop at first processed node from top\n if (node.parent && parseRecursive(node.parent, globalVars, opts)) {\n return true;\n }\n\n return mapVariables(node, globalVars, opts);\n};\n\nconst parse = function (ast, node, opt) {\n /* istanbul ignore next */\n const opts = opt || {\n ancestorsOnly: false,\n esm: true,\n initModuleExports: true,\n initWindow: true,\n };\n\n const globalVars = createNode();\n if (opts.initModuleExports) {\n globalVars.props.module = createNode();\n globalVars.props.module.props.exports = createNode();\n globalVars.props.exports = globalVars.props.module.props.exports;\n }\n\n if (opts.initWindow) {\n globalVars.props.window = createNode();\n globalVars.props.window.special = true;\n }\n\n if (opts.ancestorsOnly) {\n parseRecursive(node, globalVars, opts);\n } else {\n initVariables(ast, globalVars, opts);\n mapVariables(ast, globalVars, opts);\n }\n\n return {\n globalVars,\n };\n};\n\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n const exportNode = getExportAncestor(node);\n\n // Is export node comment\n if (exportNode && !findJSDocComment(exportNode, sourceCode, settings)) {\n return true;\n }\n\n /**\n * Some typescript types are not in variable map, but inherit exported (interface property and method)\n */\n if (\n isExportByAncestor(node) &&\n !findJSDocComment(node, sourceCode, settings)\n ) {\n return true;\n }\n }\n\n const parseResult = parse(sourceCode.ast, node, opt);\n\n return isNodeExported(node, parseResult.globalVars, opt);\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"file":"exportParser.js"}
|
|
@@ -58,40 +58,43 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
58
58
|
// problematic as not attached so presumably not useable without it
|
|
59
59
|
['nameContents', 'namepath-defining'], // "namepath"
|
|
60
60
|
['nameRequired', true]])], ['class', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
61
|
-
['nameContents', 'namepath-defining'],
|
|
61
|
+
['nameContents', 'namepath-defining'], // Not in use, but should be this value if using to power `empty-tags`
|
|
62
|
+
['nameAllowed', true], ['typeAllowed', true]])], ['const', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
62
63
|
['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constant', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
63
64
|
['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constructor', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
64
|
-
['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['
|
|
65
|
-
['nameContents', 'namepath-
|
|
65
|
+
['nameContents', 'namepath-defining'], ['typeAllowed', true]])], ['constructs', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
66
|
+
['nameContents', 'namepath-defining'], ['nameRequired', false], ['typeAllowed', false]])], ['define', new Map([['typeRequired', isClosure]])], ['emits', new Map([// Signature seems to require a "name" (of an event) and no counter-examples
|
|
67
|
+
['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['enum', new Map([// Has example showing curly brackets but not in doc signature
|
|
66
68
|
['typeAllowed', true]])], ['event', new Map([// The doc signature of `event` seems to require a "name"
|
|
67
69
|
['nameRequired', true], // Appears to require a "name" in its signature, albeit somewhat
|
|
68
70
|
// different from other "name"'s (including as described
|
|
69
71
|
// at https://jsdoc.app/about-namepaths.html )
|
|
70
72
|
['nameContents', 'namepath-defining']])], ['exception', new Map([// Shows curly brackets in the signature and in the examples
|
|
71
|
-
['typeAllowed', true]])],
|
|
73
|
+
['typeAllowed', true]])], // Closure
|
|
74
|
+
['export', new Map([['typeAllowed', isClosureOrPermissive]])], ['exports', new Map([['nameContents', 'namepath-defining'], ['nameRequired', isJsdoc], ['typeAllowed', isClosureOrPermissive]])], ['extends', new Map([// Signature seems to require a "namepath" (and no counter-examples)
|
|
72
75
|
['nameContents', 'namepath-referencing'], // Does not show curly brackets in either the signature or examples
|
|
73
76
|
['typeAllowed', isTypescriptOrClosure || isPermissive], ['nameRequired', isJsdoc], // "namepath"
|
|
74
77
|
['typeOrNameRequired', isTypescriptOrClosure || isPermissive]])], ['external', new Map([// Appears to require a "name" in its signature, albeit somewhat
|
|
75
78
|
// different from other "name"'s (including as described
|
|
76
79
|
// at https://jsdoc.app/about-namepaths.html )
|
|
77
80
|
['nameContents', 'namepath-defining'], // "name" (and a special syntax for the `external` name)
|
|
78
|
-
['nameRequired', true]])], ['fires', new Map([// Signature seems to require a "name" (of an event) and no
|
|
81
|
+
['nameRequired', true], ['typeAllowed', false]])], ['fires', new Map([// Signature seems to require a "name" (of an event) and no
|
|
79
82
|
// counter-examples
|
|
80
|
-
['nameContents', 'namepath-referencing']])], ['function', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
81
|
-
['nameContents', 'namepath-defining']])], ['func', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
83
|
+
['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['function', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
84
|
+
['nameContents', 'namepath-defining'], ['nameRequired', false], ['typeAllowed', false]])], ['func', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
82
85
|
['nameContents', 'namepath-defining']])], ['host', new Map([// Appears to require a "name" in its signature, albeit somewhat
|
|
83
86
|
// different from other "name"'s (including as described
|
|
84
87
|
// at https://jsdoc.app/about-namepaths.html )
|
|
85
88
|
['nameContents', 'namepath-defining'], // See `external`
|
|
86
|
-
['nameRequired', true], // "
|
|
87
|
-
['
|
|
88
|
-
['
|
|
89
|
+
['nameRequired', true], ['typeAllowed', false]])], ['interface', new Map([// Allows for "name" in signature, but indicates as optional
|
|
90
|
+
['nameContents', isJsdocTypescriptOrPermissive ? 'namepath-defining' : false], // Not in use, but should be this value if using to power `empty-tags`
|
|
91
|
+
['nameAllowed', isClosure], ['typeAllowed', false]])], ['implements', new Map([// Shows curly brackets in the doc signature and examples
|
|
89
92
|
// "typeExpression"
|
|
90
93
|
['typeRequired', true]])], ['lends', new Map([// Signature seems to require a "namepath" (and no counter-examples)
|
|
91
94
|
['nameContents', 'namepath-referencing'], // "namepath"
|
|
92
95
|
['typeOrNameRequired', true]])], ['listens', new Map([// Signature seems to require a "name" (of an event) and no
|
|
93
96
|
// counter-examples
|
|
94
|
-
['nameContents', 'namepath-referencing']])], ['member', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
97
|
+
['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['member', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
95
98
|
['nameContents', 'namepath-defining'], // Has example showing curly brackets but not in doc signature
|
|
96
99
|
['typeAllowed', true]])], ['memberof', new Map([// Signature seems to require a "namepath" (and no counter-examples),
|
|
97
100
|
// though it allows an incomplete namepath ending with connecting symbol
|
|
@@ -104,7 +107,7 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
104
107
|
// counter-examples
|
|
105
108
|
['nameContents', 'namepath-referencing'], // "OtherObjectPath"
|
|
106
109
|
['typeOrNameRequired', true]])], ['mixin', new Map([// Allows for "name"'s in signature, but indicated as optional
|
|
107
|
-
['nameContents', 'namepath-defining']])], ['modifies', new Map([// Has no documentation, but test example has curly brackets, and
|
|
110
|
+
['nameContents', 'namepath-defining'], ['nameRequired', false], ['typeAllowed', false]])], ['modifies', new Map([// Has no documentation, but test example has curly brackets, and
|
|
108
111
|
// "name" would be suggested rather than "namepath" based on example;
|
|
109
112
|
// not sure if name is required
|
|
110
113
|
['typeAllowed', true]])], ['module', new Map([// Optional "name" and no curly brackets
|
|
@@ -137,7 +140,8 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
137
140
|
['typeAllowed', true]])], ['protected', new Map([// Shows the signature with curly brackets but not in the example
|
|
138
141
|
// "typeExpression"
|
|
139
142
|
['typeAllowed', isClosureOrPermissive]])], ['public', new Map([// Does not show a signature nor show curly brackets in the example
|
|
140
|
-
['typeAllowed', isClosureOrPermissive]])], ['
|
|
143
|
+
['typeAllowed', isClosureOrPermissive]])], ['requires', new Map([// <someModuleName>
|
|
144
|
+
['nameContents', 'namepath-referencing'], ['nameRequired', true], ['typeAllowed', false]])], ['returns', new Map([// Shows curly brackets in the signature and in the examples
|
|
141
145
|
['typeAllowed', true]])], ['return', new Map([// Shows curly brackets in the signature and in the examples
|
|
142
146
|
['typeAllowed', true]])], ['see', new Map([// Signature allows for "namepath" or text, so user must configure to
|
|
143
147
|
// 'namepath-referencing' to enforce checks
|
|
@@ -149,7 +153,8 @@ const getDefaultTagStructureForMode = mode => {
|
|
|
149
153
|
// Not used with namepath in Closure/TypeScript, however
|
|
150
154
|
['nameContents', isJsdoc ? 'namepath-referencing' : false], ['typeRequired', isTypescriptOrClosure], // namepath
|
|
151
155
|
['typeOrNameRequired', isJsdoc]])], ['throws', new Map([// Shows curly brackets in the signature and in the examples
|
|
152
|
-
['typeAllowed', true]])], ['
|
|
156
|
+
['typeAllowed', true]])], ['tutorial', new Map([// (a tutorial ID)
|
|
157
|
+
['nameRequired', true], ['typeAllowed', false]])], ['type', new Map([// Shows curly brackets in the doc signature and examples
|
|
153
158
|
// "typeName"
|
|
154
159
|
['typeRequired', true]])], ['typedef', new Map([// Seems to require a "namepath" in the signature (with no
|
|
155
160
|
// counter-examples)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/getDefaultTagStructureForMode.js"],"names":["getDefaultTagStructureForMode","mode","isJsdoc","isClosure","isTypescript","isPermissive","isJsdocOrPermissive","isJsdocOrTypescript","isTypescriptOrClosure","isClosureOrPermissive","isJsdocTypescriptOrPermissive","Map"],"mappings":";;;;;;;AAAA,MAAMA,6BAA6B,GAAIC,IAAD,IAAU;AAC9C,QAAMC,OAAO,GAAGD,IAAI,KAAK,OAAzB;AACA,QAAME,SAAS,GAAGF,IAAI,KAAK,SAA3B;AACA,QAAMG,YAAY,GAAGH,IAAI,KAAK,YAA9B;AACA,QAAMI,YAAY,GAAGJ,IAAI,KAAK,YAA9B;AAEA,QAAMK,mBAAmB,GAAGJ,OAAO,IAAIG,YAAvC;AACA,QAAME,mBAAmB,GAAGL,OAAO,IAAIE,YAAvC;AACA,QAAMI,qBAAqB,GAAGJ,YAAY,IAAID,SAA9C;AACA,QAAMM,qBAAqB,GAAGN,SAAS,IAAIE,YAA3C;AACA,QAAMK,6BAA6B,GAAGH,mBAAmB,IAAIF,YAA7D,CAV8C,CAY9C;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAO,IAAIM,GAAJ,CAAQ,CACb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CADa,EAeb,CACE,KADF,EACS,IAAIA,GAAJ,CAAQ,CACb,CACE,cADF,EACkB,mBADlB,CADa,EAKb;AACA,GACE,cADF,EACkB,IADlB,CANa,EAUb;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZa,CAAR,CADT,CAfa,EAkCb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA,GACE,cADF,EACkB,IADlB,CANkB,EAUlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZkB,CAAR,CADd,CAlCa,EAqDb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,sBADlB,CAFkB,EAMlB;AACA,GACE,aADF,EACiB,IADjB,CAPkB,EAWlB;AACA,GACE,oBADF,EACwB,IADxB,CAZkB,CAAR,CADd,CArDa,EAwEb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHiB,EAOjB;AACA,GACE,oBADF,EACwB,IADxB,CARiB,CAAR,CADb,CAxEa,EAuFb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJkB,EAQlB;AACA,GACE,cADF,EACkB,IADlB,CATkB,CAAR,CADd,CAvFa,EAuGb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,aADF,EACiB,IADjB,CANe,CAAR,CADX,CAvGa,EAoHb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,aADF,EACiB,IADjB,CANe,CAAR,CADX,CApHa,EAgIb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,mBADlB,CAFkB,EAMlB,CACE,aADF,EACiB,IADjB,CANkB,CAAR,CADd,CAhIa,EA4Ib,CACE,aADF,EACiB,IAAIA,GAAJ,CAAQ,CACrB;AACA,GACE,cADF,EACkB,mBADlB,CAFqB,EAMrB,CACE,aADF,EACiB,IADjB,CANqB,CAAR,CADjB,CA5Ia,EAyJb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB,CACE,cADF,EACkBR,SADlB,CADgB,CAAR,CADZ,CAzJa,EAiKb,CACE,OADF,EACW,IAAIQ,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,CAAR,CADX,C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A;AACA,GACE,cADF,EACkB,mBADlB,CAJc,EAQd;AACA,GACE,cADF,EACkB,IADlB,CATc,EAad;AACA,GACE,oBADF,EACwB,IADxB,CAdc,CAAR,CADV,CAtRa,EA2Sb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,cADF,EAEED,6BAA6B,GAAG,mBAAH,GAAyB,KAFxD,CAFmB,CAAR,CADf,CA3Sa,EAqTb,CACE,YADF,EACgB,IAAIC,GAAJ,CAAQ,CACpB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAHoB,CAAR,CADhB,CArTa,EA+Tb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CA/Ta,EA6Ub,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHiB,CAAR,CADb,CA7Ua,EAuVb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,cADF,EACkB,mBADlB,CAFgB,EAMhB;AACA,GACE,aADF,EACiB,IADjB,CAPgB,CAAR,CADZ,CAvVa,EAqWb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHkB,EAOlB;AACA,GACE,oBADF,EACwB,IADxB,CARkB,CAAR,CADd,CArWa,EAmXb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHmB,EAOnB;AACA,GACE,oBADF,EACwB,IADxB,CARmB,CAAR,CADf,CAnXa,EAkYb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,cADF,EACkB,mBADlB,CAFgB,CAAR,CADZ,CAlYa,EA0Yb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHe,EAOf;AACA,GACE,oBADF,EACwB,IADxB,CARe,CAAR,CADX,CA1Ya,EAyZb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,CAAR,CADX,CAzZa,EAkab,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,aADF,EACiB,IADjB,CAJkB,CAAR,CADd,CAlaa,EA6ab,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA;AACA;AACA,GACE,cADF,EACkBT,OAAO,GAAG,mBAAH,GAAyB,MADlD,CAJgB,EAQhB;AACA,GACE,aADF,EACiB,IADjB,CATgB,CAAR,CADZ,CA7aa,EA6bb,CACE,MADF,EACU,IAAIS,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAHc,EAOd;AACA,GACE,cADF,EACkB,IADlB,CARc,EAYd;AACA,GACE,oBADF,EACwB,IADxB,CAbc,CAAR,CADV,CA7ba,EAidb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,cADF,EACkB,mBADlB,CAFmB,EAMnB;AACA,GACE,aADF,EACiB,IADjB,CAPmB,CAAR,CADf,CAjda,EA8db,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CA9da,EAweb,CACE,OADF,EACW,IAAIE,GAAJ,CAAQ,CACf,CACE,cADF,EACkB,mBADlB,CADe,EAKf;AACA;AACA;AACA;AACA,GACE,cADF,EACkB,IADlB,CATe,EAaf;AACA;AACA,GACE,aADF,EACiB,IADjB,CAfe,CAAR,CADX,CAxea,EA8fb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CA9fa,EAwgBb,CACE,MADF,EACU,IAAIE,GAAJ,CAAQ,CACd,CACE,cADF,EACkB,mBADlB,CADc,EAKd;AACA,GACE,cADF,EACkB,IADlB,CANc,EAUd;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZc,CAAR,CADV,CAxgBa,EA2hBb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAPkB,EAWlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CAbkB,CAAR,CADd,CA3hBa,EA+iBb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHmB,CAAR,CADf,CA/iBa,EAyjBb,CACE,QADF,EACY,IAAIE,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiBF,qBADjB,CAFgB,CAAR,CADZ,CAzjBa,EAkkBb,CACE,SADF,EACa,IAAIE,GAAJ,CAAQ,CACjB;AACA,GACE,aADF,EACiB,IADjB,CAFiB,CAAR,CADb,CAlkBa,EA0kBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CA1kBa,EAmlBb,CACE,KADF,EACS,IAAIA,GAAJ,CAAQ,CACb;AACA;AACA,GACE,cADF,EACkB,MADlB,CAHa,CAAR,CADT,CAnlBa,EA6lBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiBF,qBADjB,CAFgB,CAAR,CADZ,CA7lBa,EAsmBb,CACE,UADF,EACc,IAAIE,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,CAACR,SADnB,CADkB,EAIlB,CACE,cADF,EACkBA,SADlB,CAJkB,CAAR,CADd,CAtmBa,EAinBb,CACE,UADF,EACc,IAAIQ,GAAJ,CAAQ,CAClB,CACE,cADF,EACkBT,OAAO,GAAG,MAAH,GAAY,sBADrC,CADkB,EAKlB;AACA;AACA;AACA,GACE,aADF,EACiBM,qBAAqB,IAAIH,YAD1C,CARkB,CAAR,CADd,CAjnBa,EAgoBb,CACE,MADF,EACU,IAAIM,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkBT,OAAO,GAAG,sBAAH,GAA4B,KADrD,CAHc,EAOd,CACE,cADF,EACkBM,qBADlB,CAPc,EAWd;AACA,GACE,oBADF,EACwBN,OADxB,CAZc,CAAR,CADV,CAhoBa,EAmpBb,CACE,QADF,EACY,IAAIS,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CAnpBa,EA4pBb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkB,IADlB,CAHc,CAAR,CADV,CA5pBa,EAsqBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAHiB,EAOjB;AACA;AACA;AACA,GACE,cADF,EACkBL,mBADlB,CAViB,EAcjB;AACA;AAEA;AACA,GACE,aADF,EACiB,IADjB,CAlBiB,EAsBjB;AACA;AACA,GACE,oBADF,EACwB,CAACF,YADzB,CAxBiB,CAAR,CADb,CAtqBa,EAqsBb,CACE,KADF,EACS,IAAIO,GAAJ,CAAQ,CACb;AACA,GACE,cADF,EACkB,mBADlB,CAFa,EAMb;AACA,GACE,aADF,EACiB,IADjB,CAPa,CAAR,CADT,CArsBa,EAmtBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CAntBa,EA2tBb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,aADF,EACiB,IADjB,CAFe,CAAR,CADX,CA3tBa,CAAR,CAAP;AAouBD,CA9wBD;;eAgxBeX,6B","sourcesContent":["const 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 // `nameContents` - 'namepath-referencing'|'namepath-defining'|'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 `nameContents: '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 and `param` is\n // name-defining but not namepath-defining, so not part of these groups)\n\n // Todo: Should support special processing for \"name\" as distinct from\n // \"namepath\" (e.g., param can't define a namepath)\n\n // Once checking inline tags:\n // Todo: Re: `typeOrNameRequired`, `@link` (or @linkcode/@linkplain) seems\n // to require a namepath OR URL and might be checked as such.\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n return new Map([\n [\n 'alias', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'arg', new Map([\n [\n 'nameContents', '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([\n [\n 'nameContents', '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([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', '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([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'callback', new Map([\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 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ]),\n ],\n\n [\n 'class', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'const', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constant', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constructor', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'define', new Map([\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'emits', new Map([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n ]),\n ],\n\n [\n 'enum', new Map([\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'event', new Map([\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n\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 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'exception', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'export', new Map([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'extends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ]),\n ],\n\n [\n 'external', new Map([\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 'nameContents', 'namepath-defining',\n ],\n\n // \"name\" (and a special syntax for the `external` name)\n [\n 'nameRequired', true,\n ],\n ]),\n ],\n\n [\n 'fires', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n ]),\n ],\n\n [\n 'function', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n [\n 'func', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'host', new Map([\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 'nameContents', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'interface', new Map([\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'nameContents',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n ]),\n ],\n\n [\n 'implements', new Map([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ]),\n ],\n\n [\n 'lends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'listens', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n ]),\n ],\n\n [\n 'member', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', '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([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n [\n 'memberof!', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'method', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n [\n 'mixes', new Map([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'mixin', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'modifies', new Map([\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([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNamepathDefiningTag|tagMightHaveNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'nameContents', 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([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', '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([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', '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([\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([\n [\n 'nameContents', '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([\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([\n [\n 'nameContents', '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([\n [\n 'nameContents', '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([\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([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'returns', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'return', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'see', new Map([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'nameContents', 'text',\n ],\n ]),\n ],\n\n [\n 'static', new Map([\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([\n [\n 'nameContents', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'template', new Map([\n [\n 'nameContents', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n // Though defines `nameContents: '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([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'nameContents', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n ]),\n ],\n\n [\n 'throws', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'type', new Map([\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([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-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([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', '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 'yields', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'yield', new Map([\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"],"file":"getDefaultTagStructureForMode.js"}
|
|
1
|
+
{"version":3,"sources":["../src/getDefaultTagStructureForMode.js"],"names":["getDefaultTagStructureForMode","mode","isJsdoc","isClosure","isTypescript","isPermissive","isJsdocOrPermissive","isJsdocOrTypescript","isTypescriptOrClosure","isClosureOrPermissive","isJsdocTypescriptOrPermissive","Map"],"mappings":";;;;;;;AAAA,MAAMA,6B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WlB;AACA,GACE,oBADF,EACwB,IADxB,CAZkB,CAAR,CADd,CArDa,EAwEb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHiB,EAOjB;AACA,GACE,oBADF,EACwB,IADxB,CARiB,CAAR,CADb,CAxEa,EAuFb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJkB,EAQlB;AACA,GACE,cADF,EACkB,IADlB,CATkB,CAAR,CADd,CAvFa,EAuGb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf;AACA,GACE,aADF,EACiB,IADjB,CAPe,EAWf,CACE,aADF,EACiB,IADjB,CAXe,CAAR,CADX,CAvGa,EAyHb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,aADF,EACiB,IADjB,CANe,CAAR,CADX,CAzHa,EAqIb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,mBADlB,CAFkB,EAMlB,CACE,aADF,EACiB,IADjB,CANkB,CAAR,CADd,CArIa,EAiJb,CACE,aADF,EACiB,IAAIA,GAAJ,CAAQ,CACrB;AACA,GACE,cADF,EACkB,mBADlB,CAFqB,EAMrB,CACE,aADF,EACiB,IADjB,CANqB,CAAR,CADjB,CAjJa,EA8Jb,CACE,YADF,EACgB,IAAIA,GAAJ,CAAQ,CACpB;AACA,GACE,cADF,EACkB,mBADlB,CAFoB,EAMpB,CACE,cADF,EACkB,KADlB,CANoB,EAUpB,CACE,aADF,EACiB,KADjB,CAVoB,CAAR,CADhB,CA9Ja,EA+Kb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB,CACE,cADF,EACkBR,SADlB,CADgB,CAAR,CADZ,CA/Ka,EAuLb,CACE,OADF,EACW,IAAIQ,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf,CACE,cADF,EACkB,IADlB,CANe,EAUf,CACE,aADF,EACiB,KADjB,CAVe,CAAR,CADX,CAvLa,EAwMb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA,GACE,aADF,EACiB,IADjB,CAFc,CAAR,CADV,CAxMa,EAiNb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,IADlB,CAFe,EAMf;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CATe,CAAR,CADX,CAjNa,EAiOb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,aADF,EACiB,IADjB,CAFmB,CAAR,CADf,CAjOa,EA0Ob;AACA,GACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB,CACE,aADF,EACiBF,qBADjB,CADgB,CAAR,CADZ,CA3Oa,EAmPb,CACE,SADF,EACa,IAAIE,GAAJ,CAAQ,CACjB,CACE,cADF,EACkB,mBADlB,CADiB,EAKjB,CACE,cADF,EACkBT,OADlB,CALiB,EASjB,CACE,aADF,EACiBO,qBADjB,CATiB,CAAR,CADb,CAnPa,EAmQb,CACE,SADF,EACa,IAAIE,GAAJ,CAAQ,CACjB;AACA,GACE,cADF,EACkB,sBADlB,CAFiB,EAMjB;AACA,GACE,aADF,EACiBH,qBAAqB,IAAIH,YAD1C,CAPiB,EAWjB,CACE,cADF,EACkBH,OADlB,CAXiB,EAejB;AACA,GACE,oBADF,EACwBM,qBAAqB,IAAIH,YADjD,CAhBiB,CAAR,CADb,CAnQa,EA0Rb,CACE,UADF,EACc,IAAIM,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJkB,EAQlB;AACA,GACE,cADF,EACkB,IADlB,CATkB,EAalB,CACE,aADF,EACiB,KADjB,CAbkB,CAAR,CADd,CA1Ra,EA8Sb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHe,EAOf,CACE,cADF,EACkB,IADlB,CAPe,EAWf,CACE,aADF,EACiB,KADjB,CAXe,CAAR,CADX,CA9Sa,EAgUb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,mBADlB,CAFkB,EAMlB,CACE,cADF,EACkB,KADlB,CANkB,EAUlB,CACE,aADF,EACiB,KADjB,CAVkB,CAAR,CADd,CAhUa,EAgVb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA,GACE,cADF,EACkB,mBADlB,CAFc,CAAR,CADV,CAhVa,EAyVb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAJc,EAQd;AACA,GACE,cADF,EACkB,IADlB,CATc,EAad,CACE,aADF,EACiB,KADjB,CAbc,CAAR,CADV,CAzVa,EA6Wb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,cADF,EAEED,6BAA6B,GAAG,mBAAH,GAAyB,KAFxD,CAFmB,EAOnB;AACA,GACE,aADF,EACiBP,SADjB,CARmB,EAYnB,CACE,aADF,EACiB,KADjB,CAZmB,CAAR,CADf,CA7Wa,EAgYb,CACE,YADF,EACgB,IAAIQ,GAAJ,CAAQ,CACpB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAHoB,CAAR,CADhB,CAhYa,EA0Yb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,sBADlB,CAFe,EAMf;AACA,GACE,oBADF,EACwB,IADxB,CAPe,CAAR,CADX,CA1Ya,EAwZb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHiB,EAOjB,CACE,cADF,EACkB,IADlB,CAPiB,EAWjB,CACE,aADF,EACiB,KADjB,CAXiB,CAAR,CADb,CAxZa,EA0ab,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,cADF,EACkB,mBADlB,CAFgB,EAMhB;AACA,GACE,aADF,EACiB,IADjB,CAPgB,CAAR,CADZ,CA1aa,EAwbb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHkB,EAOlB;AACA,GACE,oBADF,EACwB,IADxB,CARkB,CAAR,CADd,CAxba,EAscb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHmB,EAOnB;AACA,GACE,oBADF,EACwB,IADxB,CARmB,CAAR,CADf,CAtca,EAqdb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,cADF,EACkB,mBADlB,CAFgB,CAAR,CADZ,CArda,EA6db,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA;AACA,GACE,cADF,EACkB,sBADlB,CAHe,EAOf;AACA,GACE,oBADF,EACwB,IADxB,CARe,CAAR,CADX,CA7da,EA4eb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,cADF,EACkB,mBADlB,CAFe,EAMf,CACE,cADF,EACkB,KADlB,CANe,EAUf,CACE,aADF,EACiB,KADjB,CAVe,CAAR,CADX,CA5ea,EA6fb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA;AACA;AACA,GACE,aADF,EACiB,IADjB,CAJkB,CAAR,CADd,CA7fa,EAwgBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA;AACA;AACA,GACE,cADF,EACkBT,OAAO,GAAG,mBAAH,GAAyB,MADlD,CAJgB,EAQhB;AACA,GACE,aADF,EACiB,IADjB,CATgB,CAAR,CADZ,CAxgBa,EAwhBb,CACE,MADF,EACU,IAAIS,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAHc,EAOd;AACA,GACE,cADF,EACkB,IADlB,CARc,EAYd;AACA,GACE,oBADF,EACwB,IADxB,CAbc,CAAR,CADV,CAxhBa,EA4iBb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA,GACE,cADF,EACkB,mBADlB,CAFmB,EAMnB;AACA,GACE,aADF,EACiB,IADjB,CAPmB,CAAR,CADf,CA5iBa,EAyjBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CAzjBa,EAmkBb,CACE,OADF,EACW,IAAIE,GAAJ,CAAQ,CACf,CACE,cADF,EACkB,mBADlB,CADe,EAKf;AACA;AACA;AACA;AACA,GACE,cADF,EACkB,IADlB,CATe,EAaf;AACA;AACA,GACE,aADF,EACiB,IADjB,CAfe,CAAR,CADX,CAnkBa,EAylBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHiB,CAAR,CADb,CAzlBa,EAmmBb,CACE,MADF,EACU,IAAIE,GAAJ,CAAQ,CACd,CACE,cADF,EACkB,mBADlB,CADc,EAKd;AACA,GACE,cADF,EACkB,IADlB,CANc,EAUd;AACA;AACA,GACE,aADF,EACiB,IADjB,CAZc,CAAR,CADV,CAnmBa,EAsnBb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,mBADlB,CADkB,EAKlB;AACA;AACA,GACE,cADF,EACkB,IADlB,CAPkB,EAWlB;AACA;AACA,GACE,aADF,EACiB,IADjB,CAbkB,CAAR,CADd,CAtnBa,EA0oBb,CACE,WADF,EACe,IAAIA,GAAJ,CAAQ,CACnB;AACA;AACA,GACE,aADF,EACiBF,qBADjB,CAHmB,CAAR,CADf,CA1oBa,EAopBb,CACE,QADF,EACY,IAAIE,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiBF,qBADjB,CAFgB,CAAR,CADZ,CAppBa,EA6pBb,CACE,UADF,EACc,IAAIE,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,sBADlB,CAFkB,EAMlB,CACE,cADF,EACkB,IADlB,CANkB,EAUlB,CACE,aADF,EACiB,KADjB,CAVkB,CAAR,CADd,CA7pBa,EA8qBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA,GACE,aADF,EACiB,IADjB,CAFiB,CAAR,CADb,CA9qBa,EAsrBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CAtrBa,EA+rBb,CACE,KADF,EACS,IAAIA,GAAJ,CAAQ,CACb;AACA;AACA,GACE,cADF,EACkB,MADlB,CAHa,CAAR,CADT,CA/rBa,EAysBb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiBF,qBADjB,CAFgB,CAAR,CADZ,CAzsBa,EAktBb,CACE,UADF,EACc,IAAIE,GAAJ,CAAQ,CAClB,CACE,cADF,EACkB,CAACR,SADnB,CADkB,EAIlB,CACE,cADF,EACkBA,SADlB,CAJkB,CAAR,CADd,CAltBa,EA6tBb,CACE,UADF,EACc,IAAIQ,GAAJ,CAAQ,CAClB,CACE,cADF,EACkBT,OAAO,GAAG,MAAH,GAAY,sBADrC,CADkB,EAKlB;AACA;AACA;AACA,GACE,aADF,EACiBM,qBAAqB,IAAIH,YAD1C,CARkB,CAAR,CADd,CA7tBa,EA4uBb,CACE,MADF,EACU,IAAIM,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkBT,OAAO,GAAG,sBAAH,GAA4B,KADrD,CAHc,EAOd,CACE,cADF,EACkBM,qBADlB,CAPc,EAWd;AACA,GACE,oBADF,EACwBN,OADxB,CAZc,CAAR,CADV,CA5uBa,EA+vBb,CACE,QADF,EACY,IAAIS,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CA/vBa,EAwwBb,CACE,UADF,EACc,IAAIA,GAAJ,CAAQ,CAClB;AACA,GACE,cADF,EACkB,IADlB,CAFkB,EAMlB,CACE,aADF,EACiB,KADjB,CANkB,CAAR,CADd,CAxwBa,EAqxBb,CACE,MADF,EACU,IAAIA,GAAJ,CAAQ,CACd;AACA;AACA,GACE,cADF,EACkB,IADlB,CAHc,CAAR,CADV,CArxBa,EA+xBb,CACE,SADF,EACa,IAAIA,GAAJ,CAAQ,CACjB;AACA;AACA,GACE,cADF,EACkB,mBADlB,CAHiB,EAOjB;AACA;AACA;AACA,GACE,cADF,EACkBL,mBADlB,CAViB,EAcjB;AACA;AAEA;AACA,GACE,aADF,EACiB,IADjB,CAlBiB,EAsBjB;AACA;AACA,GACE,oBADF,EACwB,CAACF,YADzB,CAxBiB,CAAR,CADb,CA/xBa,EA8zBb,CACE,KADF,EACS,IAAIO,GAAJ,CAAQ,CACb;AACA,GACE,cADF,EACkB,mBADlB,CAFa,EAMb;AACA,GACE,aADF,EACiB,IADjB,CAPa,CAAR,CADT,CA9zBa,EA40Bb,CACE,QADF,EACY,IAAIA,GAAJ,CAAQ,CAChB;AACA,GACE,aADF,EACiB,IADjB,CAFgB,CAAR,CADZ,CA50Ba,EAo1Bb,CACE,OADF,EACW,IAAIA,GAAJ,CAAQ,CACf;AACA,GACE,aADF,EACiB,IADjB,CAFe,CAAR,CADX,CAp1Ba,CAAR,CAAP;AA61BD,CAv4BD;;eAy4BeX,6B","sourcesContent":["const 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 // `nameContents` - 'namepath-referencing'|'namepath-defining'|'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 `nameContents: '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 and `param` is\n // name-defining but not namepath-defining, so not part of these groups)\n\n // Todo: Should support special processing for \"name\" as distinct from\n // \"namepath\" (e.g., param can't define a namepath)\n\n // Once checking inline tags:\n // Todo: Re: `typeOrNameRequired`, `@link` (or @linkcode/@linkplain) seems\n // to require a namepath OR URL and might be checked as such.\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n return new Map([\n [\n 'alias', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'arg', new Map([\n [\n 'nameContents', '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([\n [\n 'nameContents', '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([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', '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([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'callback', new Map([\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 'nameContents', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ]),\n ],\n\n [\n 'class', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', true,\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'const', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constant', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'constructor', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'constructs', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'define', new Map([\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'emits', new Map([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'enum', new Map([\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'event', new Map([\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n\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 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'exception', new Map([\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([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'exports', new Map([\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ]),\n ],\n\n [\n 'extends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ]),\n ],\n\n [\n 'external', new Map([\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 'nameContents', '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([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'function', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n [\n 'func', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n\n [\n 'host', new Map([\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 'nameContents', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'interface', new Map([\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'nameContents',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', isClosure,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'implements', new Map([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ]),\n ],\n\n [\n 'lends', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'listens', new Map([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'member', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', '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([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n [\n 'memberof!', new Map([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'method', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n ]),\n ],\n [\n 'mixes', new Map([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ]),\n ],\n\n [\n 'mixin', new Map([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'modifies', new Map([\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([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNamepathDefiningTag|tagMightHaveNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'nameContents', 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([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', '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([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', '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([\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([\n [\n 'nameContents', '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([\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([\n [\n 'nameContents', '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([\n [\n 'nameContents', '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([\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([\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([\n // <someModuleName>\n [\n 'nameContents', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'returns', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'return', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'see', new Map([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'nameContents', 'text',\n ],\n ]),\n ],\n\n [\n 'static', new Map([\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([\n [\n 'nameContents', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ]),\n ],\n\n [\n 'template', new Map([\n [\n 'nameContents', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n // Though defines `nameContents: '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([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'nameContents', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n ]),\n ],\n\n [\n 'throws', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n\n [\n 'tutorial', new Map([\n // (a tutorial ID)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ]),\n ],\n\n [\n 'type', new Map([\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([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'nameContents', 'namepath-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([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'nameContents', '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 'yields', new Map([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ]),\n ],\n [\n 'yield', new Map([\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"],"file":"getDefaultTagStructureForMode.js"}
|
package/dist/iterateJsdoc.js
CHANGED
|
@@ -779,6 +779,8 @@ const makeReport = (context, commentNode) => {
|
|
|
779
779
|
|
|
780
780
|
return report;
|
|
781
781
|
};
|
|
782
|
+
/* eslint-disable jsdoc/no-undefined-types -- Need to build this in; see https://www.typescriptlang.org/docs/handbook/utility-types.html */
|
|
783
|
+
|
|
782
784
|
/**
|
|
783
785
|
* @typedef {ReturnType<typeof getUtils>} Utils
|
|
784
786
|
* @typedef {ReturnType<typeof getSettings>} Settings
|
|
@@ -797,6 +799,8 @@ const makeReport = (context, commentNode) => {
|
|
|
797
799
|
* ) => any } JsdocVisitor
|
|
798
800
|
*/
|
|
799
801
|
|
|
802
|
+
/* eslint-enable jsdoc/no-undefined-types -- Need to build this in */
|
|
803
|
+
|
|
800
804
|
|
|
801
805
|
const iterate = (info, indent, jsdoc, ruleConfig, context, lines, jsdocNode, node, settings, sourceCode, iterator, state, iteratingAll) => {
|
|
802
806
|
const report = makeReport(context, jsdocNode);
|