@@ -202,6 +202,9 @@ abstract class ApiItem {
202202 */
203203 public jsdocNode : ts . Node ;
204204
205+ /**
206+ * The parsed AEDoc comment for this item.
207+ */
205208 public documentation : ApiDocumentation ;
206209
207210 /**
@@ -283,7 +286,10 @@ abstract class ApiItem {
283286 ) ;
284287 }
285288
286- public onAddToContainer ( parentContainer : ApiItemContainer ) : void {
289+ /**
290+ * Called by ApiItemContainer.addMemberItem(). Other code should NOT call this method.
291+ */
292+ public notifyAddedToContainer ( parentContainer : ApiItemContainer ) : void {
287293 if ( this . _parentContainer ) {
288294 // This would indicate a program bug
289295 throw new Error ( 'The API item has already been added to another container: ' + this . _parentContainer . name ) ;
@@ -366,7 +372,7 @@ abstract class ApiItem {
366372 this . extractor . reportError ( message , this . _errorNode . getSourceFile ( ) , this . _errorNode . getStart ( ) ) ;
367373 }
368374
369- /**
375+ /**
370376 * Adds a warning to the ApiItem.warnings list. These warnings will be emtted in the API file
371377 * produced by ApiFileGenerator.
372378 */
@@ -425,6 +431,20 @@ abstract class ApiItem {
425431 + ' should be added to its name' ) ;
426432 }
427433 }
434+
435+ // Is it missing a release tag?
436+ if ( this . documentation . releaseTag === ReleaseTag . None ) {
437+ // Only warn about top-level exports
438+ if ( this . parentContainer && this . parentContainer . kind === ApiItemKind . Package ) {
439+ // Don't warn about items that failed to parse.
440+ if ( ! this . documentation . failedToParse ) {
441+ // If there is no release tag, and this is a top-level export of the package, then
442+ // report an error
443+ this . reportError ( `A release tag (@alpha, @beta, @public, @internal) must be specified`
444+ + ` for ${ this . name } ` ) ;
445+ }
446+ }
447+ }
428448 }
429449
430450 /**
0 commit comments