From ca3a0f9dbcc8f77ca6d9eb57d474e5329f1f3781 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 2 Apr 2020 11:12:10 -0700 Subject: [PATCH] Fix lint warnings --- modules/core/history.js | 2 +- modules/renderer/background.js | 2 +- modules/svg/labels.js | 2 -- modules/svg/osmose.js | 6 ++++-- modules/ui/improveOSM_comments.js | 4 +++- modules/ui/osmose_details.js | 4 +++- test/spec/spec_helpers.js | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/core/history.js b/modules/core/history.js index 9a082491a..841c12677 100644 --- a/modules/core/history.js +++ b/modules/core/history.js @@ -125,7 +125,7 @@ export function coreHistory(context) { }, - merge: function(entities, extent) { + merge: function(entities/*, extent*/) { var stack = _stack.map(function(state) { return state.graph; }); _stack[0].graph.rebase(entities, stack, false); _tree.rebase(entities, false); diff --git a/modules/renderer/background.js b/modules/renderer/background.js index 1b1320b06..bfffd7b43 100644 --- a/modules/renderer/background.js +++ b/modules/renderer/background.js @@ -493,7 +493,7 @@ export function rendererBackground(context) { } }); - if (hash.gpx) { // todo: move elsewhere - this doesn't belong in background + if (hash.gpx) { const gpx = context.layers().layer('data'); if (gpx) { gpx.url(hash.gpx, '.gpx'); diff --git a/modules/svg/labels.js b/modules/svg/labels.js index 117c4867f..3b37ef88a 100644 --- a/modules/svg/labels.js +++ b/modules/svg/labels.js @@ -447,8 +447,6 @@ export function svgLabels(projection, context) { if (length < width + 20) return; - // todo: properly clip points to viewport - // % along the line to attempt to place the label var lineOffsets = [50, 45, 55, 40, 60, 35, 65, 30, 70, 25, 75, 20, 80, 15, 95, 10, 90, 5, 95]; diff --git a/modules/svg/osmose.js b/modules/svg/osmose.js index 9ab1087cb..95a57254f 100644 --- a/modules/svg/osmose.js +++ b/modules/svg/osmose.js @@ -219,10 +219,12 @@ export function svgOsmose(projection, context, dispatch) { if (_layerEnabled) { // Strings supplied by Osmose fetched before showing layer for first time // NOTE: Currently no way to change locale in iD at runtime, would need to re-call this method if that's ever implemented - // FIXME: If layer is toggled quickly multiple requests are sent + // Also, If layer is toggled quickly multiple requests are sent getService().loadStrings() .then(layerOn) - .catch(err => {}); // FIXME: Handle failed json request gracefully in some way + .catch(err => { + console.log(err); // eslint-disable-line no-console + }); } else { layerOff(); if (context.selectedErrorID()) { diff --git a/modules/ui/improveOSM_comments.js b/modules/ui/improveOSM_comments.js index 968d03c5c..e4ba9e779 100644 --- a/modules/ui/improveOSM_comments.js +++ b/modules/ui/improveOSM_comments.js @@ -70,7 +70,9 @@ export function uiImproveOsmComments() { .append('p') .text(d => d.text); }) - .catch(err => {}); // TODO: Handle failed json request gracefully in some way + .catch(err => { + console.log(err); // eslint-disable-line no-console + }); } function localeDateString(s) { diff --git a/modules/ui/osmose_details.js b/modules/ui/osmose_details.js index bfa7b151c..f88a1014d 100644 --- a/modules/ui/osmose_details.js +++ b/modules/ui/osmose_details.js @@ -195,7 +195,9 @@ export function uiOsmoseDetails(context) { context.features().forceVisible(d.elems); context.map().pan([0,0]); // trigger a redraw }) - .catch(err => {}); // TODO: Handle failed json request gracefully in some way + .catch(err => { + console.log(err); // eslint-disable-line no-console + }); } diff --git a/test/spec/spec_helpers.js b/test/spec/spec_helpers.js index ded7883fc..4090692f5 100644 --- a/test/spec/spec_helpers.js +++ b/test/spec/spec_helpers.js @@ -41,7 +41,7 @@ mocha.setup({ expect = chai.expect; -window.d3 = iD.d3; // TODO: remove if we can avoid exporting all of d3.js +window.d3 = iD.d3; // Remove this if we can avoid exporting all of d3.js // Workaround for `Array.from` polyfill in PhantomJS // https://github.com/openstreetmap/iD/issues/6087#issuecomment-476219308