Skip to content

Commit 7d140a2

Browse files
devversionjelbourn
authored andcommitted
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`.
1 parent 6233443 commit 7d140a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/dgeni/common/decorators.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,5 @@ export function decorateDeprecatedDoc(doc: DeprecationDoc) {
101101

102102
if (doc.isDeprecated && !doc.breakingChange) {
103103
console.warn('Warning: There is a deprecated item without a @breaking-change tag.', doc.id);
104-
} else if (doc.breakingChange && !doc.isDeprecated) {
105-
console.warn('Warning: There is an item with a @breaking-change which is not deprecated.',
106-
doc.id);
107104
}
108105
}

tools/dgeni/patch-log-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
/** Regular expression that matches TypeScript mixin names inside of the project. */
3+
const mixinNameRegex = /_\w+Base/;
4+
25
/**
36
* Function that patches Dgeni's instantiated log service. The patch will hide warnings about
47
* unresolved TypeScript symbols for the mixin base classes.
@@ -15,7 +18,7 @@ export function patchLogService(log: any) {
1518
const _warnFn = log.warn;
1619

1720
log.warn = function(message: string) {
18-
if (message.includes('Unresolved TypeScript symbol') && message.includes('MixinBase')) {
21+
if (message.includes('Unresolved TypeScript symbol') && mixinNameRegex.test(message)) {
1922
return;
2023
}
2124

0 commit comments

Comments
 (0)