-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Handle multiline comments in parseWithComments
This problem was found while using prettier with pragmas enabled and I backtracked it to the `parseWithComments` function from jest-docblock. In this context it is especially problematic in cases were the top level comment is not formatted as a dock lock but a "multi-line comment" to disable an es-lint rule. /* eslint-disable @typescript-eslint/unbound-method */ Especially given the fact that the `extract` function seems to handle this case correctly. Therefore this solution alters the commentStartRe to keep the second * as optional. This should ensure that all existing use cases work as expected with proper docblocks but also ensures that an "invalid" multiline comment works as well. Links: https://github.com/ullumullu/jest/blob/main/packages/jest-docblock/src/__tests__/index.test.ts#L29
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters