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

fix(plugin): Safe access to leadingComments #26

Merged
merged 1 commit into from Aug 13, 2017
Merged

fix(plugin): Safe access to leadingComments #26

merged 1 commit into from Aug 13, 2017

Conversation

obartra
Copy link
Contributor

@obartra obartra commented Aug 13, 2017

What:

Prevents error on preval when dealing with empty files

Why:

path.node.body can be undefined, these changes make sure we safely access leadingComments property.

How:

Your suggested code changes and test cases

Prettier added a couple additional changes as part of the precommit hook, I wasn't sure if you wanted to keep these in or not

Closes #20

Prevent error when `path.node.body` is not defined

Closes #20
@codecov
Copy link

codecov bot commented Aug 13, 2017

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #26   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines          97     98    +1     
  Branches       19     20    +1     
=====================================
+ Hits           97     98    +1
Impacted Files Coverage Δ
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 34779bd...1ece132. Read the comment docs.

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super! Thank you for taking the time to do this 👏

@kentcdodds kentcdodds merged commit de16d38 into kentcdodds:master Aug 13, 2017
@kentcdodds
Copy link
Owner

Would you like to add yourself to the contributors table?

@obartra
Copy link
Contributor Author

obartra commented Aug 13, 2017

No problem, and sure I'll make a PR

@obartra obartra deleted the safe-leadingcomments branch August 13, 2017 04:14
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

Successfully merging this pull request may close these issues.

None yet

2 participants