[openstreetmap/openstreetmap-website] Add eslint-plugin-erb to provide linting of .js.erb files (PR #5559)

Anton Khorev notifications at github.com
Tue Feb 4 16:14:44 UTC 2025


@AntonKhorev commented on this pull request.



> +  MAX_REQUEST_AREA: <%= Settings.max_request_area.to_json %>,
+  SERVER_PROTOCOL: <%= Settings.server_protocol.to_json %>,
+  SERVER_URL: <%= Settings.server_url.to_json %>,
+  API_VERSION: <%= Settings.api_version.to_json %>,
+  STATUS: <%= Settings.status.to_json %>,
+  MAX_NOTE_REQUEST_AREA: <%= Settings.max_note_request_area.to_json %>,
+  OVERPASS_URL: <%= Settings.overpass_url.to_json %>,
+  OVERPASS_CREDENTIALS: <%= Settings.overpass_credentials.to_json %>,
+  NOMINATIM_URL: <%= Settings.nominatim_url.to_json %>,
+  GRAPHHOPPER_URL: <%= Settings.graphhopper_url.to_json %>,
+  FOSSGIS_OSRM_URL: <%= Settings.fossgis_osrm_url.to_json %>,
+  FOSSGIS_VALHALLA_URL: <%= Settings.fossgis_valhalla_url.to_json %>,

If we got a linter that insists on telling people how to indent their code, maybe it's worth getting rid of this block first. Otherwise it's not an improvement.

`OSM` property names are the same as `Settings` names. You can run a loop over an array of names to copy them over. If you add `if Settings.key?` there, you probably can get the conditionally defined too.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5559/review/2593380850 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250204/4d5e1153/attachment.htm>


More information about the rails-dev mailing list