slim-lint
slim-lint copied to clipboard
False-positive UselessAssignment when in a slim capture block
This is a simple recreation of the issue I bumped into with a form_for
helper in rails. I'm using capture so that it's distilled down to the essence of the issue:
- url = 'https://google.com'
= capture do
a href=url = 'Google'
Running slim-lint on this gives me:
test.html.slim:2 [W] RuboCop: Useless assignment to variable - `url`.
up
I believe this happens with any method that takes a block, not just capture
.
Any idea on how to fix this. Happy to open a PR with some guidance.