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

[jest-docblock] remove leading newlines from parseWithComments().comm… #4610

Merged
merged 1 commit into from
Oct 6, 2017

Conversation

samouri
Copy link
Contributor

@samouri samouri commented Oct 6, 2017

Summary

While working on --prependPragma option for prettier (prettier/prettier#2865), I noticed that jest-docblock is keeping around more leading newlines than would be expected in the comments result of parseWithComments().

Example:

/**
 * @snailcode
 * 
 * word words words
 */

Current result of parseWithComments().comments :

{
  pragmas: { snailcode: '' },
  comments: '\n\nwords words words'
}

Expected:

{
  pragmas: { snailcode: '' },
  comments: 'words words words'
}

cc @azz

@codecov-io
Copy link

Codecov Report

Merging #4610 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4610   +/-   ##
=======================================
  Coverage   56.17%   56.17%           
=======================================
  Files         194      194           
  Lines        6544     6544           
  Branches        3        3           
=======================================
  Hits         3676     3676           
  Misses       2867     2867           
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-docblock/src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 596b5dc...50caa92. Read the comment docs.

@azz
Copy link
Contributor

azz commented Oct 6, 2017

LGTM. My previous PR was to ensure we don't trim space characters, but removing newlines from the start and the end sounds good.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
@samouri samouri deleted the docblock-strip-leadingnewlines branch November 12, 2023 18:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants