Enable no-implicit-coercion eslint rule for strings

This commit is contained in:
Quincy Morgan
2020-10-23 14:03:50 -04:00
parent dc8fd13586
commit f2ef27f78c
4 changed files with 11 additions and 8 deletions

View File

@@ -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",

View File

@@ -37,7 +37,7 @@ Object.assign(osmNote.prototype, {
}
if (!this.id) {
this.id = osmNote.id() + ''; // as string
this.id = osmNote.id().toString();
}
return this;

View File

@@ -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);
}

View File

@@ -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);