Using `unwrap` to parse Block comment without `*` separators breaks indentation.
mitermayer opened this issue · 5 comments
What version are you using?
2.0.0 and "master"
What JSDoc comment were you trying to parse?
Comments that have indentation and are not preceded with *
added a test example bellow.
What Doctrine options were you using (sloppy, unwrap, etc.)?
unwrap
What happened? Include output if possible.
When using the unwrap
setting it stripped all the indentation from the parsed text
What did you expect to happen?
I expected it to preserve existing indentation.
Attaching bellow a test case that can demonstrate this behavior:
it('Comment block with no stars in the middle should preserve indentation', function () {
const fixture = `
/**
Some description with example
----A---*-----*-------------
| |
+---B---C---*---D--|
*/
`;
const expected = `
Some description with example
----A---*-----*-------------
| |
+---B---C---*---D--|
`;
doctrine.unwrapComment(fixture).should.equal(expected);
});
The output of the above is as following:
-/**
-Some description with example
+ Some description with example
-----A---*-----*-------------
-| |
-+---B---C---*---D--|
-/
+ ----A---*-----*-------------
+ | |
+ +---B---C---*---D--|
+
This could be related to this line https://github.com/eslint/doctrine/blob/master/lib/doctrine.js#L149
If this behavior is intentional, would be great to have an extra option to be passed to the parser to ensure that indentation can be optionally preserved.
I am happy to submit a PR to fix this issue, just please let me know on how to proceed towards it
@nzakas sorry to ping, but any chance you could triage this issue?
Hoping to not have to use another parser for the project I am working on since this issue is a blocker for it.
Happy to contribute with a PR .
Is there anyone maintaining this project ? :(
sure, we'd be appreciated if you can help to fix it. 😃 @mitermayer
Thanks for this issue. We have decided to officially end-of-life JSDoc support in ESLint. As a result, this repository and project will no longer be maintained.
Thanks for understanding and we apologize for any inconvenience.