Skip to content
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

JSDoc property description containing "@" character seems to make everything below this as undefined #39976

Open
pocesar opened this issue Aug 10, 2020 · 2 comments
Assignees
Labels
Bug A bug in TypeScript
Milestone

Comments

@pocesar
Copy link

pocesar commented Aug 10, 2020

This is an issue with TS typings declarations generated from JSDoc and code analysis

TypeScript Version: 3.8.3

Search Terms: jsdoc property at @ description link markdown

Code

/**
 * @typedef SomeTypeDef
 * @property {string} property1
 *   I'm a comment with an [@s](link)
 * @property {boolean} propertyCantBeAccessed
 */

/**
 * @param {SomeTypeDef} s
 */
const f = (s) => {
    s.propertyCantBeAccessed
}

f({
    property1: 'only exists here',
    propertyCantBeAccessed: false
})

Expected behavior:
The property exists and can be accessed

Actual behavior:
Code fails with Property 'propertyCantBeAccessed' does not exist on type 'SomeTypeDef'

@orta
Copy link
Contributor

orta commented Nov 3, 2020

This is somewhat linked to #37346 ( the `@description is basically treated as plain chars in that example )

@orta orta self-assigned this Nov 3, 2020
@jakebailey
Copy link
Member

Just looking at old issues; the original code no longer fails since #42364, but it's not actually fixed; add a space before the @ and it becomes a jsdoc tag again.

Playground Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants