Interactive interface for browsing global, full-resolution satellite imagery
bypass or fix `array-callback-return` errors
Jason Kent5970736bdae0
diff --git a/.eslintrc b/.eslintrcindex 6f5af9316..a45d1016d 100644--- a/.eslintrc+++ b/.eslintrc@@ -76,7 +76,6 @@// Base rule overrides"default-case": "warn",- "array-callback-return": "warn","no-nested-ternary": "warn","no-shadow": "warn","prefer-const": "warn",diff --git a/web/js/components/layer/product-picker/layer-list.js b/web/js/components/layer/product-picker/layer-list.jsindex 0f2293b00..08ae9fe81 100644--- a/web/js/components/layer/product-picker/layer-list.js+++ b/web/js/components/layer/product-picker/layer-list.js@@ -94,34 +94,37 @@ class LayerList extends React.Component {const categoryToUse = category || categoryConfig.All;return (<div id={`${categoryToUse.id}-list`}>- {categoryToUse.measurements.map((measurement, index) => {- const current = measurementConfig[measurement];- const isSelected = selectedMeasurement === current.id;- if (hasMeasurementSource(current)) {- return (- <CategoryLayerRow- key={current.id}- id={current.id}- index={index}- activeLayers={activeLayers}- category={categoryToUse}- measurement={current}- measurementConfig={measurementConfig}- layerConfig={layerConfig}- hasMeasurementSetting={hasMeasurementSetting}- addLayer={addLayer}- removeLayer={removeLayer}- projection={selectedProjection}- isSelected={isSelected}- selectedDate={selectedDate}- isMobile={isMobile}- updateSelectedMeasurement={updateSelectedMeasurement}- setSourceIndex={setSourceIndex}- selectedMeasurementSourceIndex={selectedMeasurementSourceIndex}- />- );- }- })}+ {+ // eslint-disable-next-line array-callback-return+ categoryToUse.measurements.map((measurement, index) => {+ const current = measurementConfig[measurement];+ const isSelected = selectedMeasurement === current.id;+ if (hasMeasurementSource(current)) {+ return (+ <CategoryLayerRow+ key={current.id}+ id={current.id}+ index={index}+ activeLayers={activeLayers}+ category={categoryToUse}+ measurement={current}+ measurementConfig={measurementConfig}+ layerConfig={layerConfig}+ hasMeasurementSetting={hasMeasurementSetting}+ addLayer={addLayer}+ removeLayer={removeLayer}+ projection={selectedProjection}+ isSelected={isSelected}+ selectedDate={selectedDate}+ isMobile={isMobile}+ updateSelectedMeasurement={updateSelectedMeasurement}+ setSourceIndex={setSourceIndex}+ selectedMeasurementSourceIndex={selectedMeasurementSourceIndex}+ />+ );+ }+ })+ }</div>);}diff --git a/web/js/components/layer/settings/palette.js b/web/js/components/layer/settings/palette.jsindex 2b24c52a0..98c64399b 100644--- a/web/js/components/layer/settings/palette.js+++ b/web/js/components/layer/settings/palette.js@@ -177,14 +177,17 @@ class PaletteSelect extends React.Component {<h2 className="wv-header">Color Palette</h2><Scrollbar style={{ maxHeight: '200px' }}>{this.renderDefault()}- {paletteOrder.map((id) => {- if (lodashIndexOf(recommended, id) < 0) {- const item = this.customLegend(id);- if (item) {- return item;+ {+ // eslint-disable-next-line array-callback-return+ paletteOrder.map((id) => {+ if (lodashIndexOf(recommended, id) < 0) {+ const item = this.customLegend(id);+ if (item) {+ return item;+ }}- }- })}+ })+ }</Scrollbar></div>);diff --git a/web/js/components/layer/settings/vector-style.js b/web/js/components/layer/settings/vector-style.jsindex 121356e72..0878cedb0 100644--- a/web/js/components/layer/settings/vector-style.js+++ b/web/js/components/layer/settings/vector-style.js@@ -140,11 +140,12 @@ class VectorStyleSelect extends React.Component {const vectorStyle = vectorStyles[vectorStyleId];const vectorStyleLayers = vectorStyle.layers;- const uniqueStyleLayers = vectorStyleLayers.filter(function(a) {+ const uniqueStyleLayers = vectorStyleLayers.filter((a) => {if (!this[a.id]) {this[a.id] = true;return true;}+ return false;}, Object.create(null));return (<div@@ -153,12 +154,15 @@ class VectorStyleSelect extends React.Component {><h2 className="wv-header">Vector Styles</h2><Scrollbar style={{ maxHeight: '200px' }}>- {uniqueStyleLayers.map((styleLayerObject) => {- if (styleLayerObject && styleLayerObject) {- const item = this.customLegend(styleLayerObject);- return item;- }- })}+ {+ // eslint-disable-next-line array-callback-return+ uniqueStyleLayers.map((styleLayerObject) => {+ if (styleLayerObject && styleLayerObject) {+ const item = this.customLegend(styleLayerObject);+ return item;+ }+ })+ }</Scrollbar></div>);diff --git a/web/js/components/sidebar/paletteLegend.js b/web/js/components/sidebar/paletteLegend.jsindex b22657c23..f9adf76a6 100644--- a/web/js/components/sidebar/paletteLegend.js+++ b/web/js/components/sidebar/paletteLegend.js@@ -405,6 +405,7 @@ class PaletteLegend extends React.Component {*/renderPaletteLegends() {const { paletteLegends } = this.props;+ // eslint-disable-next-line array-callback-returnreturn paletteLegends.map((colorMap, index) => {if (colorMap.type === 'continuous' || colorMap.type === 'discrete') {this[`canvas_${index}`] = React.createRef();