This repository has been archived by the owner. It is now read-only.

Fix leading comments added from previous node #23

Merged
merged 1 commit into from Jun 22, 2016

Conversation

Projects
None yet
5 participants
@danez
Copy link
Member

danez commented Apr 23, 2016

This fixes an issue that comments were added as leading comments
to expressions, which are not immediately following the comment.

if (a) {
  // comment
}

return a;

This example adds //comment as leading comment to return a;

This was also reported and fixed in espree, and is basically a port to
babylon. eslint/espree#256

this also fixes an issue in babel-eslint with certain rules babel/babel-eslint#289

The only thing is that comments within jsx `{/* comment */} are now not added as leading comment anymore to the closingElement. I'm not really sure if thats wrong, as it is still added as innerComment.

Fix leading comments added from previous node
This fixes an issue that comments were added as leading comments
to expressions, which are not immediately folowing the comment.
This was also reported and fixed in espree, and is basically a port to
babylon. eslint/espree#256

this also fixes an issue in babel-eslint with certain rules babel/babel-eslint#289
@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented May 4, 2016

I wrote the fixes for Espree and was planning on porting it over - looks like you beat me to it!

@ghost

This comment has been minimized.

Copy link

ghost commented May 5, 2016

Please accept this PR, as I am running into the issue mentioned in eslint/eslint issue #6090

@ghost

This comment has been minimized.

Copy link

ghost commented May 10, 2016

Bump. Is there anyone available that can merge this PR?

@kittens kittens merged commit 7859729 into babel:master Jun 22, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@danez danez deleted the danez:fix-comments branch Jun 22, 2016

@cmichaelgraham

This comment has been minimized.

Copy link

cmichaelgraham commented on 4bfecec Jun 25, 2016

i believe this fixes a duplicate comment problem we were having with
https://github.com/YoloDev/babel-dts-generator

thanks 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.