Sindarius / npm_gcodeviewer

Consider using let or const instead of var JS-0239
Anti-pattern
Major
3 months agoa year old
Unexpected var, use let or const instead
 868               }
 869
 870               if (this.colorMode !== ColorMode.Feed) {
 871                  var extruder = Number(tokenString.substring(1)) % this.extruderCount; 872                  if (extruder < 0) extruder = 0;
 873                  this.currentColor = this.tools[extruder]?.color?.clone() ?? new Color3(1, 0, 0);
 874               }
Unexpected var, use let or const instead
 929
 930   chunk(arr, chunkSize) {
 931      var R = [];
 932      for (var i = 0, len = arr.length; i < len; i += chunkSize) R.push(arr.slice(i, i + chunkSize)); 933      return R;
 934   }
 935
Unexpected var, use let or const instead
 928   }
 929
 930   chunk(arr, chunkSize) {
 931      var R = []; 932      for (var i = 0, len = arr.length; i < len; i += chunkSize) R.push(arr.slice(i, i + chunkSize));
 933      return R;
 934   }
Unexpected var, use let or const instead
 626         return;
 627      }
 628
 629      var lines = file.split('\n'); 630
 631      //Extract metadata from slicer to set render settings
 632      this.slicer.processComments(lines, this);
Unexpected var, use let or const instead
24    var dynamicTexture = new DynamicTexture('DynamicTexture', 50, this.scene, true); 
25    dynamicTexture.hasAlpha = true; 
26    dynamicTexture.drawText(text, 5, 40, 'bold 36px Arial', color, 'transparent', true); 
27    var plane = Mesh.CreatePlane('TextPlane', size, this.scene, true); 28    plane.material = new StandardMaterial('TextPlaneMaterial', this.scene); 
29    plane.material.backFaceCulling = false; 
30    plane.material.specularColor = new Color3(0, 0, 0);