Open beark opened 2 years ago
The issue here is the interplay of using eslint-plugin-tsdoc together with prettier-plugin-jsdoc.
eslint-plugin-tsdoc
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`. */
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).
tsdoc: true
@
>
<
The issue here is the interplay of using
eslint-plugin-tsdoc
together withprettier-plugin-jsdoc
.Example:
Here, tsdoc will complain that
So, then I change it to
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
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: