eslint-plugin-jsdoc 50.2.3 → 50.2.5

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.
@@ -18,7 +18,7 @@ const debug = (0, _debug.default)('requireExportJsdoc');
18
18
  /**
19
19
  * @typedef {{
20
20
  * type?: string,
21
- * value?: ValueObject|import('eslint').Rule.Node,
21
+ * value?: ValueObject|import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node,
22
22
  * props: {
23
23
  * [key: string]: CreatedNode|null,
24
24
  * },
@@ -95,7 +95,7 @@ const getIdentifier = function (node, globals, scope, opts) {
95
95
  * @callback CreateSymbol
96
96
  * @param {import('eslint').Rule.Node|null} node
97
97
  * @param {CreatedNode} globals
98
- * @param {import('eslint').Rule.Node|null} value
98
+ * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node|null} value
99
99
  * @param {CreatedNode} [scope]
100
100
  * @param {boolean|SymbolOptions} [isGlobal]
101
101
  * @returns {CreatedNode|null}
@@ -114,7 +114,7 @@ let createSymbol; // eslint-disable-line prefer-const
114
114
 
115
115
  /**
116
116
  *
117
- * @param {import('eslint').Rule.Node} node
117
+ * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} node
118
118
  * @param {CreatedNode} globals
119
119
  * @param {CreatedNode} scope
120
120
  * @param {SymbolOptions} [opt]
@@ -161,13 +161,10 @@ const getSymbol = function (node, globals, scope, opt) {
161
161
  node.body, globals, scope, opts);
162
162
  }
163
163
 
164
- /* c8 ignore next 7 -- No longer needed? */
165
- // @ts-expect-error TS OK
164
+ /* c8 ignore next 4 -- No longer needed? */
166
165
  case 'TSTypeAliasDeclaration':
167
- // @ts-expect-error TS OK
168
166
  // Fallthrough
169
167
  case 'TSEnumDeclaration':
170
- // @ts-expect-error TS OK
171
168
  case 'TSInterfaceDeclaration':
172
169
  case 'ClassDeclaration':
173
170
  case 'FunctionExpression':
@@ -375,7 +372,7 @@ const initVariables = function (node, globals, opts) {
375
372
 
376
373
  /**
377
374
  * Populates variable maps using AST
378
- * @param {import('eslint').Rule.Node} node
375
+ * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} node
379
376
  * @param {CreatedNode} globals
380
377
  * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt
381
378
  * @param {true} [isExport]
@@ -424,6 +421,7 @@ const mapVariables = function (node, globals, opt, isExport) {
424
421
  }
425
422
  break;
426
423
  }
424
+ case 'TSTypeAliasDeclaration':
427
425
  case 'FunctionDeclaration':
428
426
  {
429
427
  /* c8 ignore next 10 */
@@ -498,9 +496,9 @@ const mapVariables = function (node, globals, opt, isExport) {
498
496
  *
499
497
  * @param {import('eslint').Rule.Node} node
500
498
  * @param {CreatedNode|ValueObject|string|undefined|
501
- * import('eslint').Rule.Node} block
499
+ * import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} block
502
500
  * @param {(CreatedNode|ValueObject|string|
503
- * import('eslint').Rule.Node)[]} [cache]
501
+ * import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node)[]} [cache]
504
502
  * @returns {boolean}
505
503
  */
506
504
  const findNode = function (node, block, cache) {
@@ -1 +1 @@
1
- {"version":3,"file":"exportParser.cjs","names":["_jsdoccomment","require","_debug","_interopRequireDefault","e","__esModule","default","debug","debugModule","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","obj","object","propertySymbol","property","computed","propertyValue","body","val","prototype","left","right","method","key","parent","prop","properties","includes","propVal","createBlockSymbol","isGlobal","window","special","nde","id","valueSymbol","initVariables","childNode","expression","declaration","declarations","initWindow","kind","mapVariables","isExport","ancestorsOnly","Boolean","init","exported","ANONYMOUS_DEFAULT","specifier","specifiers","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","ignorableNestedTypes","getExportAncestor","idx","ignorableIfDeep","has","canBeExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","pval","isNodeExported","_globals$props$module","moduleExports","module","exports","initModuleExports","esm","parseRecursive","globalVars","parse","ast","accessibilityNodes","isPrivate","accessibility","undefined","isUncommentedExport","sourceCode","settings","exportNode","findJSDocComment","parseResult","_default"],"sources":["../src/exportParser.js"],"sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\n/**\n * @typedef {{\n * value: string\n * }} ValueObject\n */\n\n/**\n * @typedef {{\n * type?: string,\n * value?: ValueObject|import('eslint').Rule.Node,\n * props: {\n * [key: string]: CreatedNode|null,\n * },\n * special?: true,\n * globalVars?: CreatedNode,\n * exported?: boolean,\n * ANONYMOUS_DEFAULT?: import('eslint').Rule.Node\n * }} CreatedNode\n */\n\n/**\n * @returns {CreatedNode}\n */\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\n/**\n * @param {CreatedNode|null} symbol\n * @returns {string|null}\n */\nconst getSymbolValue = function (symbol) {\n /* c8 ignore next 3 */\n if (!symbol) {\n return null;\n }\n\n /* c8 ignore else */\n if (symbol.type === 'literal') {\n return /** @type {ValueObject} */ (symbol.value).value;\n }\n /* c8 ignore next */\n return null;\n};\n\n/**\n *\n * @param {import('estree').Identifier} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} opts\n * @returns {CreatedNode|null}\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 /* c8 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 /* c8 ignore next 3 */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\n/**\n * @callback CreateSymbol\n * @param {import('eslint').Rule.Node|null} node\n * @param {CreatedNode} globals\n * @param {import('eslint').Rule.Node|null} value\n * @param {CreatedNode} [scope]\n * @param {boolean|SymbolOptions} [isGlobal]\n * @returns {CreatedNode|null}\n */\n\n/** @type {CreateSymbol} */\nlet createSymbol; // eslint-disable-line prefer-const\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * @typedef {{\n * simpleIdentifier?: boolean\n * }} SymbolOptions\n */\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} [opt]\n * @returns {CreatedNode|null}\n */\nconst getSymbol = function (node, globals, scope, opt) {\n /* eslint-enable complexity -- Temporary */\n const opts = opt || {};\n /* c8 ignore next */\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n }\n\n case 'MemberExpression': {\n const obj = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.object),\n globals,\n scope,\n opts,\n );\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.property),\n globals,\n scope,\n {\n simpleIdentifier: !node.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* c8 ignore else */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n /* c8 ignore next 10 */\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n debug(`MemberExpression: Missing property ${\n /** @type {import('estree').PrivateIdentifier} */ (node.property).name\n }`);\n /* c8 ignore next 2 */\n return null;\n }\n\n case 'ClassExpression': {\n return getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.body),\n globals,\n scope,\n opts,\n );\n }\n\n /* c8 ignore next 7 -- No longer needed? */\n // @ts-expect-error TS OK\n case 'TSTypeAliasDeclaration':\n // @ts-expect-error TS OK\n // Fallthrough\n case 'TSEnumDeclaration':\n // @ts-expect-error TS OK\n case 'TSInterfaceDeclaration':\n case 'ClassDeclaration':\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(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n scope,\n opts,\n );\n }\n\n case 'ClassBody': {\n const val = createNode();\n for (const method of node.body) {\n if (!('key' in method)) { // StaticBlock\n continue;\n }\n val.props[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ] = createNode();\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].type = 'object';\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].value = /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').MethodDefinition} */ (method).value\n );\n }\n\n val.type = 'object';\n val.value = node.parent;\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, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n continue;\n }\n\n const propVal = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').Property} */\n (prop).value\n ),\n globals,\n scope,\n opts,\n );\n /* c8 ignore next 8 */\n if (propVal) {\n val.props[\n /** @type {import('estree').PrivateIdentifier} */\n (\n /** @type {import('estree').Property} */ (prop).key\n ).name\n ] = 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 /* c8 ignore next */\n return null;\n};\n\n/**\n *\n * @param {CreatedNode} block\n * @param {string} name\n * @param {CreatedNode|null} value\n * @param {CreatedNode} globals\n * @param {boolean|SymbolOptions|undefined} isGlobal\n * @returns {void}\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 /* c8 ignore next 3 */\n if (!node) {\n return null;\n }\n\n let symbol;\n switch (node.type) {\n case 'FunctionDeclaration':\n /* c8 ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* c8 ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n const nde = /** @type {import('estree').ClassDeclaration} */ (node);\n /* c8 ignore else */\n if (nde.id && nde.id.type === 'Identifier') {\n return createSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.id),\n globals,\n node,\n globals,\n );\n }\n /* c8 ignore next 2 */\n break;\n }\n\n case 'Identifier': {\n const nde = /** @type {import('estree').Identifier} */ (node);\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* c8 ignore else */\n if (valueSymbol) {\n createBlockSymbol(block, nde.name, valueSymbol, globals, isGlobal);\n\n return block.props[nde.name];\n }\n /* c8 ignore next */\n debug('Identifier: Missing value symbol for %s', nde.name);\n } else {\n createBlockSymbol(block, nde.name, createNode(), globals, isGlobal);\n\n return block.props[nde.name];\n }\n /* c8 ignore next 2 */\n break;\n }\n\n case 'MemberExpression': {\n const nde = /** @type {import('estree').MemberExpression} */ (node);\n symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.object), globals, block,\n );\n\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.property),\n globals,\n block,\n {\n simpleIdentifier: !nde.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (value), globals, block,\n ), globals, isGlobal);\n return symbol.props[propertyValue];\n }\n\n debug(\n 'MemberExpression: Missing symbol: %s',\n /** @type {import('estree').Identifier} */ (\n nde.property\n ).name,\n );\n break;\n }\n }\n\n return null;\n};\n\n/**\n * Creates variables from variable definitions\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {void}\n */\nconst initVariables = function (node, globals, opts) {\n switch (node.type) {\n case 'Program': {\n for (const childNode of node.body) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n // let and const\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n null,\n globals,\n );\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[\n /** @type {import('estree').Identifier} */\n (declaration.id).name\n ] = symbol;\n }\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n );\n }\n\n break;\n }\n }\n};\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * Populates variable maps using AST\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {true} [isExport]\n * @returns {boolean}\n */\nconst mapVariables = function (node, globals, opt, isExport) {\n /* eslint-enable complexity -- Temporary */\n /* c8 ignore next */\n const opts = opt || {};\n /* c8 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(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'AssignmentExpression': {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n const isGlobal = Boolean(opts.initWindow && node.kind === 'var' && globals.props.window);\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (declaration.init),\n globals,\n isGlobal,\n );\n if (symbol && isExport) {\n symbol.exported = true;\n }\n }\n\n break;\n }\n\n case 'FunctionDeclaration': {\n /* c8 ignore next 10 */\n if (/** @type {import('estree').Identifier} */ (node.id).type === 'Identifier') {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.id),\n globals,\n node,\n globals,\n true,\n );\n }\n\n break;\n }\n\n case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n if (symbol) {\n symbol.exported = true;\n /* c8 ignore next 6 */\n } else {\n // if (!node.id) {\n globals.ANONYMOUS_DEFAULT = /** @type {import('eslint').Rule.Node} */ (\n node.declaration\n );\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n true,\n );\n } else {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n /* c8 ignore next 3 */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n\n for (const specifier of node.specifiers) {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (specifier),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExportSpecifier': {\n const symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.local),\n globals,\n globals,\n );\n /* c8 ignore next 3 */\n if (symbol) {\n symbol.exported = true;\n }\n\n break;\n }\n\n case 'ClassDeclaration': {\n createSymbol(\n /** @type {import('eslint').Rule.Node|null} */ (node.id),\n globals,\n /** @type {import('eslint').Rule.Node} */ (node.body),\n globals,\n );\n break;\n }\n\n default: {\n /* c8 ignore next */\n return false;\n }\n }\n\n return true;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode|ValueObject|string|undefined|\n * import('eslint').Rule.Node} block\n * @param {(CreatedNode|ValueObject|string|\n * import('eslint').Rule.Node)[]} [cache]\n * @returns {boolean}\n */\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n if (!block || blockCache.includes(block)) {\n return false;\n }\n\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n typeof block === 'object' &&\n 'type' in block &&\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n if (typeof block !== 'object') {\n return false;\n }\n\n const props = ('props' in block && block.props) || ('body' in block && block.body);\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* c8 ignore next 5 */\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]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {import('eslint').Rule.Node|false}\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 'TSTypeLiteral',\n 'TSTypeAliasDeclaration',\n 'TSTypeParameterInstantiation',\n 'TSTypeReference',\n 'ClassDeclaration',\n 'ClassBody',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {false|import('eslint').Rule.Node}\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\n/**\n *\n * @param {CreatedNode} block\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode[]} [cache] Currently unused\n * @returns {boolean}\n */\nconst findExportedNode = function (block, node, cache) {\n /* c8 ignore next 3 */\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 const pval = /** @type {CreatedNode} */ (propval);\n blockCache.push(pval);\n if (pval.exported && (node === pval.value || findNode(node, pval.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\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {boolean}\n */\nconst isNodeExported = function (node, globals, opt) {\n const moduleExports = globals.props.module?.props?.exports;\n if (\n opt.initModuleExports && moduleExports && findNode(node, moduleExports)\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\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globalVars\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {boolean}\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\n/**\n *\n * @param {import('eslint').Rule.Node} ast\n * @param {import('eslint').Rule.Node} node\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {CreatedNode}\n */\nconst parse = function (ast, node, opt) {\n /* c8 ignore next 6 */\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 props: {},\n };\n};\n\nconst accessibilityNodes = new Set([\n 'PropertyDefinition',\n 'MethodDefinition',\n]);\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @returns {boolean}\n */\nconst isPrivate = (node) => {\n return accessibilityNodes.has(node.type) &&\n (\n 'accessibility' in node &&\n node.accessibility !== 'public' && node.accessibility !== undefined\n ) ||\n 'key' in node &&\n node.key.type === 'PrivateIdentifier';\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {import('./iterateJsdoc.js').Settings} settings\n * @returns {boolean}\n */\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n if (isPrivate(node) ||\n node.parent && isPrivate(node.parent)) {\n return false;\n }\n\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 ast = /** @type {unknown} */ (sourceCode.ast);\n\n const parseResult = parse(\n /** @type {import('eslint').Rule.Node} */\n (ast),\n node,\n opt,\n );\n\n return isNodeExported(\n node, /** @type {CreatedNode} */ (parseResult.globalVars), opt,\n );\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAgC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,KAAK,GAAG,IAAAC,cAAW,EAAC,oBAAoB,CAAC;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,SAAAA,CAAA,EAAY;EAC7B,OAAO;IACLC,KAAK,E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D,UAAU,EAAEF,UAAU,EAAEC,QAAQ,CAAC,EAAE;MACrE,OAAO,IAAI;IACb;;IAEA;AACJ;AACA;IACI,IACEpB,kBAAkB,CAACzE,IAAI,CAAC,IACxB,CAAC,IAAA+F,8BAAgB,EAAC/F,IAAI,EAAE4F,UAAU,EAAEC,QAAQ,CAAC,EAC7C;MACA,OAAO,IAAI;IACb;EACF;EAEA,MAAMP,GAAG,GAAG,sBAAwBM,UAAU,CAACN,GAAI;EAEnD,MAAMU,WAAW,GAAGX,KAAK,EACvB;EACCC,GAAG,EACJtF,IAAI,EACJU,GACF,CAAC;EAED,OAAOkE,cAAc,CACnB5E,IAAI,EAAE,0BAA4BgG,WAAW,CAACZ,UAAU,EAAG1E,GAC7D,CAAC;AACH,CAAC;AAAC,IAAAuF,QAAA,GAAAjB,OAAA,CAAA1F,OAAA,GAEa;EACbqG,mBAAmB;EACnBN;AACF,CAAC;AAAAN,MAAA,CAAAC,OAAA,GAAAA,OAAA,CAAA1F,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"exportParser.cjs","names":["_jsdoccomment","require","_debug","_interopRequireDefault","e","__esModule","default","debug","debugModule","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","obj","object","propertySymbol","property","computed","propertyValue","body","val","prototype","left","right","method","key","parent","prop","properties","includes","propVal","createBlockSymbol","isGlobal","window","special","nde","id","valueSymbol","initVariables","childNode","expression","declaration","declarations","initWindow","kind","mapVariables","isExport","ancestorsOnly","Boolean","init","exported","ANONYMOUS_DEFAULT","specifier","specifiers","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","ignorableNestedTypes","getExportAncestor","idx","ignorableIfDeep","has","canBeExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","pval","isNodeExported","_globals$props$module","moduleExports","module","exports","initModuleExports","esm","parseRecursive","globalVars","parse","ast","accessibilityNodes","isPrivate","accessibility","undefined","isUncommentedExport","sourceCode","settings","exportNode","findJSDocComment","parseResult","_default"],"sources":["../src/exportParser.js"],"sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\n/**\n * @typedef {{\n * value: string\n * }} ValueObject\n */\n\n/**\n * @typedef {{\n * type?: string,\n * value?: ValueObject|import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node,\n * props: {\n * [key: string]: CreatedNode|null,\n * },\n * special?: true,\n * globalVars?: CreatedNode,\n * exported?: boolean,\n * ANONYMOUS_DEFAULT?: import('eslint').Rule.Node\n * }} CreatedNode\n */\n\n/**\n * @returns {CreatedNode}\n */\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\n/**\n * @param {CreatedNode|null} symbol\n * @returns {string|null}\n */\nconst getSymbolValue = function (symbol) {\n /* c8 ignore next 3 */\n if (!symbol) {\n return null;\n }\n\n /* c8 ignore else */\n if (symbol.type === 'literal') {\n return /** @type {ValueObject} */ (symbol.value).value;\n }\n /* c8 ignore next */\n return null;\n};\n\n/**\n *\n * @param {import('estree').Identifier} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} opts\n * @returns {CreatedNode|null}\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 /* c8 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 /* c8 ignore next 3 */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\n/**\n * @callback CreateSymbol\n * @param {import('eslint').Rule.Node|null} node\n * @param {CreatedNode} globals\n * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node|null} value\n * @param {CreatedNode} [scope]\n * @param {boolean|SymbolOptions} [isGlobal]\n * @returns {CreatedNode|null}\n */\n\n/** @type {CreateSymbol} */\nlet createSymbol; // eslint-disable-line prefer-const\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * @typedef {{\n * simpleIdentifier?: boolean\n * }} SymbolOptions\n */\n\n/**\n *\n * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} node\n * @param {CreatedNode} globals\n * @param {CreatedNode} scope\n * @param {SymbolOptions} [opt]\n * @returns {CreatedNode|null}\n */\nconst getSymbol = function (node, globals, scope, opt) {\n /* eslint-enable complexity -- Temporary */\n const opts = opt || {};\n /* c8 ignore next */\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n }\n\n case 'MemberExpression': {\n const obj = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.object),\n globals,\n scope,\n opts,\n );\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.property),\n globals,\n scope,\n {\n simpleIdentifier: !node.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* c8 ignore else */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n /* c8 ignore next 10 */\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n debug(`MemberExpression: Missing property ${\n /** @type {import('estree').PrivateIdentifier} */ (node.property).name\n }`);\n /* c8 ignore next 2 */\n return null;\n }\n\n case 'ClassExpression': {\n return getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.body),\n globals,\n scope,\n opts,\n );\n }\n\n /* c8 ignore next 4 -- No longer needed? */\n case 'TSTypeAliasDeclaration':\n // Fallthrough\n case 'TSEnumDeclaration':\n case 'TSInterfaceDeclaration':\n case 'ClassDeclaration':\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(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n scope,\n opts,\n );\n }\n\n case 'ClassBody': {\n const val = createNode();\n for (const method of node.body) {\n if (!('key' in method)) { // StaticBlock\n continue;\n }\n val.props[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ] = createNode();\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].type = 'object';\n /** @type {{[key: string]: CreatedNode}} */ (val.props)[\n /** @type {import('estree').Identifier} */ (\n /** @type {import('estree').MethodDefinition} */ (\n method\n ).key\n ).name\n ].value = /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').MethodDefinition} */ (method).value\n );\n }\n\n val.type = 'object';\n val.value = node.parent;\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, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n continue;\n }\n\n const propVal = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (\n /** @type {import('estree').Property} */\n (prop).value\n ),\n globals,\n scope,\n opts,\n );\n /* c8 ignore next 8 */\n if (propVal) {\n val.props[\n /** @type {import('estree').PrivateIdentifier} */\n (\n /** @type {import('estree').Property} */ (prop).key\n ).name\n ] = 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 /* c8 ignore next */\n return null;\n};\n\n/**\n *\n * @param {CreatedNode} block\n * @param {string} name\n * @param {CreatedNode|null} value\n * @param {CreatedNode} globals\n * @param {boolean|SymbolOptions|undefined} isGlobal\n * @returns {void}\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 /* c8 ignore next 3 */\n if (!node) {\n return null;\n }\n\n let symbol;\n switch (node.type) {\n case 'FunctionDeclaration':\n /* c8 ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* c8 ignore next */\n // @ts-expect-error TS OK\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n const nde = /** @type {import('estree').ClassDeclaration} */ (node);\n /* c8 ignore else */\n if (nde.id && nde.id.type === 'Identifier') {\n return createSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.id),\n globals,\n node,\n globals,\n );\n }\n /* c8 ignore next 2 */\n break;\n }\n\n case 'Identifier': {\n const nde = /** @type {import('estree').Identifier} */ (node);\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* c8 ignore else */\n if (valueSymbol) {\n createBlockSymbol(block, nde.name, valueSymbol, globals, isGlobal);\n\n return block.props[nde.name];\n }\n /* c8 ignore next */\n debug('Identifier: Missing value symbol for %s', nde.name);\n } else {\n createBlockSymbol(block, nde.name, createNode(), globals, isGlobal);\n\n return block.props[nde.name];\n }\n /* c8 ignore next 2 */\n break;\n }\n\n case 'MemberExpression': {\n const nde = /** @type {import('estree').MemberExpression} */ (node);\n symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.object), globals, block,\n );\n\n const propertySymbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */ (nde.property),\n globals,\n block,\n {\n simpleIdentifier: !nde.computed,\n },\n );\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (value), globals, block,\n ), globals, isGlobal);\n return symbol.props[propertyValue];\n }\n\n debug(\n 'MemberExpression: Missing symbol: %s',\n /** @type {import('estree').Identifier} */ (\n nde.property\n ).name,\n );\n break;\n }\n }\n\n return null;\n};\n\n/**\n * Creates variables from variable definitions\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {void}\n */\nconst initVariables = function (node, globals, opts) {\n switch (node.type) {\n case 'Program': {\n for (const childNode of node.body) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n // let and const\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n null,\n globals,\n );\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[\n /** @type {import('estree').Identifier} */\n (declaration.id).name\n ] = symbol;\n }\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n );\n }\n\n break;\n }\n }\n};\n\n/* eslint-disable complexity -- Temporary */\n\n/**\n * Populates variable maps using AST\n * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {true} [isExport]\n * @returns {boolean}\n */\nconst mapVariables = function (node, globals, opt, isExport) {\n /* eslint-enable complexity -- Temporary */\n /* c8 ignore next */\n const opts = opt || {};\n /* c8 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(\n /** @type {import('eslint').Rule.Node} */\n (childNode),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExpressionStatement': {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.expression),\n globals,\n opts,\n );\n break;\n }\n\n case 'AssignmentExpression': {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.left),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.right),\n );\n break;\n }\n\n case 'VariableDeclaration': {\n for (const declaration of node.declarations) {\n const isGlobal = Boolean(opts.initWindow && node.kind === 'var' && globals.props.window);\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (declaration.id),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (declaration.init),\n globals,\n isGlobal,\n );\n if (symbol && isExport) {\n symbol.exported = true;\n }\n }\n\n break;\n }\n\n case 'TSTypeAliasDeclaration':\n case 'FunctionDeclaration': {\n /* c8 ignore next 10 */\n if (/** @type {import('estree').Identifier} */ (node.id).type === 'Identifier') {\n createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.id),\n globals,\n node,\n globals,\n true,\n );\n }\n\n break;\n }\n\n case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n if (symbol) {\n symbol.exported = true;\n /* c8 ignore next 6 */\n } else {\n // if (!node.id) {\n globals.ANONYMOUS_DEFAULT = /** @type {import('eslint').Rule.Node} */ (\n node.declaration\n );\n }\n\n break;\n }\n\n case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n opts,\n true,\n );\n } else {\n const symbol = createSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n globals,\n /** @type {import('eslint').Rule.Node} */\n (node.declaration),\n );\n /* c8 ignore next 3 */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n\n for (const specifier of node.specifiers) {\n mapVariables(\n /** @type {import('eslint').Rule.Node} */\n (specifier),\n globals,\n opts,\n );\n }\n\n break;\n }\n\n case 'ExportSpecifier': {\n const symbol = getSymbol(\n /** @type {import('eslint').Rule.Node} */\n (node.local),\n globals,\n globals,\n );\n /* c8 ignore next 3 */\n if (symbol) {\n symbol.exported = true;\n }\n\n break;\n }\n\n case 'ClassDeclaration': {\n createSymbol(\n /** @type {import('eslint').Rule.Node|null} */ (node.id),\n globals,\n /** @type {import('eslint').Rule.Node} */ (node.body),\n globals,\n );\n break;\n }\n\n default: {\n /* c8 ignore next */\n return false;\n }\n }\n\n return true;\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode|ValueObject|string|undefined|\n * import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} block\n * @param {(CreatedNode|ValueObject|string|\n * import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node)[]} [cache]\n * @returns {boolean}\n */\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n if (!block || blockCache.includes(block)) {\n return false;\n }\n\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n typeof block === 'object' &&\n 'type' in block &&\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n if (typeof block !== 'object') {\n return false;\n }\n\n const props = ('props' in block && block.props) || ('body' in block && block.body);\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* c8 ignore next 5 */\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]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {import('eslint').Rule.Node|false}\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 'TSTypeLiteral',\n 'TSTypeAliasDeclaration',\n 'TSTypeParameterInstantiation',\n 'TSTypeReference',\n 'ClassDeclaration',\n 'ClassBody',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\n/**\n * @param {import('eslint').Rule.Node} nde\n * @returns {false|import('eslint').Rule.Node}\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\n/**\n *\n * @param {CreatedNode} block\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode[]} [cache] Currently unused\n * @returns {boolean}\n */\nconst findExportedNode = function (block, node, cache) {\n /* c8 ignore next 3 */\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 const pval = /** @type {CreatedNode} */ (propval);\n blockCache.push(pval);\n if (pval.exported && (node === pval.value || findNode(node, pval.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\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globals\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {boolean}\n */\nconst isNodeExported = function (node, globals, opt) {\n const moduleExports = globals.props.module?.props?.exports;\n if (\n opt.initModuleExports && moduleExports && findNode(node, moduleExports)\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\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {CreatedNode} globalVars\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opts\n * @returns {boolean}\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\n/**\n *\n * @param {import('eslint').Rule.Node} ast\n * @param {import('eslint').Rule.Node} node\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @returns {CreatedNode}\n */\nconst parse = function (ast, node, opt) {\n /* c8 ignore next 6 */\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 props: {},\n };\n};\n\nconst accessibilityNodes = new Set([\n 'PropertyDefinition',\n 'MethodDefinition',\n]);\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @returns {boolean}\n */\nconst isPrivate = (node) => {\n return accessibilityNodes.has(node.type) &&\n (\n 'accessibility' in node &&\n node.accessibility !== 'public' && node.accessibility !== undefined\n ) ||\n 'key' in node &&\n node.key.type === 'PrivateIdentifier';\n};\n\n/**\n *\n * @param {import('eslint').Rule.Node} node\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt\n * @param {import('./iterateJsdoc.js').Settings} settings\n * @returns {boolean}\n */\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n if (isPrivate(node) ||\n node.parent && isPrivate(node.parent)) {\n return false;\n }\n\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 ast = /** @type {unknown} */ (sourceCode.ast);\n\n const parseResult = parse(\n /** @type {import('eslint').Rule.Node} */\n (ast),\n node,\n opt,\n );\n\n return isNodeExported(\n node, /** @type {CreatedNode} */ (parseResult.globalVars), opt,\n );\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAgC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,KAAK,GAAG,IAAAC,cAAW,EAAC,oBAAoB,CAAC;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,SAAAA,CAAA,EAAY;EAC7B,OAAO;IACLC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AC,8BAAgB,EAACD,UAAU,EAAEF,UAAU,EAAEC,QAAQ,CAAC,EAAE;MACrE,OAAO,IAAI;IACb;;IAEA;AACJ;AACA;IACI,IACEpB,kBAAkB,CAACzE,IAAI,CAAC,IACxB,CAAC,IAAA+F,8BAAgB,EAAC/F,IAAI,EAAE4F,UAAU,EAAEC,QAAQ,CAAC,EAC7C;MACA,OAAO,IAAI;IACb;EACF;EAEA,MAAMP,GAAG,GAAG,sBAAwBM,UAAU,CAACN,GAAI;EAEnD,MAAMU,WAAW,GAAGX,KAAK,EACvB;EACCC,GAAG,EACJtF,IAAI,EACJU,GACF,CAAC;EAED,OAAOkE,cAAc,CACnB5E,IAAI,EAAE,0BAA4BgG,WAAW,CAACZ,UAAU,EAAG1E,GAC7D,CAAC;AACH,CAAC;AAAC,IAAAuF,QAAA,GAAAjB,OAAA,CAAA1F,OAAA,GAEa;EACbqG,mBAAmB;EACnBN;AACF,CAAC;AAAAN,MAAA,CAAAC,OAAA,GAAAA,OAAA,CAAA1F,OAAA","ignoreList":[]}
@@ -171,8 +171,13 @@ const allBrancheshaveReturnValues = (node, promFilter) => {
171
171
  }
172
172
 
173
173
  // Fallthrough
174
- case 'LabeledStatement':
175
174
  case 'ForStatement':
175
+ if (node.test === null) {
176
+ // If this is an infinite loop, we assume only one branch
177
+ // is needed to provide a return
178
+ return hasReturnValue(node.body, false, promFilter);
179
+ }
180
+ case 'LabeledStatement':
176
181
  case 'ForInStatement':
177
182
  case 'ForOfStatement':
178
183
  case 'WithStatement':
@@ -1 +1 @@
1
- {"version":3,"file":"hasReturnValue.cjs","names":["isNewPromiseExpression","node","type","callee","name","isVoidPromise","_node$typeArguments","_node$typeParameters","typeArguments","params","typeParameters","undefinedKeywords","Set","hasReturnValue","throwOnNullReturn","promFilter","_node$returnType","returnType","typeAnnotation","has","value","expression","body","some","bodyNode","consequent","alternate","block","handler","finalizer","cases","someCase","nde","argument","Error","exports","allBrancheshaveReturnValues","_node$returnType2","lastBodyNode","slice","test","error","message","every","consNode","hasNonEmptyResolverCall","resolverName","arguments","length","undefined","_node$params$","elements","element","right","left","expressions","subExpression","properties","property","decorators","decorator","computed","key","declarations","id","init","quasi","object","source","hasValueOrExecutorHasNonEmptyResolveValue","anyPromiseAsReturn","allBranches","hasReturnMethod","promiseFilter","hasReturn","Boolean","prom"],"sources":["../../src/utils/hasReturnValue.js"],"sourcesContent":["/**\n * @typedef {import('estree').Node|\n * import('@typescript-eslint/types').TSESTree.Node} ESTreeOrTypeScriptNode\n */\n\n/**\n * Checks if a node is a promise but has no resolve value or an empty value.\n * An `undefined` resolve does not count.\n * @param {ESTreeOrTypeScriptNode|undefined|null} node\n * @returns {boolean|undefined|null}\n */\nconst isNewPromiseExpression = (node) => {\n return node && node.type === 'NewExpression' && node.callee.type === 'Identifier' &&\n node.callee.name === 'Promise';\n};\n\n/**\n * @param {ESTreeOrTypeScriptNode|null|undefined} node\n * @returns {boolean}\n */\nconst isVoidPromise = (node) => {\n return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeArguments?.params?.[0]?.type === 'TSVoidKeyword'\n /* c8 ignore next 4 */\n || /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (\n node\n // @ts-expect-error Ok\n )?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';\n};\n\nconst undefinedKeywords = new Set([\n 'TSVoidKeyword', 'TSUndefinedKeyword', 'TSNeverKeyword',\n]);\n\n/**\n * Checks if a node has a return statement. Void return does not count.\n * @param {ESTreeOrTypeScriptNode|undefined|null} node\n * @param {boolean} [throwOnNullReturn]\n * @param {PromiseFilter} [promFilter]\n * @returns {boolean|undefined}\n */\n// eslint-disable-next-line complexity\nconst hasReturnValue = (node, throwOnNullReturn, promFilter) => {\n if (!node) {\n return false;\n }\n\n switch (node.type) {\n case 'TSDeclareFunction':\n case 'TSFunctionType':\n case 'TSMethodSignature': {\n const type = node?.returnType?.typeAnnotation?.type;\n return type && !undefinedKeywords.has(type);\n }\n\n case 'MethodDefinition':\n return hasReturnValue(node.value, throwOnNullReturn, promFilter);\n case 'FunctionExpression':\n case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n return 'expression' in node && node.expression && (!isNewPromiseExpression(\n node.body,\n ) || !isVoidPromise(node.body)) ||\n hasReturnValue(node.body, throwOnNullReturn, promFilter);\n }\n\n case 'BlockStatement': {\n return node.body.some((bodyNode) => {\n return bodyNode.type !== 'FunctionDeclaration' && hasReturnValue(bodyNode, throwOnNullReturn, promFilter);\n });\n }\n\n case 'LabeledStatement':\n case 'WhileStatement':\n case 'DoWhileStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n case 'WithStatement': {\n return hasReturnValue(node.body, throwOnNullReturn, promFilter);\n }\n\n case 'IfStatement': {\n return hasReturnValue(node.consequent, throwOnNullReturn, promFilter) ||\n hasReturnValue(node.alternate, throwOnNullReturn, promFilter);\n }\n\n case 'TryStatement': {\n return hasReturnValue(node.block, throwOnNullReturn, promFilter) ||\n hasReturnValue(node.handler && node.handler.body, throwOnNullReturn, promFilter) ||\n hasReturnValue(node.finalizer, throwOnNullReturn, promFilter);\n }\n\n case 'SwitchStatement': {\n return node.cases.some(\n (someCase) => {\n return someCase.consequent.some((nde) => {\n return hasReturnValue(nde, throwOnNullReturn, promFilter);\n });\n },\n );\n }\n\n case 'ReturnStatement': {\n // void return does not count.\n if (node.argument === null) {\n if (throwOnNullReturn) {\n throw new Error('Null return');\n }\n\n return false;\n }\n\n if (promFilter && isNewPromiseExpression(node.argument)) {\n // Let caller decide how to filter, but this is, at the least,\n // a return of sorts and truthy\n return promFilter(node.argument);\n }\n\n return true;\n }\n\n default: {\n return false;\n }\n }\n};\n\n/**\n * Checks if a node has a return statement. Void return does not count.\n * @param {ESTreeOrTypeScriptNode|null|undefined} node\n * @param {PromiseFilter} promFilter\n * @returns {undefined|boolean|ESTreeOrTypeScriptNode}\n */\n// eslint-disable-next-line complexity\nconst allBrancheshaveReturnValues = (node, promFilter) => {\n if (!node) {\n return false;\n }\n\n switch (node.type) {\n case 'TSDeclareFunction':\n case 'TSFunctionType':\n case 'TSMethodSignature': {\n const type = node?.returnType?.typeAnnotation?.type;\n return type && !undefinedKeywords.has(type);\n }\n\n // case 'MethodDefinition':\n // return allBrancheshaveReturnValues(node.value, promFilter);\n case 'FunctionExpression':\n case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n return 'expression' in node && node.expression && (!isNewPromiseExpression(node.body) || !isVoidPromise(node.body)) ||\n allBrancheshaveReturnValues(node.body, promFilter) ||\n /** @type {import('@typescript-eslint/types').TSESTree.BlockStatement} */\n (node.body).body.some((nde) => {\n return nde.type === 'ReturnStatement';\n });\n }\n\n case 'BlockStatement': {\n const lastBodyNode = node.body.slice(-1)[0];\n return allBrancheshaveReturnValues(lastBodyNode, promFilter);\n }\n\n case 'WhileStatement':\n case 'DoWhileStatement':\n if (\n /**\n * @type {import('@typescript-eslint/types').TSESTree.Literal}\n */\n (node.test).value === true\n ) {\n // If this is an infinite loop, we assume only one branch\n // is needed to provide a return\n return hasReturnValue(node.body, false, promFilter);\n }\n\n // Fallthrough\n case 'LabeledStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n case 'WithStatement': {\n return allBrancheshaveReturnValues(node.body, promFilter);\n }\n\n case 'IfStatement': {\n return allBrancheshaveReturnValues(node.consequent, promFilter) &&\n allBrancheshaveReturnValues(node.alternate, promFilter);\n }\n\n case 'TryStatement': {\n // If `finally` returns, all return\n return node.finalizer && allBrancheshaveReturnValues(node.finalizer, promFilter) ||\n // Return in `try`/`catch` may still occur despite `finally`\n allBrancheshaveReturnValues(node.block, promFilter) &&\n (!node.handler ||\n allBrancheshaveReturnValues(node.handler && node.handler.body, promFilter)) &&\n (!node.finalizer || (() => {\n try {\n hasReturnValue(node.finalizer, true, promFilter);\n } catch (error) {\n if (/** @type {Error} */ (error).message === 'Null return') {\n return false;\n }\n /* c8 ignore next 2 */\n throw error;\n }\n\n // As long as not an explicit empty return, then return true\n return true;\n })());\n }\n\n case 'SwitchStatement': {\n return /** @type {import('@typescript-eslint/types').TSESTree.SwitchStatement} */ (node).cases.every(\n (someCase) => {\n return !someCase.consequent.some((consNode) => {\n return consNode.type === 'BreakStatement' ||\n consNode.type === 'ReturnStatement' && consNode.argument === null;\n });\n },\n );\n }\n\n case 'ThrowStatement': {\n return true;\n }\n\n case 'ReturnStatement': {\n // void return does not count.\n if (node.argument === null) {\n return false;\n }\n\n if (promFilter && isNewPromiseExpression(node.argument)) {\n // Let caller decide how to filter, but this is, at the least,\n // a return of sorts and truthy\n return promFilter(node.argument);\n }\n\n return true;\n }\n\n default: {\n return false;\n }\n }\n};\n\n/**\n * @callback PromiseFilter\n * @param {ESTreeOrTypeScriptNode|undefined} node\n * @returns {boolean}\n */\n\n/**\n * Avoids further checking child nodes if a nested function shadows the\n * resolver, but otherwise, if name is used (by call or passed in as an\n * argument to another function), will be considered as non-empty.\n *\n * This could check for redeclaration of the resolver, but as such is\n * unlikely, we avoid the performance cost of checking everywhere for\n * (re)declarations or assignments.\n * @param {import('@typescript-eslint/types').TSESTree.Node|null|undefined} node\n * @param {string} resolverName\n * @returns {boolean}\n */\n// eslint-disable-next-line complexity\nconst hasNonEmptyResolverCall = (node, resolverName) => {\n if (!node) {\n return false;\n }\n\n // Arrow function without block\n switch (node.type) {\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'OptionalCallExpression':\n case 'CallExpression':\n return /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n node.callee\n ).name === resolverName && (\n\n // Implicit or explicit undefined\n node.arguments.length > 1 || node.arguments[0] !== undefined\n ) ||\n node.arguments.some((nde) => {\n // Being passed in to another function (which might invoke it)\n return nde.type === 'Identifier' && nde.name === resolverName ||\n\n // Handle nested items\n hasNonEmptyResolverCall(nde, resolverName);\n });\n case 'ChainExpression':\n case 'Decorator':\n case 'ExpressionStatement':\n return hasNonEmptyResolverCall(node.expression, resolverName);\n case 'ClassBody':\n case 'BlockStatement':\n return node.body.some((bodyNode) => {\n return hasNonEmptyResolverCall(bodyNode, resolverName);\n });\n case 'FunctionExpression':\n case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n // Shadowing\n if (/** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n node.params[0]\n )?.name === resolverName) {\n return false;\n }\n\n return hasNonEmptyResolverCall(node.body, resolverName);\n }\n\n case 'LabeledStatement':\n case 'WhileStatement':\n case 'DoWhileStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n case 'WithStatement': {\n return hasNonEmptyResolverCall(node.body, resolverName);\n }\n\n case 'ConditionalExpression':\n case 'IfStatement': {\n return hasNonEmptyResolverCall(node.test, resolverName) ||\n hasNonEmptyResolverCall(node.consequent, resolverName) ||\n hasNonEmptyResolverCall(node.alternate, resolverName);\n }\n\n case 'TryStatement': {\n return hasNonEmptyResolverCall(node.block, resolverName) ||\n hasNonEmptyResolverCall(node.handler && node.handler.body, resolverName) ||\n hasNonEmptyResolverCall(node.finalizer, resolverName);\n }\n\n case 'SwitchStatement': {\n return node.cases.some(\n (someCase) => {\n return someCase.consequent.some((nde) => {\n return hasNonEmptyResolverCall(nde, resolverName);\n });\n },\n );\n }\n\n case 'ArrayPattern':\n case 'ArrayExpression':\n return node.elements.some((element) => {\n return hasNonEmptyResolverCall(element, resolverName);\n });\n\n case 'AssignmentPattern':\n return hasNonEmptyResolverCall(node.right, resolverName);\n\n case 'AssignmentExpression':\n case 'BinaryExpression':\n case 'LogicalExpression': {\n return hasNonEmptyResolverCall(node.left, resolverName) ||\n hasNonEmptyResolverCall(node.right, resolverName);\n }\n\n // Comma\n case 'SequenceExpression':\n case 'TemplateLiteral':\n return node.expressions.some((subExpression) => {\n return hasNonEmptyResolverCall(subExpression, resolverName);\n });\n\n case 'ObjectPattern':\n case 'ObjectExpression':\n return node.properties.some((property) => {\n return hasNonEmptyResolverCall(property, resolverName);\n });\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ClassMethod':\n case 'MethodDefinition':\n return node.decorators && node.decorators.some((decorator) => {\n return hasNonEmptyResolverCall(decorator, resolverName);\n }) ||\n node.computed && hasNonEmptyResolverCall(node.key, resolverName) ||\n hasNonEmptyResolverCall(node.value, resolverName);\n\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ObjectProperty':\n /* eslint-disable no-fallthrough */\n /* c8 ignore next -- In Babel? */\n case 'PropertyDefinition':\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ClassProperty':\n case 'Property':\n /* eslint-enable no-fallthrough */\n return node.computed && hasNonEmptyResolverCall(node.key, resolverName) ||\n hasNonEmptyResolverCall(node.value, resolverName);\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ObjectMethod':\n /* c8 ignore next 6 -- In Babel? */\n // @ts-expect-error\n return node.computed && hasNonEmptyResolverCall(node.key, resolverName) ||\n // @ts-expect-error\n node.arguments.some((nde) => {\n return hasNonEmptyResolverCall(nde, resolverName);\n });\n\n case 'ClassExpression':\n case 'ClassDeclaration':\n return hasNonEmptyResolverCall(node.body, resolverName);\n\n case 'AwaitExpression':\n case 'SpreadElement':\n case 'UnaryExpression':\n case 'YieldExpression':\n return hasNonEmptyResolverCall(node.argument, resolverName);\n\n case 'VariableDeclaration': {\n return node.declarations.some((nde) => {\n return hasNonEmptyResolverCall(nde, resolverName);\n });\n }\n\n case 'VariableDeclarator': {\n return hasNonEmptyResolverCall(node.id, resolverName) ||\n hasNonEmptyResolverCall(node.init, resolverName);\n }\n\n case 'TaggedTemplateExpression':\n return hasNonEmptyResolverCall(node.quasi, resolverName);\n\n // ?.\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'OptionalMemberExpression':\n case 'MemberExpression':\n return hasNonEmptyResolverCall(node.object, resolverName) ||\n hasNonEmptyResolverCall(node.property, resolverName);\n\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'Import':\n case 'ImportExpression':\n return hasNonEmptyResolverCall(node.source, resolverName);\n\n case 'ReturnStatement': {\n if (node.argument === null) {\n return false;\n }\n\n return hasNonEmptyResolverCall(node.argument, resolverName);\n }\n\n /*\n // Shouldn't need to parse literals/literal components, etc.\n\n case 'Identifier':\n case 'TemplateElement':\n case 'Super':\n // Exports not relevant in this context\n */\n default:\n return false;\n }\n};\n\n/**\n * Checks if a Promise executor has no resolve value or an empty value.\n * An `undefined` resolve does not count.\n * @param {ESTreeOrTypeScriptNode} node\n * @param {boolean} anyPromiseAsReturn\n * @param {boolean} [allBranches]\n * @returns {boolean}\n */\nconst hasValueOrExecutorHasNonEmptyResolveValue = (node, anyPromiseAsReturn, allBranches) => {\n const hasReturnMethod = allBranches ?\n /**\n * @param {ESTreeOrTypeScriptNode} nde\n * @param {PromiseFilter} promiseFilter\n * @returns {boolean}\n */\n (nde, promiseFilter) => {\n let hasReturn;\n try {\n hasReturn = hasReturnValue(nde, true, promiseFilter);\n } catch (error) {\n // c8 ignore else\n if (/** @type {Error} */ (error).message === 'Null return') {\n return false;\n }\n /* c8 ignore next 2 */\n throw error;\n }\n\n // `hasReturn` check needed since `throw` treated as valid return by\n // `allBrancheshaveReturnValues`\n return Boolean(hasReturn && allBrancheshaveReturnValues(nde, promiseFilter));\n } :\n /**\n * @param {ESTreeOrTypeScriptNode} nde\n * @param {PromiseFilter} promiseFilter\n * @returns {boolean}\n */\n (nde, promiseFilter) => {\n return Boolean(hasReturnValue(nde, false, promiseFilter));\n };\n\n return hasReturnMethod(node, (prom) => {\n if (anyPromiseAsReturn) {\n return true;\n }\n\n if (isVoidPromise(prom)) {\n return false;\n }\n\n const {\n params,\n body,\n } =\n /**\n * @type {import('@typescript-eslint/types').TSESTree.FunctionExpression|\n * import('@typescript-eslint/types').TSESTree.ArrowFunctionExpression}\n */ (\n /** @type {import('@typescript-eslint/types').TSESTree.NewExpression} */ (\n prom\n ).arguments[0]\n ) || {};\n\n if (!params?.length) {\n return false;\n }\n\n const {\n name: resolverName,\n } = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n params[0]\n );\n\n return hasNonEmptyResolverCall(body, resolverName);\n });\n};\n\nexport {\n hasReturnValue,\n hasValueOrExecutorHasNonEmptyResolveValue,\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,sBAAsB,GAAIC,IAAI,IAAK;EACvC,OAAOA,IAAI,IAAIA,IAAI,CAACC,IAAI,KAAK,eAAe,IAAID,IAAI,CAACE,MAAM,CAACD,IAAI,KAAK,YAAY,IAC/ED,IAAI,CAACE,MAAM,CAACC,IAAI,KAAK,SAAS;AAClC,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIJ,IAAI,IAAK;EAAA,IAAAK,mBAAA,EAAAC,oBAAA;EAC9B,OAAO,0EAA2E,CAACN,IAAI,aAAJA,IAAI,gBAAAK,mBAAA,GAAJL,IAAI,CAAGO,aAAa,cAAAF,mBAAA,gBAAAA,mBAAA,GAArBA,mBAAA,CAAuBG,MAAM,cAAAH,mBAAA,gBAAAA,mBAAA,GAA7BA,mBAAA,CAAgC,CAAC,CAAC,cAAAA,mBAAA,uBAAlCA,mBAAA,CAAoCJ,IAAI,MAAK;EAC7H,0BACG,0EAA2E,CAC5ED;EACF;EAAA,YADEA;EACF;EAAA,eAAAM,oBAAA,GADEN;EACF;EAAA,CACGS,cAAc,cAAAH,oBAAA,gBAAAA,oBAAA,GAH6DA,oBAAA,CAG3DE,MAAM,cAAAF,oBAAA,gBAAAA,oBAAA,GAHqDA,oBAAA,CAGlD,CAAC,CAAC,cAAAA,oBAAA,uBAHgDA,oBAAA,CAG9CL,IAAI,MAAK,eAAe;AAC5D,CAAC;AAED,MAAMS,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,CACxD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K;IACd;IAEA,MAAM;MACJ5C,IAAI,EAAE0C;IACR,CAAC,GAAG;IACFrC,MAAM,CAAC,CAAC,CACT;IAED,OAAOoC,uBAAuB,CAACvB,IAAI,EAAEwB,YAAY,CAAC;EACpD,CAAC,CAAC;AACJ,CAAC;AAACX,OAAA,CAAAkC,yCAAA,GAAAA,yCAAA","ignoreList":[]}
1
+ {"version":3,"file":"hasReturnValue.cjs","names":["isNewPromiseExpression","node","type","callee","name","isVoidPromise","_node$typeArguments","_node$typeParameters","typeArguments","params","typeParameters","undefinedKeywords","Set","hasReturnValue","throwOnNullReturn","promFilter","_node$returnType","returnType","typeAnnotation","has","value","expression","body","some","bodyNode","consequent","alternate","block","handler","finalizer","cases","someCase","nde","argument","Error","exports","allBrancheshaveReturnValues","_node$returnType2","lastBodyNode","slice","test","error","message","every","consNode","hasNonEmptyResolverCall","resolverName","arguments","length","undefined","_node$params$","elements","element","right","left","expressions","subExpression","properties","property","decorators","decorator","computed","key","declarations","id","init","quasi","object","source","hasValueOrExecutorHasNonEmptyResolveValue","anyPromiseAsReturn","allBranches","hasReturnMethod","promiseFilter","hasReturn","Boolean","prom"],"sources":["../../src/utils/hasReturnValue.js"],"sourcesContent":["/**\n * @typedef {import('estree').Node|\n * import('@typescript-eslint/types').TSESTree.Node} ESTreeOrTypeScriptNode\n */\n\n/**\n * Checks if a node is a promise but has no resolve value or an empty value.\n * An `undefined` resolve does not count.\n * @param {ESTreeOrTypeScriptNode|undefined|null} node\n * @returns {boolean|undefined|null}\n */\nconst isNewPromiseExpression = (node) => {\n return node && node.type === 'NewExpression' && node.callee.type === 'Identifier' &&\n node.callee.name === 'Promise';\n};\n\n/**\n * @param {ESTreeOrTypeScriptNode|null|undefined} node\n * @returns {boolean}\n */\nconst isVoidPromise = (node) => {\n return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeArguments?.params?.[0]?.type === 'TSVoidKeyword'\n /* c8 ignore next 4 */\n || /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (\n node\n // @ts-expect-error Ok\n )?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';\n};\n\nconst undefinedKeywords = new Set([\n 'TSVoidKeyword', 'TSUndefinedKeyword', 'TSNeverKeyword',\n]);\n\n/**\n * Checks if a node has a return statement. Void return does not count.\n * @param {ESTreeOrTypeScriptNode|undefined|null} node\n * @param {boolean} [throwOnNullReturn]\n * @param {PromiseFilter} [promFilter]\n * @returns {boolean|undefined}\n */\n// eslint-disable-next-line complexity\nconst hasReturnValue = (node, throwOnNullReturn, promFilter) => {\n if (!node) {\n return false;\n }\n\n switch (node.type) {\n case 'TSDeclareFunction':\n case 'TSFunctionType':\n case 'TSMethodSignature': {\n const type = node?.returnType?.typeAnnotation?.type;\n return type && !undefinedKeywords.has(type);\n }\n\n case 'MethodDefinition':\n return hasReturnValue(node.value, throwOnNullReturn, promFilter);\n case 'FunctionExpression':\n case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n return 'expression' in node && node.expression && (!isNewPromiseExpression(\n node.body,\n ) || !isVoidPromise(node.body)) ||\n hasReturnValue(node.body, throwOnNullReturn, promFilter);\n }\n\n case 'BlockStatement': {\n return node.body.some((bodyNode) => {\n return bodyNode.type !== 'FunctionDeclaration' && hasReturnValue(bodyNode, throwOnNullReturn, promFilter);\n });\n }\n\n case 'LabeledStatement':\n case 'WhileStatement':\n case 'DoWhileStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n case 'WithStatement': {\n return hasReturnValue(node.body, throwOnNullReturn, promFilter);\n }\n\n case 'IfStatement': {\n return hasReturnValue(node.consequent, throwOnNullReturn, promFilter) ||\n hasReturnValue(node.alternate, throwOnNullReturn, promFilter);\n }\n\n case 'TryStatement': {\n return hasReturnValue(node.block, throwOnNullReturn, promFilter) ||\n hasReturnValue(node.handler && node.handler.body, throwOnNullReturn, promFilter) ||\n hasReturnValue(node.finalizer, throwOnNullReturn, promFilter);\n }\n\n case 'SwitchStatement': {\n return node.cases.some(\n (someCase) => {\n return someCase.consequent.some((nde) => {\n return hasReturnValue(nde, throwOnNullReturn, promFilter);\n });\n },\n );\n }\n\n case 'ReturnStatement': {\n // void return does not count.\n if (node.argument === null) {\n if (throwOnNullReturn) {\n throw new Error('Null return');\n }\n\n return false;\n }\n\n if (promFilter && isNewPromiseExpression(node.argument)) {\n // Let caller decide how to filter, but this is, at the least,\n // a return of sorts and truthy\n return promFilter(node.argument);\n }\n\n return true;\n }\n\n default: {\n return false;\n }\n }\n};\n\n/**\n * Checks if a node has a return statement. Void return does not count.\n * @param {ESTreeOrTypeScriptNode|null|undefined} node\n * @param {PromiseFilter} promFilter\n * @returns {undefined|boolean|ESTreeOrTypeScriptNode}\n */\n// eslint-disable-next-line complexity\nconst allBrancheshaveReturnValues = (node, promFilter) => {\n if (!node) {\n return false;\n }\n\n switch (node.type) {\n case 'TSDeclareFunction':\n case 'TSFunctionType':\n case 'TSMethodSignature': {\n const type = node?.returnType?.typeAnnotation?.type;\n return type && !undefinedKeywords.has(type);\n }\n\n // case 'MethodDefinition':\n // return allBrancheshaveReturnValues(node.value, promFilter);\n case 'FunctionExpression':\n case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n return 'expression' in node && node.expression && (!isNewPromiseExpression(node.body) || !isVoidPromise(node.body)) ||\n allBrancheshaveReturnValues(node.body, promFilter) ||\n /** @type {import('@typescript-eslint/types').TSESTree.BlockStatement} */\n (node.body).body.some((nde) => {\n return nde.type === 'ReturnStatement';\n });\n }\n\n case 'BlockStatement': {\n const lastBodyNode = node.body.slice(-1)[0];\n return allBrancheshaveReturnValues(lastBodyNode, promFilter);\n }\n\n case 'WhileStatement':\n case 'DoWhileStatement':\n if (\n /**\n * @type {import('@typescript-eslint/types').TSESTree.Literal}\n */\n (node.test).value === true\n ) {\n // If this is an infinite loop, we assume only one branch\n // is needed to provide a return\n return hasReturnValue(node.body, false, promFilter);\n }\n\n // Fallthrough\n case 'ForStatement':\n if (node.test === null) {\n // If this is an infinite loop, we assume only one branch\n // is needed to provide a return\n return hasReturnValue(node.body, false, promFilter);\n }\n case 'LabeledStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n case 'WithStatement': {\n return allBrancheshaveReturnValues(node.body, promFilter);\n }\n\n case 'IfStatement': {\n return allBrancheshaveReturnValues(node.consequent, promFilter) &&\n allBrancheshaveReturnValues(node.alternate, promFilter);\n }\n\n case 'TryStatement': {\n // If `finally` returns, all return\n return node.finalizer && allBrancheshaveReturnValues(node.finalizer, promFilter) ||\n // Return in `try`/`catch` may still occur despite `finally`\n allBrancheshaveReturnValues(node.block, promFilter) &&\n (!node.handler ||\n allBrancheshaveReturnValues(node.handler && node.handler.body, promFilter)) &&\n (!node.finalizer || (() => {\n try {\n hasReturnValue(node.finalizer, true, promFilter);\n } catch (error) {\n if (/** @type {Error} */ (error).message === 'Null return') {\n return false;\n }\n /* c8 ignore next 2 */\n throw error;\n }\n\n // As long as not an explicit empty return, then return true\n return true;\n })());\n }\n\n case 'SwitchStatement': {\n return /** @type {import('@typescript-eslint/types').TSESTree.SwitchStatement} */ (node).cases.every(\n (someCase) => {\n return !someCase.consequent.some((consNode) => {\n return consNode.type === 'BreakStatement' ||\n consNode.type === 'ReturnStatement' && consNode.argument === null;\n });\n },\n );\n }\n\n case 'ThrowStatement': {\n return true;\n }\n\n case 'ReturnStatement': {\n // void return does not count.\n if (node.argument === null) {\n return false;\n }\n\n if (promFilter && isNewPromiseExpression(node.argument)) {\n // Let caller decide how to filter, but this is, at the least,\n // a return of sorts and truthy\n return promFilter(node.argument);\n }\n\n return true;\n }\n\n default: {\n return false;\n }\n }\n};\n\n/**\n * @callback PromiseFilter\n * @param {ESTreeOrTypeScriptNode|undefined} node\n * @returns {boolean}\n */\n\n/**\n * Avoids further checking child nodes if a nested function shadows the\n * resolver, but otherwise, if name is used (by call or passed in as an\n * argument to another function), will be considered as non-empty.\n *\n * This could check for redeclaration of the resolver, but as such is\n * unlikely, we avoid the performance cost of checking everywhere for\n * (re)declarations or assignments.\n * @param {import('@typescript-eslint/types').TSESTree.Node|null|undefined} node\n * @param {string} resolverName\n * @returns {boolean}\n */\n// eslint-disable-next-line complexity\nconst hasNonEmptyResolverCall = (node, resolverName) => {\n if (!node) {\n return false;\n }\n\n // Arrow function without block\n switch (node.type) {\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'OptionalCallExpression':\n case 'CallExpression':\n return /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n node.callee\n ).name === resolverName && (\n\n // Implicit or explicit undefined\n node.arguments.length > 1 || node.arguments[0] !== undefined\n ) ||\n node.arguments.some((nde) => {\n // Being passed in to another function (which might invoke it)\n return nde.type === 'Identifier' && nde.name === resolverName ||\n\n // Handle nested items\n hasNonEmptyResolverCall(nde, resolverName);\n });\n case 'ChainExpression':\n case 'Decorator':\n case 'ExpressionStatement':\n return hasNonEmptyResolverCall(node.expression, resolverName);\n case 'ClassBody':\n case 'BlockStatement':\n return node.body.some((bodyNode) => {\n return hasNonEmptyResolverCall(bodyNode, resolverName);\n });\n case 'FunctionExpression':\n case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n // Shadowing\n if (/** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n node.params[0]\n )?.name === resolverName) {\n return false;\n }\n\n return hasNonEmptyResolverCall(node.body, resolverName);\n }\n\n case 'LabeledStatement':\n case 'WhileStatement':\n case 'DoWhileStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n case 'WithStatement': {\n return hasNonEmptyResolverCall(node.body, resolverName);\n }\n\n case 'ConditionalExpression':\n case 'IfStatement': {\n return hasNonEmptyResolverCall(node.test, resolverName) ||\n hasNonEmptyResolverCall(node.consequent, resolverName) ||\n hasNonEmptyResolverCall(node.alternate, resolverName);\n }\n\n case 'TryStatement': {\n return hasNonEmptyResolverCall(node.block, resolverName) ||\n hasNonEmptyResolverCall(node.handler && node.handler.body, resolverName) ||\n hasNonEmptyResolverCall(node.finalizer, resolverName);\n }\n\n case 'SwitchStatement': {\n return node.cases.some(\n (someCase) => {\n return someCase.consequent.some((nde) => {\n return hasNonEmptyResolverCall(nde, resolverName);\n });\n },\n );\n }\n\n case 'ArrayPattern':\n case 'ArrayExpression':\n return node.elements.some((element) => {\n return hasNonEmptyResolverCall(element, resolverName);\n });\n\n case 'AssignmentPattern':\n return hasNonEmptyResolverCall(node.right, resolverName);\n\n case 'AssignmentExpression':\n case 'BinaryExpression':\n case 'LogicalExpression': {\n return hasNonEmptyResolverCall(node.left, resolverName) ||\n hasNonEmptyResolverCall(node.right, resolverName);\n }\n\n // Comma\n case 'SequenceExpression':\n case 'TemplateLiteral':\n return node.expressions.some((subExpression) => {\n return hasNonEmptyResolverCall(subExpression, resolverName);\n });\n\n case 'ObjectPattern':\n case 'ObjectExpression':\n return node.properties.some((property) => {\n return hasNonEmptyResolverCall(property, resolverName);\n });\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ClassMethod':\n case 'MethodDefinition':\n return node.decorators && node.decorators.some((decorator) => {\n return hasNonEmptyResolverCall(decorator, resolverName);\n }) ||\n node.computed && hasNonEmptyResolverCall(node.key, resolverName) ||\n hasNonEmptyResolverCall(node.value, resolverName);\n\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ObjectProperty':\n /* eslint-disable no-fallthrough */\n /* c8 ignore next -- In Babel? */\n case 'PropertyDefinition':\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ClassProperty':\n case 'Property':\n /* eslint-enable no-fallthrough */\n return node.computed && hasNonEmptyResolverCall(node.key, resolverName) ||\n hasNonEmptyResolverCall(node.value, resolverName);\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'ObjectMethod':\n /* c8 ignore next 6 -- In Babel? */\n // @ts-expect-error\n return node.computed && hasNonEmptyResolverCall(node.key, resolverName) ||\n // @ts-expect-error\n node.arguments.some((nde) => {\n return hasNonEmptyResolverCall(nde, resolverName);\n });\n\n case 'ClassExpression':\n case 'ClassDeclaration':\n return hasNonEmptyResolverCall(node.body, resolverName);\n\n case 'AwaitExpression':\n case 'SpreadElement':\n case 'UnaryExpression':\n case 'YieldExpression':\n return hasNonEmptyResolverCall(node.argument, resolverName);\n\n case 'VariableDeclaration': {\n return node.declarations.some((nde) => {\n return hasNonEmptyResolverCall(nde, resolverName);\n });\n }\n\n case 'VariableDeclarator': {\n return hasNonEmptyResolverCall(node.id, resolverName) ||\n hasNonEmptyResolverCall(node.init, resolverName);\n }\n\n case 'TaggedTemplateExpression':\n return hasNonEmptyResolverCall(node.quasi, resolverName);\n\n // ?.\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'OptionalMemberExpression':\n case 'MemberExpression':\n return hasNonEmptyResolverCall(node.object, resolverName) ||\n hasNonEmptyResolverCall(node.property, resolverName);\n\n /* c8 ignore next 2 -- In Babel? */\n // @ts-expect-error Babel?\n case 'Import':\n case 'ImportExpression':\n return hasNonEmptyResolverCall(node.source, resolverName);\n\n case 'ReturnStatement': {\n if (node.argument === null) {\n return false;\n }\n\n return hasNonEmptyResolverCall(node.argument, resolverName);\n }\n\n /*\n // Shouldn't need to parse literals/literal components, etc.\n\n case 'Identifier':\n case 'TemplateElement':\n case 'Super':\n // Exports not relevant in this context\n */\n default:\n return false;\n }\n};\n\n/**\n * Checks if a Promise executor has no resolve value or an empty value.\n * An `undefined` resolve does not count.\n * @param {ESTreeOrTypeScriptNode} node\n * @param {boolean} anyPromiseAsReturn\n * @param {boolean} [allBranches]\n * @returns {boolean}\n */\nconst hasValueOrExecutorHasNonEmptyResolveValue = (node, anyPromiseAsReturn, allBranches) => {\n const hasReturnMethod = allBranches ?\n /**\n * @param {ESTreeOrTypeScriptNode} nde\n * @param {PromiseFilter} promiseFilter\n * @returns {boolean}\n */\n (nde, promiseFilter) => {\n let hasReturn;\n try {\n hasReturn = hasReturnValue(nde, true, promiseFilter);\n } catch (error) {\n // c8 ignore else\n if (/** @type {Error} */ (error).message === 'Null return') {\n return false;\n }\n /* c8 ignore next 2 */\n throw error;\n }\n\n // `hasReturn` check needed since `throw` treated as valid return by\n // `allBrancheshaveReturnValues`\n return Boolean(hasReturn && allBrancheshaveReturnValues(nde, promiseFilter));\n } :\n /**\n * @param {ESTreeOrTypeScriptNode} nde\n * @param {PromiseFilter} promiseFilter\n * @returns {boolean}\n */\n (nde, promiseFilter) => {\n return Boolean(hasReturnValue(nde, false, promiseFilter));\n };\n\n return hasReturnMethod(node, (prom) => {\n if (anyPromiseAsReturn) {\n return true;\n }\n\n if (isVoidPromise(prom)) {\n return false;\n }\n\n const {\n params,\n body,\n } =\n /**\n * @type {import('@typescript-eslint/types').TSESTree.FunctionExpression|\n * import('@typescript-eslint/types').TSESTree.ArrowFunctionExpression}\n */ (\n /** @type {import('@typescript-eslint/types').TSESTree.NewExpression} */ (\n prom\n ).arguments[0]\n ) || {};\n\n if (!params?.length) {\n return false;\n }\n\n const {\n name: resolverName,\n } = /** @type {import('@typescript-eslint/types').TSESTree.Identifier} */ (\n params[0]\n );\n\n return hasNonEmptyResolverCall(body, resolverName);\n });\n};\n\nexport {\n hasReturnValue,\n hasValueOrExecutorHasNonEmptyResolveValue,\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,sBAAsB,GAAIC,IAAI,IAAK;EACvC,OAAOA,IAAI,IAAIA,IAAI,CAACC,IAAI,KAAK,eAAe,IAAID,IAAI,CAACE,MAAM,CAACD,IAAI,KAAK,YAAY,IAC/ED,IAAI,CAACE,MAAM,CAACC,IAAI,KAAK,SAAS;AAClC,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIJ,IAAI,IAAK;EAAA,IAAAK,mBAAA,EAAAC,oBAAA;EAC9B,OAAO,0EAA2E,CAACN,IAAI,aAAJA,IAAI,gBAAAK,mBAAA,GAAJL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,EAAE;QAC1D,OAAO,KAAK;MACd;MACA;MACA,MAAMD,KAAK;IACb;;IAEA;IACA;IACA,OAAOkC,OAAO,CAACD,SAAS,IAAItC,2BAA2B,CAACJ,GAAG,EAAEyC,aAAa,CAAC,CAAC;EAC9E,CAAC;EACD;AACJ;AACA;AACA;AACA;EACI,CAACzC,GAAG,EAAEyC,aAAa,KAAK;IACtB,OAAOE,OAAO,CAAC9D,cAAc,CAACmB,GAAG,EAAE,KAAK,EAAEyC,aAAa,CAAC,CAAC;EAC3D,CAAC;EAEH,OAAOD,eAAe,CAACvE,IAAI,EAAG2E,IAAI,IAAK;IACrC,IAAIN,kBAAkB,EAAE;MACtB,OAAO,IAAI;IACb;IAEA,IAAIjE,aAAa,CAACuE,IAAI,CAAC,EAAE;MACvB,OAAO,KAAK;IACd;IAEA,MAAM;MACJnE,MAAM;MACNa;IACF,CAAC;IACD;AACJ;AACA;AACA;IAAQ,EACF,wEACIsD,IAAI,CACJ7B,SAAS,CAAC,CAAC,CAAC,KACX,CAAC,CAAC;IAET,IAAI,EAACtC,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEuC,MAAM,GAAE;MACnB,OAAO,KAAK;IACd;IAEA,MAAM;MACJ5C,IAAI,EAAE0C;IACR,CAAC,GAAG;IACFrC,MAAM,CAAC,CAAC,CACT;IAED,OAAOoC,uBAAuB,CAACvB,IAAI,EAAEwB,YAAY,CAAC;EACpD,CAAC,CAAC;AACJ,CAAC;AAACX,OAAA,CAAAkC,yCAAA,GAAAA,yCAAA","ignoreList":[]}
package/package.json CHANGED
@@ -30,7 +30,7 @@
30
30
  "@es-joy/jsdoc-eslint-parser": "^0.21.1",
31
31
  "@hkdobrev/run-if-changed": "^0.6.0",
32
32
  "@semantic-release/commit-analyzer": "^13.0.0",
33
- "@semantic-release/github": "^10.1.4",
33
+ "@semantic-release/github": "^11.0.0",
34
34
  "@semantic-release/npm": "^12.0.1",
35
35
  "@types/chai": "^4.3.17",
36
36
  "@types/debug": "^4.1.12",
@@ -67,7 +67,7 @@
67
67
  "open-editor": "^5.0.0",
68
68
  "replace": "^1.2.2",
69
69
  "rimraf": "^5.0.7",
70
- "semantic-release": "^24.0.0",
70
+ "semantic-release": "^24.1.1",
71
71
  "typescript": "5.5.x",
72
72
  "typescript-eslint": "^8.1.0"
73
73
  },
@@ -152,5 +152,5 @@
152
152
  "test-cov": "cross-env TIMING=1 c8 --reporter text npm run test-no-cov",
153
153
  "test-index": "npm run test-no-cov -- test/rules/index.js"
154
154
  },
155
- "version": "50.2.3"
155
+ "version": "50.2.5"
156
156
  }
@@ -14,7 +14,7 @@ const debug = debugModule('requireExportJsdoc');
14
14
  /**
15
15
  * @typedef {{
16
16
  * type?: string,
17
- * value?: ValueObject|import('eslint').Rule.Node,
17
+ * value?: ValueObject|import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node,
18
18
  * props: {
19
19
  * [key: string]: CreatedNode|null,
20
20
  * },
@@ -93,7 +93,7 @@ const getIdentifier = function (node, globals, scope, opts) {
93
93
  * @callback CreateSymbol
94
94
  * @param {import('eslint').Rule.Node|null} node
95
95
  * @param {CreatedNode} globals
96
- * @param {import('eslint').Rule.Node|null} value
96
+ * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node|null} value
97
97
  * @param {CreatedNode} [scope]
98
98
  * @param {boolean|SymbolOptions} [isGlobal]
99
99
  * @returns {CreatedNode|null}
@@ -112,7 +112,7 @@ let createSymbol; // eslint-disable-line prefer-const
112
112
 
113
113
  /**
114
114
  *
115
- * @param {import('eslint').Rule.Node} node
115
+ * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} node
116
116
  * @param {CreatedNode} globals
117
117
  * @param {CreatedNode} scope
118
118
  * @param {SymbolOptions} [opt]
@@ -177,13 +177,10 @@ const getSymbol = function (node, globals, scope, opt) {
177
177
  );
178
178
  }
179
179
 
180
- /* c8 ignore next 7 -- No longer needed? */
181
- // @ts-expect-error TS OK
180
+ /* c8 ignore next 4 -- No longer needed? */
182
181
  case 'TSTypeAliasDeclaration':
183
- // @ts-expect-error TS OK
184
182
  // Fallthrough
185
183
  case 'TSEnumDeclaration':
186
- // @ts-expect-error TS OK
187
184
  case 'TSInterfaceDeclaration':
188
185
  case 'ClassDeclaration':
189
186
  case 'FunctionExpression': case 'FunctionDeclaration':
@@ -473,7 +470,7 @@ const initVariables = function (node, globals, opts) {
473
470
 
474
471
  /**
475
472
  * Populates variable maps using AST
476
- * @param {import('eslint').Rule.Node} node
473
+ * @param {import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} node
477
474
  * @param {CreatedNode} globals
478
475
  * @param {import('./rules/requireJsdoc.js').RequireJsdocOpts} opt
479
476
  * @param {true} [isExport]
@@ -543,6 +540,7 @@ const mapVariables = function (node, globals, opt, isExport) {
543
540
  break;
544
541
  }
545
542
 
543
+ case 'TSTypeAliasDeclaration':
546
544
  case 'FunctionDeclaration': {
547
545
  /* c8 ignore next 10 */
548
546
  if (/** @type {import('estree').Identifier} */ (node.id).type === 'Identifier') {
@@ -655,9 +653,9 @@ const mapVariables = function (node, globals, opt, isExport) {
655
653
  *
656
654
  * @param {import('eslint').Rule.Node} node
657
655
  * @param {CreatedNode|ValueObject|string|undefined|
658
- * import('eslint').Rule.Node} block
656
+ * import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node} block
659
657
  * @param {(CreatedNode|ValueObject|string|
660
- * import('eslint').Rule.Node)[]} [cache]
658
+ * import('eslint').Rule.Node|import('@typescript-eslint/types').TSESTree.Node)[]} [cache]
661
659
  * @returns {boolean}
662
660
  */
663
661
  const findNode = function (node, block, cache) {
@@ -177,8 +177,13 @@ const allBrancheshaveReturnValues = (node, promFilter) => {
177
177
  }
178
178
 
179
179
  // Fallthrough
180
- case 'LabeledStatement':
181
180
  case 'ForStatement':
181
+ if (node.test === null) {
182
+ // If this is an infinite loop, we assume only one branch
183
+ // is needed to provide a return
184
+ return hasReturnValue(node.body, false, promFilter);
185
+ }
186
+ case 'LabeledStatement':
182
187
  case 'ForInStatement':
183
188
  case 'ForOfStatement':
184
189
  case 'WithStatement': {