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

newline-after-import with decorators #595

Merged
merged 3 commits into from
Oct 22, 2016
Merged

newline-after-import with decorators #595

merged 3 commits into from
Oct 22, 2016

Conversation

lukekarrys
Copy link
Contributor

This fixes the crash outlined in #592, when using a require statement inside a decorator.

While I was in there I also noticed that newline-after-import wasn't properly reporting if the next line was a decorator. I added this so it would be properly reported, but I can remove that if decorator support isn't something you want to add (I know it's still experimental).

@coveralls
Copy link

coveralls commented Sep 30, 2016

Coverage Status

Coverage increased (+0.004%) to 97.651% when pulling 9e5627d on lukekarrys:592-newline-decorators into 2dec0a7 on benmosher:master.

@jfmengels
Copy link
Collaborator

@lukekarrys Awesome! Thanks a lot for this! Also thanks for the great report, which I did not have time to look at until now.

I'm not familiar with the decorators syntax, but this looks good to me.

As for supporting decorators... It's currently at stage 2, which is not the safest stage but means it will likely make it in the spec. I think the way this is implemented it should be fine even if it doesn't make it into the spec, or if it changes a bit. I'm fine with this at the moment. @benmosher?

@lukekarrys
Copy link
Contributor Author

I rebased this against master and fixed a conflict in CHANGELOG.md. I can remove the changelog commit too if that's something that you normally do before releases.

@coveralls
Copy link

coveralls commented Oct 19, 2016

Coverage Status

Coverage increased (+0.009%) to 94.904% when pulling 4e11e80 on lukekarrys:592-newline-decorators into 2cbd801 on benmosher:master.

@coveralls
Copy link

coveralls commented Oct 19, 2016

Coverage Status

Coverage increased (+0.009%) to 94.904% when pulling 4e11e80 on lukekarrys:592-newline-decorators into 2cbd801 on benmosher:master.

Copy link
Collaborator

@jfmengels jfmengels left a comment

Choose a reason for hiding this comment

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

I'm fine with this. @benmosher If you disagree supporting stage-2 features, that's fine by me too.

@benmosher
Copy link
Member

Nope, I'm cool with decorators. Maybe not always all of stage 2, but definitely decorators. 😎

@benmosher benmosher merged commit de0dbe5 into import-js:master Oct 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants