From 2565567f6dfa6dd8796b2a986ba1aa4e173f2e8b Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Sun, 27 Jul 2025 12:58:36 +0200 Subject: [PATCH] Deduplicate multiple blank lines --- app/assets/javascripts/leaflet.map.js | 1 - app/assets/javascripts/leaflet.share.js | 1 - config/eslint.config.mjs | 2 +- test/javascripts/osm_test.js | 3 --- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index d9a989f23..fbbbc1b11 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -42,7 +42,6 @@ L.OSM.Map = L.Map.extend({ this.fire("overlayremove", { layer: this.gpsLayer }); }); - this.on("baselayerchange", function (event) { if (this.baseLayers.indexOf(event.layer) >= 0) { this.setMaxZoom(event.layer.options.maxZoom); diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index a3af7263e..8c32872ea 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -30,7 +30,6 @@ L.OSM.share = function (options) { const csrfInput = $ui.find("#csrf_export")[0]; [[csrfInput.name, csrfInput.value]] = Object.entries(OSM.csrf); - document.getElementById("export-image") .addEventListener("turbo:submit-end", OSM.getTurboBlobHandler(OSM.i18n.t("javascripts.share.filename"))); diff --git a/config/eslint.config.mjs b/config/eslint.config.mjs index 5f97d1f76..df5d33e50 100644 --- a/config/eslint.config.mjs +++ b/config/eslint.config.mjs @@ -71,7 +71,7 @@ export default [ "@stylistic/no-floating-decimal": "error", "@stylistic/no-mixed-operators": "error", "@stylistic/no-multi-spaces": "error", - "@stylistic/no-multiple-empty-lines": "error", + "@stylistic/no-multiple-empty-lines": ["error", { max: 1 }], "@stylistic/no-trailing-spaces": "error", "@stylistic/no-whitespace-before-property": "error", "@stylistic/object-curly-newline": ["error", { consistent: true }], diff --git a/test/javascripts/osm_test.js b/test/javascripts/osm_test.js index 9911c121f..c5be6b5f6 100644 --- a/test/javascripts/osm_test.js +++ b/test/javascripts/osm_test.js @@ -273,11 +273,9 @@ describe("OSM", function () { let args = { center: L.latLng(57.6247, -3.6845), zoom: 5 }; expect(OSM.formatHash(args)).to.eq("#map=5/57.62/-3.68"); - args = { center: L.latLng(57.6247, -3.6845), zoom: 9 }; expect(OSM.formatHash(args)).to.eq("#map=9/57.625/-3.685"); - args = { center: L.latLng(57.6247, -3.6845), zoom: 12 }; expect(OSM.formatHash(args)).to.eq("#map=12/57.6247/-3.6845"); }); @@ -293,7 +291,6 @@ describe("OSM", function () { }); }); - describe(".zoomPrecision", function () { it("suggests 1 digit for z0-2", function () { expect(OSM.zoomPrecision(0)).to.eq(1); -- 2.39.5