build(dgeni): do not warn if @breaking-change is used without @deprecated (#12750)

* Similarly as the TSLint rule, we should only warn (on `gulp docs`) if there is a `@deprecated` tag without a `@breaking-change` tag. If there is a `@breaking-change` tag, but no `@deprecated` tag, it's valid because a breaking change does not always involve a deprecation (e.g. "to be made required").
* Updates the log patching for the Dgeni package to also hide warnings for mixins that don't end with `MixinBase`.
This commit is contained in:
Paul Gschwendtner
2018-08-20 22:39:01 +02:00
committed by Jeremy Elbourn
parent 62334430d5
commit 7d140a2bd6
2 changed files with 4 additions and 4 deletions
-3
View File
@@ -101,8 +101,5 @@ export function decorateDeprecatedDoc(doc: DeprecationDoc) {
if (doc.isDeprecated && !doc.breakingChange) {
console.warn('Warning: There is a deprecated item without a @breaking-change tag.', doc.id);
} else if (doc.breakingChange && !doc.isDeprecated) {
console.warn('Warning: There is an item with a @breaking-change which is not deprecated.',
doc.id);
}
}
+4 -1
View File
@@ -1,4 +1,7 @@
/** Regular expression that matches TypeScript mixin names inside of the project. */
const mixinNameRegex = /_\w+Base/;
/**
* Function that patches Dgeni's instantiated log service. The patch will hide warnings about
* unresolved TypeScript symbols for the mixin base classes.
@@ -15,7 +18,7 @@ export function patchLogService(log: any) {
const _warnFn = log.warn;
log.warn = function(message: string) {
if (message.includes('Unresolved TypeScript symbol') && message.includes('MixinBase')) {
if (message.includes('Unresolved TypeScript symbol') && mixinNameRegex.test(message)) {
return;
}