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

In tsdoc mode, various characters that tsdoc wants escaped are unescaped #167

Open
beark opened this issue May 24, 2022 · 1 comment
Open

Comments

@beark
Copy link
Contributor

beark commented May 24, 2022

The issue here is the interplay of using eslint-plugin-tsdoc together with prettier-plugin-jsdoc.

Example:

/**
 * @returns True if a >= b.
 */

Here, tsdoc will complain that

tsdoc-escape-greater-than: The ">" character should be escaped using a backslash to avoid confusion with an HTML tag

So, then I change it to

/**
 * @returns True if a \>= b.
 */

But then prettier-plugin-jsdoc strips the backslash and I'm back to the original, which the tsdoc lint doesn't like!

Same pattern happens with, eg

/**
 * Emails look like user@domain.
 */

Where tsdoc wants me to escape the "@", and prettier-plugin-jsdoc immediately removes it.

My current workaround: surround strings with these problem characters in backticks, at which point tsdoc stops complaining:

/**
 * Emails look like `user@domain`.
 */
@beark
Copy link
Contributor Author

beark commented May 24, 2022

My suggestion: when prettier-plugin-jsdoc is configured with tsdoc: true, backslashes should not be stripped from @, >, and < (those are the triggering characters I've found so far).

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

No branches or pull requests

1 participant