Enable some more eslint rules from iD rules
This commit is contained in:
parent
07aa5ade67
commit
87127d41e9
8 changed files with 48 additions and 18 deletions
|
@ -334,7 +334,7 @@ $(document).ready(function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
function addObject(type, id, center) {
|
function addObject(type, id, center) {
|
||||||
map.addObject({type: type, id: parseInt(id)}, function(bounds) {
|
map.addObject({type: type, id: parseInt(id, 10)}, function(bounds) {
|
||||||
if (!window.location.hash && bounds.isValid() &&
|
if (!window.location.hash && bounds.isValid() &&
|
||||||
(center || !map.getBounds().contains(bounds))) {
|
(center || !map.getBounds().contains(bounds))) {
|
||||||
OSM.router.withoutMoveListener(function () {
|
OSM.router.withoutMoveListener(function () {
|
||||||
|
|
|
@ -10,14 +10,14 @@ OSM.Changeset = function (map) {
|
||||||
};
|
};
|
||||||
|
|
||||||
page.load = function(path, id) {
|
page.load = function(path, id) {
|
||||||
if(id)
|
if (id)
|
||||||
currentChangesetId = id;
|
currentChangesetId = id;
|
||||||
initialize();
|
initialize();
|
||||||
addChangeset(currentChangesetId, true);
|
addChangeset(currentChangesetId, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
function addChangeset(id, center) {
|
function addChangeset(id, center) {
|
||||||
map.addObject({type: 'changeset', id: parseInt(id)}, function(bounds) {
|
map.addObject({type: 'changeset', id: parseInt(id, 10)}, function(bounds) {
|
||||||
if (!window.location.hash && bounds.isValid() &&
|
if (!window.location.hash && bounds.isValid() &&
|
||||||
(center || !map.getBounds().contains(bounds))) {
|
(center || !map.getBounds().contains(bounds))) {
|
||||||
OSM.router.withoutMoveListener(function () {
|
OSM.router.withoutMoveListener(function () {
|
||||||
|
@ -32,7 +32,7 @@ OSM.Changeset = function (map) {
|
||||||
|
|
||||||
$(form).find("input[type=submit]").prop("disabled", true);
|
$(form).find("input[type=submit]").prop("disabled", true);
|
||||||
|
|
||||||
if(include_data) {
|
if (include_data) {
|
||||||
data = {text: $(form.text).val()};
|
data = {text: $(form.text).val()};
|
||||||
} else {
|
} else {
|
||||||
data = {};
|
data = {};
|
||||||
|
|
|
@ -99,7 +99,7 @@ function FOSSGISEngine(id, vehicleType) {
|
||||||
var template = INSTRUCTION_TEMPLATE[maneuver_id];
|
var template = INSTRUCTION_TEMPLATE[maneuver_id];
|
||||||
|
|
||||||
// convert lat,lng pairs to LatLng objects
|
// convert lat,lng pairs to LatLng objects
|
||||||
var step_geometry = L.PolylineUtil.decode(step.geometry, { precision: 5 }).map(function(a) { return L.latLng(a); }) ;
|
var step_geometry = L.PolylineUtil.decode(step.geometry, { precision: 5 }).map(function(a) { return L.latLng(a); });
|
||||||
// append step_geometry on line
|
// append step_geometry on line
|
||||||
Array.prototype.push.apply(line, step_geometry);
|
Array.prototype.push.apply(line, step_geometry);
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ OSM.NewNote = function(map) {
|
||||||
});
|
});
|
||||||
|
|
||||||
newNote = L.marker(markerLatlng, {
|
newNote = L.marker(markerLatlng, {
|
||||||
icon: noteIcons["new"],
|
icon: noteIcons.new,
|
||||||
opacity: 0.9,
|
opacity: 0.9,
|
||||||
draggable: true
|
draggable: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -87,20 +87,20 @@ L.OSM.Map = L.Map.extend({
|
||||||
|
|
||||||
getLayersCode: function () {
|
getLayersCode: function () {
|
||||||
var layerConfig = '';
|
var layerConfig = '';
|
||||||
for (var i in this._layers) { // TODO: map.eachLayer
|
this.eachLayer(function (layer) {
|
||||||
var layer = this._layers[i];
|
|
||||||
if (layer.options && layer.options.code) {
|
if (layer.options && layer.options.code) {
|
||||||
layerConfig += layer.options.code;
|
layerConfig += layer.options.code;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return layerConfig;
|
return layerConfig;
|
||||||
},
|
},
|
||||||
|
|
||||||
getMapBaseLayerId: function () {
|
getMapBaseLayerId: function () {
|
||||||
for (var i in this._layers) { // TODO: map.eachLayer
|
var baseLayer;
|
||||||
var layer = this._layers[i];
|
this.eachLayer(function (layer) {
|
||||||
if (layer.options && layer.options.keyid) return layer.options.keyid;
|
if (layer.options && layer.options.keyid) baseLayer = layer;
|
||||||
}
|
});
|
||||||
|
return baseLayer.keyid;
|
||||||
},
|
},
|
||||||
|
|
||||||
getUrl: function(marker) {
|
getUrl: function(marker) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ L.OSM.sidebar = function(selector) {
|
||||||
var control = {},
|
var control = {},
|
||||||
sidebar = $(selector),
|
sidebar = $(selector),
|
||||||
current = $(),
|
current = $(),
|
||||||
currentButton = $(),
|
currentButton = $(),
|
||||||
map;
|
map;
|
||||||
|
|
||||||
control.addTo = function (_) {
|
control.addTo = function (_) {
|
||||||
|
|
|
@ -9,8 +9,8 @@ L.OSM.Zoom = L.Control.extend({
|
||||||
|
|
||||||
this._map = map;
|
this._map = map;
|
||||||
|
|
||||||
this._zoomInButton = this._createButton(
|
this._zoomInButton = this._createButton(
|
||||||
'', I18n.t('javascripts.map.zoom.in'), zoomName + 'in', container, this._zoomIn, this);
|
'', I18n.t('javascripts.map.zoom.in'), zoomName + 'in', container, this._zoomIn, this);
|
||||||
this._zoomOutButton = this._createButton(
|
this._zoomOutButton = this._createButton(
|
||||||
'', I18n.t('javascripts.map.zoom.out'), zoomName + 'out', container, this._zoomOut, this);
|
'', I18n.t('javascripts.map.zoom.out'), zoomName + 'out', container, this._zoomOut, this);
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,44 @@
|
||||||
"updateLinks": "readonly"
|
"updateLinks": "readonly"
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"dot-notation": "error",
|
||||||
"eqeqeq": ["error", "smart"],
|
"eqeqeq": ["error", "smart"],
|
||||||
|
"keyword-spacing": "error",
|
||||||
"no-caller": "error",
|
"no-caller": "error",
|
||||||
|
"no-div-regex": "error",
|
||||||
"no-extend-native": "error",
|
"no-extend-native": "error",
|
||||||
|
"no-extra-bind": "error",
|
||||||
|
"no-floating-decimal": "error",
|
||||||
|
"no-implied-eval": "error",
|
||||||
|
"no-iterator": "error",
|
||||||
|
"no-labels": "error",
|
||||||
|
"no-label-var": "error",
|
||||||
|
"no-lone-blocks": "error",
|
||||||
|
"no-loop-func": "error",
|
||||||
|
"no-multi-str": "error",
|
||||||
"no-new": "error",
|
"no-new": "error",
|
||||||
|
"no-new-func": "error",
|
||||||
|
"no-new-wrappers": "error",
|
||||||
|
"no-octal-escape": "error",
|
||||||
|
"no-process-env": "error",
|
||||||
|
"no-proto": "error",
|
||||||
|
"no-script-url": "error",
|
||||||
|
"no-self-compare": "error",
|
||||||
|
"no-sequences": "error",
|
||||||
|
"no-shadow-restricted-names": "error",
|
||||||
|
"no-throw-literal": "error",
|
||||||
"no-trailing-spaces": "error",
|
"no-trailing-spaces": "error",
|
||||||
"no-undef": "error",
|
"no-unneeded-ternary": "error",
|
||||||
|
"no-unused-expressions": "off",
|
||||||
"no-unused-vars": "error",
|
"no-unused-vars": "error",
|
||||||
"no-use-before-define": ["error", {"functions": false}],
|
"no-use-before-define": ["error", {"functions": false}],
|
||||||
"semi": ["error", "always"]
|
"no-void": "error",
|
||||||
|
"no-warning-comments": "warn",
|
||||||
|
"no-with": "error",
|
||||||
|
"radix": ["error", "always"],
|
||||||
|
"semi": ["error", "always"],
|
||||||
|
"semi-spacing": "error",
|
||||||
|
"space-unary-ops": "error",
|
||||||
|
"wrap-regex": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue