diff --git a/src/exportParser.js b/src/exportParser.js index 5a748b987..590650bd3 100644 --- a/src/exportParser.js +++ b/src/exportParser.js @@ -741,6 +741,8 @@ const canExportChildrenType = new Set([ 'TSInterfaceDeclaration', 'TSTypeLiteral', 'TSTypeAliasDeclaration', + 'TSTypeParameterInstantiation', + 'TSTypeReference', 'ClassDeclaration', 'ClassBody', 'ClassDefinition', diff --git a/test/rules/assertions/requireJsdoc.js b/test/rules/assertions/requireJsdoc.js index c8a6ab995..411d8505a 100644 --- a/test/rules/assertions/requireJsdoc.js +++ b/test/rules/assertions/requireJsdoc.js @@ -4191,6 +4191,58 @@ function quux (foo) { } }, }, + { + code: ` + /** + * Command options for the login command + */ + export type LoginOptions = CmdOptions<{ + username?: string; + password?: string; + }>; + `, + errors: [ + { + line: 6, + message: 'Missing JSDoc comment.', + }, + { + line: 7, + message: 'Missing JSDoc comment.', + }, + ], + options: [ + { + publicOnly: { + ancestorsOnly: true, + }, + contexts: [ + 'TSTypeAliasDeclaration', + 'TSInterfaceDeclaration', + 'TSMethodSignature', + 'TSPropertySignature', + ], + }, + ], + output: ` + /** + * Command options for the login command + */ + export type LoginOptions = CmdOptions<{ + /** + * + */ + username?: string; + /** + * + */ + password?: string; + }>; + `, + languageOptions: { + parser: typescriptEslintParser, + }, + }, ], valid: [ {