-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Comment at end of block before closing } trigger padded-block 'never' rule. #2336
Comments
This could probably be bug in espree, but I’m not 100% sure how the comment attachment algorithm is supposed to work. The problem with your example is, that it relies on ASI and the trailing comment is not attached to the |
Comment attachment does get confused by ASI - I'm not sure if that's a bug or a feature. :) |
Since eslint 0.19, this rule is broken on code that uses ASI. Disabling the rule until this issue (eslint/eslint#2336) is fixed.
I'm willing to put $10 on this issue. There's no BountySource link for some reason (perhaps it's another BountySource bug), but I can pay the person who solves it directly through Paypal or Bitcoin. |
I'm willing to chip in $10 as well, I can pay with Bitcoin. |
Sorry, the Bountysource plugin is broken. I've contacted them about it but haven't gotten any useful information. I'd ideally like to solve this in the parser, but if this is a big pain point, I think @lo1tuma had a solution that didn't require a parser change. We can use that until the parser is fixed to eliminate the pain |
@feross My proposed solution is a workaround which probably decreases the performance of the rule. I think it would also fix #2788 (I can add a test to verify this). If we want to merge this until the comment attachment algorithm is fixed in espree we should file a new issue to remove the workaround in the future. |
Yeah, let's do that. I'm not sure when I'll be up to digging into the comment attachment stuff, it's mind-bending and my mind isn't too flexible ATM. |
Fix: fix comment handling in padded-blocks when relying on ASI (fixes #2336)
I'm on! Bitcoin (or BountySource) would work best for me 🎆 |
@feross, @LinusU: Thanks, but I’m not interested in earning money with my contributions, so feel free to keep to money or donate it directly to the eslint team via BountySource. |
@lo1tuma Donated to the eslint team on BountySource - thanks! |
Since eslint 0.19, this rule is broken on code that uses ASI. Disabling the rule until this issue (eslint/eslint#2336) is fixed.
It appears when you have a comment at the end of a block it is still triggering the
padded-block
rule when set to'never'
. This is on latest published at time of this issue (v0.19.0). I've included the output, the example, the version command, and our eslintrc below. Let me know if any more information would be helpful.Command line output:
Example JS (test.js):
eslint version verification:
Our .eslintrc:
Past similar issues: #1938
The text was updated successfully, but these errors were encountered: