rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor] AE should throw errors instead of warnings when a @beta api is added on a @public interface

Open srideshpande opened this issue 7 years ago • 0 comments

  • [ ] Bug

Please describe the actual behavior. Situation is, there is a public api as below -

/**
 * @public
 */
public someMethod(a: IA, b: IB): void {
};

Now, I have a requirement to add a new parameter on the above method, and then it looks like below -

/**
 * @public
 */
public someMethod(a: IA, b: IB, c: IC): void {
};

Here the new interface IC is defined as @beta as below -

/**
 * @beta
 */
interface IC {
  prop1: string;
}

When I run AE in this scenario, the api.d.ts file generated will now have a warning something in the lines of - you're adding @beta api on a @public api.

However, IMO this should be an error not warning, as if this warning is overlooked then, it has potential to break third parties during build time. This can be avoided if we spit out an error in the local build when these kind of things happen.

What is the expected behavior? AE should throw an error not warning in the above scenario during the local build phase.

srideshpande avatar Oct 03 '19 16:10 srideshpande