No error for markdown links in @see (#46348)

This only shows up in checkJS files, but should still be ignored.
This commit is contained in:
Nathan Shively-Sanders 2021-10-14 15:22:59 -07:00 committed by GitHub
parent 80e1a29248
commit d16d7779a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 2 deletions

View file

@ -8256,8 +8256,9 @@ namespace ts {
}
function parseSeeTag(start: number, tagName: Identifier, indent?: number, indentText?: string): JSDocSeeTag {
const isLink = lookAhead(() => nextTokenJSDoc() === SyntaxKind.AtToken && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue() === "link");
const nameExpression = isLink ? undefined : parseJSDocNameReference();
const isMarkdownOrJSDocLink = token() === SyntaxKind.OpenBracketToken
|| lookAhead(() => nextTokenJSDoc() === SyntaxKind.AtToken && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue() === "link");
const nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference();
const comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
}

View file

@ -0,0 +1,10 @@
//// [seeTag3.js]
/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
}
//// [seeTag3.js]
/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
}

View file

@ -0,0 +1,6 @@
=== tests/cases/conformance/jsdoc/seeTag3.js ===
/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
>theWholeThing : Symbol(theWholeThing, Decl(seeTag3.js, 0, 0))
}

View file

@ -0,0 +1,6 @@
=== tests/cases/conformance/jsdoc/seeTag3.js ===
/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
>theWholeThing : () => void
}

View file

@ -0,0 +1,7 @@
// @outdir: out/
// @checkJs: true
// @filename: seeTag3.js
/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
}