[openstreetmap/openstreetmap-website] Enable erb-no-instance-variables-in-partials lint rule (PR #6921)

Pablo Brasero notifications at github.com
Tue Mar 24 14:11:01 UTC 2026


@pablobm approved this pull request.

Also nice to see all those instances of `render :partial => "foo"` simplified as `render "foo"`.

> @@ -1,20 +1,20 @@
-<%# locals: () %>
+<%# locals: (user:, languages: nil) %>

How about setting an empty array as default and avoid the safe navigation below?

```suggestion
<%# locals: (user:, languages: []) %>
```

>  
 <turbo-frame id="pagination" target="_top">
-  <% if @issues.length == 0 %>
+  <% if issues.items.length == 0 %>

Perhaps a bit tangential to this PR but: would it make sense to use `.empty?` instead of `.length == 0` here for consistency with the Rubocop rules in non-template code?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6921#pullrequestreview-3999474635
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6921/review/3999474635 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260324/1290f041/attachment.htm>


More information about the rails-dev mailing list