Skip to content

Make @enum,@this tag construction stricter #39791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3165,12 +3165,12 @@ namespace ts {
export interface JSDocEnumTag extends JSDocTag, Declaration {
readonly kind: SyntaxKind.JSDocEnumTag;
readonly parent: JSDoc;
readonly typeExpression?: JSDocTypeExpression;
readonly typeExpression: JSDocTypeExpression;
}

export interface JSDocThisTag extends JSDocTag {
readonly kind: SyntaxKind.JSDocThisTag;
readonly typeExpression?: JSDocTypeExpression;
readonly typeExpression: JSDocTypeExpression;
}

export interface JSDocTemplateTag extends JSDocTag {
Expand Down Expand Up @@ -6976,9 +6976,9 @@ namespace ts {
updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag;
createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag;
updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocThisTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag;
updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocThisTag;
createJSDocEnumTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocEnumTag;
createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocEnumTag;
updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocEnumTag;
createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocCallbackTag;
updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocCallbackTag;
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1769,11 +1769,11 @@ declare namespace ts {
export interface JSDocEnumTag extends JSDocTag, Declaration {
readonly kind: SyntaxKind.JSDocEnumTag;
readonly parent: JSDoc;
readonly typeExpression?: JSDocTypeExpression;
readonly typeExpression: JSDocTypeExpression;
}
export interface JSDocThisTag extends JSDocTag {
readonly kind: SyntaxKind.JSDocThisTag;
readonly typeExpression?: JSDocTypeExpression;
readonly typeExpression: JSDocTypeExpression;
}
export interface JSDocTemplateTag extends JSDocTag {
readonly kind: SyntaxKind.JSDocTemplateTag;
Expand Down Expand Up @@ -3417,9 +3417,9 @@ declare namespace ts {
updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag;
createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag;
updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocThisTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag;
updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocThisTag;
createJSDocEnumTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocEnumTag;
createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocEnumTag;
updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocEnumTag;
createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocCallbackTag;
updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocCallbackTag;
Expand Down Expand Up @@ -10419,7 +10419,7 @@ declare namespace ts {
/** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocReturnTag;
/** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocThisTag;
const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocThisTag;
/** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
const createJSDocComment: (comment?: string | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
/** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
Expand All @@ -10431,7 +10431,7 @@ declare namespace ts {
readonly expression: Identifier | PropertyAccessEntityNameExpression;
}, comment?: string | undefined) => JSDocAugmentsTag;
/** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocEnumTag;
const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocEnumTag;
/** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | undefined) => JSDocTemplateTag;
/** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1769,11 +1769,11 @@ declare namespace ts {
export interface JSDocEnumTag extends JSDocTag, Declaration {
readonly kind: SyntaxKind.JSDocEnumTag;
readonly parent: JSDoc;
readonly typeExpression?: JSDocTypeExpression;
readonly typeExpression: JSDocTypeExpression;
}
export interface JSDocThisTag extends JSDocTag {
readonly kind: SyntaxKind.JSDocThisTag;
readonly typeExpression?: JSDocTypeExpression;
readonly typeExpression: JSDocTypeExpression;
}
export interface JSDocTemplateTag extends JSDocTag {
readonly kind: SyntaxKind.JSDocTemplateTag;
Expand Down Expand Up @@ -3417,9 +3417,9 @@ declare namespace ts {
updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag;
createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag;
updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocThisTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag;
updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocThisTag;
createJSDocEnumTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocEnumTag;
createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocEnumTag;
updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocEnumTag;
createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocCallbackTag;
updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocCallbackTag;
Expand Down Expand Up @@ -6811,7 +6811,7 @@ declare namespace ts {
/** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocReturnTag;
/** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocThisTag;
const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocThisTag;
/** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
const createJSDocComment: (comment?: string | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
/** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
Expand All @@ -6823,7 +6823,7 @@ declare namespace ts {
readonly expression: Identifier | PropertyAccessEntityNameExpression;
}, comment?: string | undefined) => JSDocAugmentsTag;
/** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocEnumTag;
const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocEnumTag;
/** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | undefined) => JSDocTemplateTag;
/** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
Expand Down