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

Backslashes are incorrectly removed #152

Open
sxxov opened this issue Mar 23, 2022 · 2 comments
Open

Backslashes are incorrectly removed #152

sxxov opened this issue Mar 23, 2022 · 2 comments

Comments

@sxxov
Copy link
Contributor

sxxov commented Mar 23, 2022

When escaping backslashes (\\), prettier-plugin-jsdoc will incorrectly remove every backslash that precedes a non-escapable character.

Escaping multiple backslashes together

Input

/**
 * \\\\
*/

Expected

/**
 * \\\\
 */

Actual

/**
 * \
 */

Escaping backslashes before unescapable character

Input

/**
 * \\\\-
 */

Expected

/**
 * \\\\-
 */

Actual

/**
 * -
 */
@hosseinmd
Copy link
Owner

hosseinmd commented Mar 24, 2022

I added your comments to tests
33afeb7

@sxxov
Copy link
Contributor Author

sxxov commented Mar 24, 2022

@hosseinmd oof! i've managed to get a repro working.

with the input:

/** \\\\ */

npx prettier index.js -w will produce:

/** \\ */

npx eslint index.js --fix will produce:

/** \ */

versions from package.json:

"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.6.0",
"prettier-plugin-jsdoc": "^0.3.31"

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

2 participants