commit b891f0af6606afbfd3f647ad5ca86e35fe34d747
parent 2296f5639487ced20409997cac7e3a1b2d230e41
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sun, 26 Jan 2020 10:48:08 +0100
fix lint errors (quote-props)
Diffstat:
10 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/src/lib/iconFromBackgroundImage/index.js b/src/lib/iconFromBackgroundImage/index.js
@@ -17,7 +17,7 @@ function iconFromBackgroundImage(className) {
container.appendChild(el);
const st = window.getComputedStyle(el),
url = st.backgroundImage.replace(/^url\("?/u, '').replace(/"?\)$/u, '');
- let icon = {'url': url, 'center': [-el.offsetLeft, -el.offsetTop]};
+ let icon = {url: url, center: [-el.offsetLeft, -el.offsetTop]};
document.body.removeChild(container);
container.removeChild(el);
return icon;
diff --git a/src/lib/leaflet.control.elevation-profile/index.js b/src/lib/leaflet.control.elevation-profile/index.js
@@ -934,7 +934,7 @@ const ElevationProfile = L.Class.extend({
startNewSegment = false;
}
path = path.join('');
- createSvg('path', {d: path, 'stroke-width': '1px', stroke: 'brown', fill: 'none'}, svg);
+ createSvg('path', {'d': path, 'stroke-width': '1px', 'stroke': 'brown', 'fill': 'none'}, svg);
// sightline
if (this.options.sightLine) {
path = L.Util.template('M{x1} {y1} L{x2} {y2}', {
@@ -944,8 +944,10 @@ const ElevationProfile = L.Class.extend({
y2: valueToSvgCoord(this.values[this.values.length - 1])
}
);
- createSvg('path',
- {d: path, 'stroke-width': '3px', stroke: '#94b1ff', fill: 'none', 'stroke-opacity': '0.5'}, svg
+ createSvg(
+ 'path',
+ {'d': path, 'stroke-width': '3px', 'stroke': '#94b1ff', 'fill': 'none', 'stroke-opacity': '0.5'},
+ svg
);
}
},
diff --git a/src/lib/leaflet.control.jnx/selector.js b/src/lib/leaflet.control.jnx/selector.js
@@ -23,8 +23,8 @@ const RectangleSelect = L.Rectangle.extend({
)
.addTo(map);
marker.on({
- 'drag': this.onMarkerDrag,
- 'dragend': this.onMarkerDragEnd
+ drag: this.onMarkerDrag,
+ dragend: this.onMarkerDragEnd
}, this
);
this.markers[position] = marker;
diff --git a/src/lib/leaflet.control.layers.configure/index.js b/src/lib/leaflet.control.layers.configure/index.js
@@ -362,10 +362,10 @@ function enableConfig(control, {layers, customLayersOrder}) {
checkCustomLayerValues: function(fieldValues) {
if (!fieldValues.url) {
- return {'error': 'Url is empty'};
+ return {error: 'Url is empty'};
}
if (!fieldValues.name) {
- return {'error': 'Name is empty'};
+ return {error: 'Name is empty'};
}
return {};
},
diff --git a/src/lib/leaflet.control.panoramas/index.js b/src/lib/leaflet.control.panoramas/index.js
@@ -41,8 +41,8 @@ const PanoMarker = L.Marker.extend({
setType: function(markerType) {
const className = {
- 'slim': 'leaflet-panorama-marker-circle',
- 'normal': 'leaflet-panorama-marker-binocular'
+ slim: 'leaflet-panorama-marker-circle',
+ normal: 'leaflet-panorama-marker-binocular'
}[markerType];
this.getIcon().className = className;
}
@@ -243,8 +243,8 @@ L.Control.Panoramas = L.Control.extend({
setupViewerEvents: function(provider) {
provider.viewer.on({
- 'change': this.onPanoramaChangeView.bind(this, provider),
- 'closeclick': this.onPanoramaCloseClick
+ change: this.onPanoramaChangeView.bind(this, provider),
+ closeclick: this.onPanoramaCloseClick
}, this);
},
diff --git a/src/lib/leaflet.control.printPages/control.js b/src/lib/leaflet.control.printPages/control.js
@@ -51,11 +51,11 @@ L.Control.PrintPages = L.Control.extend({
stateChangeEvents: ['change'],
pageSizes: [
- {'name': 'A1', width: 594, height: 841},
- {'name': 'A2', width: 420, height: 594},
- {'name': 'A3', width: 297, height: 420},
- {'name': 'A4', width: 210, height: 297},
- {'name': 'A5', width: 148, height: 210}
+ {name: 'A1', width: 594, height: 841},
+ {name: 'A2', width: 420, height: 594},
+ {name: 'A3', width: 297, height: 420},
+ {name: 'A4', width: 210, height: 297},
+ {name: 'A5', width: 148, height: 210}
],
initialize: function(options) {
diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js
@@ -298,9 +298,9 @@ L.Control.TrackList = L.Control.extend({
this.addTrack(geodata);
}
var error_messages = {
- 'CORRUPT': 'File "{name}" is corrupt',
- 'UNSUPPORTED': 'File "{name}" has unsupported format or is badly corrupt',
- 'NETWORK': 'Could not download file from url "{name}"'
+ CORRUPT: 'File "{name}" is corrupt',
+ UNSUPPORTED: 'File "{name}" has unsupported format or is badly corrupt',
+ NETWORK: 'Could not download file from url "{name}"'
};
var message;
if (geodata.error) {
diff --git a/src/lib/leaflet.layer.canvasMarkers/index.js b/src/lib/leaflet.layer.canvasMarkers/index.js
@@ -258,7 +258,7 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({
}
const ctx = canvas.getContext('2d');
ctx.font = L.Util.template('bold {size}px {name}',
- {'name': this.options.labelFontName, 'size': this.options.labelFontSize * this.options.iconScale}
+ {name: this.options.labelFontName, size: this.options.labelFontSize * this.options.iconScale}
);
for (let [markerId, job] of Object.entries(markerJobs)) {
let img = this._images[job.icon.url];
diff --git a/src/lib/leaflet.layer.soviet-topomaps-grid/index.js b/src/lib/leaflet.layer.soviet-topomaps-grid/index.js
@@ -12,6 +12,7 @@ function zeroPad(num, size) {
}
const bigLetterReplacers = [
+ /* eslint-disable quote-props */
{
'1': 'А',
'2': 'Б',
@@ -24,6 +25,7 @@ const bigLetterReplacers = [
'3': 'C',
'4': 'D'
}
+ /* eslint-enable quote-props */
];
var Nomenclature = {
@@ -125,7 +127,7 @@ var Nomenclature = {
// shift column to positive numbers, calc modulo, shift back
const wrappedColumn = ((column + maxCols / 2) % maxCols + maxCols) % maxCols - maxCols / 2;
var names = name_factory(wrappedColumn, row, joined_quads);
- quads.push({'names': names, 'bounds': quad_bounds});
+ quads.push({names: names, bounds: quad_bounds});
}
}
return quads;
@@ -213,10 +215,10 @@ L.Layer.SovietTopoGrid = L.LayerGroup.extend({
'050k': '1:50 000'
}[scale];
const items = [
- {'text': scaleString, header: true},
- {'text': 'Click name to copy to clibpoard', header: true},
+ {text: scaleString, header: true},
+ {text: 'Click name to copy to clibpoard', header: true},
{
- 'text': titles[0],
+ text: titles[0],
callback: () => {
copyToClipboard(titles[0], e.originalEvent);
}
@@ -224,14 +226,14 @@ L.Layer.SovietTopoGrid = L.LayerGroup.extend({
];
if (titles.length > 1) {
items.push({
- 'text': titles[1] + ' <span class="leaflet-sovietgrid-lang">RUS</span>',
+ text: titles[1] + ' <span class="leaflet-sovietgrid-lang">RUS</span>',
callback: () => {
copyToClipboard(titles[1], e.originalEvent);
}
}
);
items.push({
- 'text': titles[2] + ' <span class="leaflet-sovietgrid-lang">LAT</span>',
+ text: titles[2] + ' <span class="leaflet-sovietgrid-lang">LAT</span>',
callback: () => {
copyToClipboard(titles[2], e.originalEvent);
}
diff --git a/src/lib/leaflet.polyline-edit/index.js b/src/lib/leaflet.polyline-edit/index.js
@@ -201,7 +201,7 @@ L.Polyline.EditMixin = {
marker = L.marker(node.clone(), {
icon: L.divIcon({
className: 'line-editor-node-marker-halo',
- 'html': '<div class="line-editor-node-marker"></div>'
+ html: '<div class="line-editor-node-marker"></div>'
}),
draggable: true,
zIndexOffset: this._nodeMarkersZOffset,