mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Enable no-implicit-coercion eslint rule for strings
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
"no-extra-label": "error",
|
||||
"no-floating-decimal": "error",
|
||||
"no-global-assign": "error",
|
||||
"no-implicit-coercion": ["warn", { "boolean": false, "number": false }],
|
||||
"no-implied-eval": "error",
|
||||
"no-invalid-this": "off",
|
||||
"no-iterator": "error",
|
||||
|
||||
@@ -37,7 +37,7 @@ Object.assign(osmNote.prototype, {
|
||||
}
|
||||
|
||||
if (!this.id) {
|
||||
this.id = osmNote.id() + ''; // as string
|
||||
this.id = osmNote.id().toString();
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
@@ -479,7 +479,8 @@ export default {
|
||||
if (!window.pannellum) return;
|
||||
if (_pannellumViewer) return;
|
||||
|
||||
const sceneID = ++_currScene + '';
|
||||
_currScene += 1;
|
||||
const sceneID = _currScene.toString();
|
||||
const options = {
|
||||
'default': { firstScene: sceneID },
|
||||
scenes: {}
|
||||
@@ -873,14 +874,15 @@ export default {
|
||||
that.initViewer();
|
||||
} else {
|
||||
// make a new scene
|
||||
let sceneID = ++_currScene + '';
|
||||
_currScene += 1;
|
||||
let sceneID = _currScene.toString();
|
||||
_pannellumViewer
|
||||
.addScene(sceneID, _sceneOptions)
|
||||
.loadScene(sceneID);
|
||||
|
||||
// remove previous scene
|
||||
if (_currScene > 2) {
|
||||
sceneID = (_currScene - 1) + '';
|
||||
sceneID = (_currScene - 1).toString();
|
||||
_pannellumViewer
|
||||
.removeScene(sceneID);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ export function uiSectionValidationRules(context) {
|
||||
// user-configurable square threshold
|
||||
var degStr = prefs('validate-square-degrees');
|
||||
if (degStr === null) {
|
||||
degStr = '' + DEFAULTSQUARE;
|
||||
degStr = DEFAULTSQUARE.toString();
|
||||
}
|
||||
|
||||
var span = items.selectAll('.square-degrees');
|
||||
@@ -132,8 +132,8 @@ export function uiSectionValidationRules(context) {
|
||||
input.enter()
|
||||
.append('input')
|
||||
.attr('type', 'number')
|
||||
.attr('min', '' + MINSQUARE)
|
||||
.attr('max', '' + MAXSQUARE)
|
||||
.attr('min', MINSQUARE.toString())
|
||||
.attr('max', MAXSQUARE.toString())
|
||||
.attr('step', '0.5')
|
||||
.attr('class', 'square-degrees-input')
|
||||
.call(utilNoAuto)
|
||||
@@ -167,7 +167,7 @@ export function uiSectionValidationRules(context) {
|
||||
}
|
||||
|
||||
degNum = Math.round(degNum * 10 ) / 10; // round to 1 decimal
|
||||
degStr = '' + degNum;
|
||||
degStr = degNum.toString();
|
||||
|
||||
input
|
||||
.property('value', degStr);
|
||||
|
||||
Reference in New Issue
Block a user