Skip to content

feat(api-extractor): emit warnings for missing jsdoc or typings #10899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/api-extractor/src/analyzer/AstEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* - AstSyntheticEntity
* - AstImport
* - AstNamespaceImport
* - AstNamespaceExport
* ```
*/
export abstract class AstEntity {
Expand Down
29 changes: 1 addition & 28 deletions packages/api-extractor/src/analyzer/ExportAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AstModule, type IAstModuleExportInfo } from './AstModule.js';
import { AstNamespaceExport } from './AstNamespaceExport.js';
import { AstNamespaceImport } from './AstNamespaceImport.js';
import { AstSymbol } from './AstSymbol.js';
import type { IFetchAstSymbolOptions } from './AstSymbolTable.js';
import type { AstSymbolTable, IFetchAstSymbolOptions } from './AstSymbolTable.js';
import { SourceFileLocationFormatter } from './SourceFileLocationFormatter.js';
import { SyntaxHelpers } from './SyntaxHelpers.js';
import { TypeScriptHelpers } from './TypeScriptHelpers.js';
Expand Down Expand Up @@ -566,33 +566,6 @@ export class ExportAnalyzer {
if (exportDeclaration.moduleSpecifier) {
const externalModulePath: string | undefined = this._tryGetExternalModulePath(exportDeclaration);

// if (declaration.kind === ts.SyntaxKind.NamespaceExport) {
// if (externalModulePath === undefined) {
// const astModule: AstModule = this._fetchSpecifierAstModule(exportDeclaration, declarationSymbol);
// let namespaceImport: AstNamespaceImport | undefined = this._astNamespaceImportByModule.get(astModule);
// if (namespaceImport === undefined) {
// namespaceImport = new AstNamespaceImport({
// namespaceName: declarationSymbol.name,
// astModule,
// declaration,
// symbol: declarationSymbol,
// });
// this._astNamespaceImportByModule.set(astModule, namespaceImport);
// }

// return namespaceImport;
// }

// // Here importSymbol=undefined because {@inheritDoc} and such are not going to work correctly for
// // a package or source file.
// return this._fetchAstImport(undefined, {
// importKind: AstImportKind.StarImport,
// exportName,
// modulePath: externalModulePath,
// isTypeOnly: exportDeclaration.isTypeOnly,
// });
// }

if (externalModulePath !== undefined) {
return this._fetchAstImport(declarationSymbol, {
importKind: AstImportKind.NamedImport,
Expand Down
12 changes: 12 additions & 0 deletions packages/api-extractor/src/api/ExtractorMessageId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ export const enum ExtractorMessageId {
*/
DifferentReleaseTags = 'ae-different-release-tags',

/**
* "The symbol ___ has no matching jsdoc equivalent in the JavaScript source files."
*/
DjsMissingJSDoc = 'ae-djs-missing-jsdoc',

/**
* "The JSDoc comment for___ has no matching type equivalent in the TypeScript declaration file."
*/
DjsMissingTypeScriptType = 'ae-djs-missing-types',

/**
* "The doc comment should not contain more than one release tag."
*/
Expand Down Expand Up @@ -127,6 +137,8 @@ export const allExtractorMessageIds: Set<string> = new Set<string>([
'ae-extra-release-tag',
'ae-undocumented',
'ae-different-release-tags',
'ae-djs-missing-jsdoc',
'ae-djs-missing-types',
'ae-incompatible-release-tags',
'ae-missing-release-tag',
'ae-misplaced-package-tag',
Expand Down
Loading