File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,8 +403,8 @@ abstract class ApiItem {
403403 }
404404 } else {
405405 if ( this . documentation . releaseTag === ReleaseTag . Internal ) {
406- this . reportWarning ( 'Because this definition is marked as @internal, an underscore prefix ("_") should '
407- + ' be added to its name' ) ;
406+ this . reportWarning ( 'Because this definition is explicitly marked as @internal, an underscore prefix ("_")'
407+ + ' should be added to its name' ) ;
408408 }
409409 }
410410 }
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ class ___proto__ {
66// WARNING: propertyWithNoType has incomplete type information
77// @internal
88class _InternalClass {
9+ public _internalMethodWithRedundantUnderscore ( ) : void ;
910 // (undocumented)
1011 public test ( ) : void ;
1112}
@@ -42,10 +43,16 @@ class AlphaTaggedClass {
4243
4344// @beta
4445class BetaTaggedClass {
46+ // WARNING: The underscore prefix ("_") should only be used with definitions that are explicitly marked as @internal
47+ // @alpha
48+ public _alphaMethodWithBadUnderscore ( ) : void ;
4549 // @internal
4650 public _internalMethod ( ) : void ;
4751 // @alpha
4852 public alphaMethod ( ) : void ;
53+ // WARNING: Because this definition is explicitly marked as @internal, an underscore prefix ("_") should be added to its name
54+ // @internal
55+ public internalMethodMissingUnderscore ( ) : void ;
4956 public plainMethod ( ) : void ;
5057}
5158
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ export class InternalClass {
4444 public test ( ) : void {
4545 console . log ( 'this is a public API' ) ;
4646 }
47+
48+ /**
49+ * This *implicitly* internal method should NOT have an underscore.
50+ * API Extractor currently does NOT issue a warning for this case.
51+ */
52+ public _internalMethodWithRedundantUnderscore ( ) : void {
53+ }
4754}
4855
4956/**
Original file line number Diff line number Diff line change @@ -42,6 +42,20 @@ export class BetaTaggedClass {
4242 */
4343 public alphaMethod ( ) : void {
4444 }
45+
46+ /**
47+ * This internal method should have an underscore.
48+ * @internal
49+ */
50+ public internalMethodMissingUnderscore ( ) : void {
51+ }
52+
53+ /**
54+ * This alpha method should have an underscore.
55+ * @alpha
56+ */
57+ public _alphaMethodWithBadUnderscore ( ) : void {
58+ }
4559}
4660
4761/**
You can’t perform that action at this time.
0 commit comments