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: Add lastToken check at padding-line-between-statements #8748
Fix: Add lastToken check at padding-line-between-statements #8748
Conversation
Thanks for the pull request, @Outpunk! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
8a1edb4
to
f720961
Compare
LGTM |
f720961
to
4f9b99f
Compare
LGTM |
Is the issue still present if you just use default parser and not |
@gyandeeps Can't reproduce today, with both of the parsers |
@gyandeeps reproduced, the same thing with the default parser |
@gyandeeps any news? |
@Outpunk Can you add a test for this change, which fails without your code change and passes with? Thanks! |
@platinumazure I'll try |
Marking as accepted because it is the same bug as #8839. @Outpunk Hi! I missed this PR and also made a PR to fix this, though I like your solution better. I'm going to close my PR in favor of this one. I don't think all my tests need to be ported over because this is a more generic solution (which is why I like it better!). I think the important test from the tests I wrote is to check that this is valid: {
code: "function test() {};",
options: [
{ blankLine: "always", prev: "block-like", next: "block-like" }
]
}, The other tests are tied more to my specific implementation, so I don't think you need to add those. |
@kaicataldo thanks! I'll add your tests in a couple of days — I'm a bit busy until next week. |
@Outpunk Friendly ping |
4f9b99f
to
1811a05
Compare
LGTM |
@platinumazure I've added the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for contributing to ESLint!
Restarting the Travis CI tests because it looks like they timed out. |
Thanks for contributing! |
Thanks for accepting! |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
I expected eslint to lint my code
What actually happened? Please include the actual, raw output from ESLint.
What changes did you make? (Give an overview)
I have added check for null value of
lastToken
atisBlockLikeStatement
inlib/rules/padding-line-between-statements.js
Is there anything you'd like reviewers to focus on?
No