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