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) {
|
||||
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() &&
|
||||
(center || !map.getBounds().contains(bounds))) {
|
||||
OSM.router.withoutMoveListener(function () {
|
||||
|
|
|
@ -17,7 +17,7 @@ OSM.Changeset = function (map) {
|
|||
};
|
||||
|
||||
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() &&
|
||||
(center || !map.getBounds().contains(bounds))) {
|
||||
OSM.router.withoutMoveListener(function () {
|
||||
|
|
|
@ -121,7 +121,7 @@ OSM.NewNote = function(map) {
|
|||
});
|
||||
|
||||
newNote = L.marker(markerLatlng, {
|
||||
icon: noteIcons["new"],
|
||||
icon: noteIcons.new,
|
||||
opacity: 0.9,
|
||||
draggable: true
|
||||
});
|
||||
|
|
|
@ -87,20 +87,20 @@ L.OSM.Map = L.Map.extend({
|
|||
|
||||
getLayersCode: function () {
|
||||
var layerConfig = '';
|
||||
for (var i in this._layers) { // TODO: map.eachLayer
|
||||
var layer = this._layers[i];
|
||||
this.eachLayer(function (layer) {
|
||||
if (layer.options && layer.options.code) {
|
||||
layerConfig += layer.options.code;
|
||||
}
|
||||
}
|
||||
});
|
||||
return layerConfig;
|
||||
},
|
||||
|
||||
getMapBaseLayerId: function () {
|
||||
for (var i in this._layers) { // TODO: map.eachLayer
|
||||
var layer = this._layers[i];
|
||||
if (layer.options && layer.options.keyid) return layer.options.keyid;
|
||||
}
|
||||
var baseLayer;
|
||||
this.eachLayer(function (layer) {
|
||||
if (layer.options && layer.options.keyid) baseLayer = layer;
|
||||
});
|
||||
return baseLayer.keyid;
|
||||
},
|
||||
|
||||
getUrl: function(marker) {
|
||||
|
|
|
@ -17,14 +17,44 @@
|
|||
"updateLinks": "readonly"
|
||||
},
|
||||
"rules": {
|
||||
"dot-notation": "error",
|
||||
"eqeqeq": ["error", "smart"],
|
||||
"keyword-spacing": "error",
|
||||
"no-caller": "error",
|
||||
"no-div-regex": "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-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-undef": "error",
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-unused-expressions": "off",
|
||||
"no-unused-vars": "error",
|
||||
"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