Some eslint fixes

This commit is contained in:
David Carley
2022-09-05 10:30:42 +00:00
parent cae5ccd7b7
commit 135b46df23
17 changed files with 36 additions and 36 deletions

View File

@@ -15,7 +15,7 @@ const variant_defaults = {
module.exports = {
template: "#admin-general-view-template",
props: ["config", "state"],
props: [ "config", "state" ],
data: function () {
return {

View File

@@ -101,7 +101,7 @@ module.exports = new Vue({
template: require("../resources/config-template.json"),
config: {
settings: { units: "METRIC" },
motors: [{}, {}, {}, {}],
motors: [ {}, {}, {}, {} ],
version: "<loading>",
full_version: "<loading>",
},

View File

@@ -2,7 +2,7 @@
module.exports = {
template: "#axis-control-template",
props: ["axes", "colors", "enabled", "adjust", "step"],
props: [ "axes", "colors", "enabled", "adjust", "step" ],
methods: {
jog: function (axis, ring, direction) {
@@ -21,11 +21,11 @@ module.exports = {
},
value: function (ring) {
const adjust = [0.01, 0.1, 1][this.adjust];
const adjust = [ 0.01, 0.1, 1 ][this.adjust];
if (this.step) {
return adjust * [0.1, 1, 10, 100][ring];
return adjust * [ 0.1, 1, 10, 100 ][ring];
}
return adjust * [0.1, 0.25, 0.5, 1][ring];
return adjust * [ 0.1, 0.25, 0.5, 1 ][ring];
},
text: function (ring) {

View File

@@ -1,7 +1,7 @@
"use strict";
module.exports = {
props: ["state", "config"],
props: [ "state", "config" ],
computed: {
metric: function () {

View File

@@ -4,7 +4,7 @@ function _msg_equal(a, b) {
return a.level == b.level
&& a.source == b.source
&& a.where == b.where
&&a.msg == b.msg;
&& a.msg == b.msg;
}
// Shared among all instances

View File

@@ -6,7 +6,7 @@ const cookie = require("./cookie")("bbctrl-");
module.exports = {
template: "#control-view-template",
props: ["config", "template", "state"],
props: [ "config", "template", "state" ],
data: function () {
return {
@@ -245,7 +245,7 @@ module.exports = {
const weight = `font-weight:${this.jog_incr === value ? "bold" : "normal"}`;
const color = this.jog_incr === value ? "color:#0078e7" : "";
return [weight, color].join(";");
return [ weight, color ].join(";");
},
jog_fn: function (x_jog, y_jog, z_jog, a_jog) {
@@ -342,7 +342,7 @@ module.exports = {
utils.clickFileInput("gcode-file-input");
},
upload: async function (e) {
upload: function (e) {
const files = e.target.files || e.dataTransfer.files;
if (!files.length) {
return;
@@ -495,5 +495,5 @@ module.exports = {
}
},
mixins: [require("./axis-vars")]
mixins: [ require("./axis-vars") ]
};

View File

@@ -2,7 +2,7 @@
const entityMap = {
"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;",
"/": "&#x2F;", "`": "&#x60;", "=": "&#x3D;"};
"/": "&#x2F;", "`": "&#x60;", "=": "&#x3D;" };
function escapeHTML(s) {
return s.replace(/[&<>"'`=\\/]/g, function (c) {
@@ -42,7 +42,7 @@ module.exports = {
scrollElem: this.$el.querySelector(".clusterize-scroll"),
contentElem: this.$el.querySelector(".clusterize-content"),
no_data_text: "GCode view...",
callbacks: {clusterChanged: this.highlight}
callbacks: { clusterChanged: this.highlight }
});
},
@@ -69,7 +69,7 @@ module.exports = {
const text = await response.text();
if (text.length > 20e6) {
this.clusterize.update(["File is large - gcode view disabled"]);
this.clusterize.update([ "File is large - gcode view disabled" ]);
} else {
const lines = escapeHTML(text.trimRight())
.split(/[\r\n]/)
@@ -113,7 +113,7 @@ module.exports = {
line.className = (line.className || "")
.split(" ")
.filter(c => c !== "highlight")
.concat(["highlight"])
.concat([ "highlight" ])
.join(" ");
}
},

View File

@@ -4,7 +4,7 @@ const modbus = require("./modbus.js");
module.exports = {
template: "#indicators-template",
props: ["state"],
props: [ "state" ],
computed: {
modbus_status: function () {

View File

@@ -2,7 +2,7 @@
module.exports = {
template: "#io-indicator-template",
props: ["name", "state"],
props: [ "name", "state" ],
computed: {
klass: function () {

View File

@@ -2,7 +2,7 @@
module.exports = {
template: "#io-view-template",
props: ["config", "template", "state"],
props: [ "config", "template", "state" ],
events: {
"input-changed": function() {

View File

@@ -3,7 +3,7 @@
module.exports = {
replace: true,
template: "#modbus-reg-view-template",
props: ["index", "model", "template", "enable"],
props: [ "index", "model", "template", "enable" ],
computed: {
has_user_value: function () {

View File

@@ -2,7 +2,7 @@
module.exports = {
template: "#motor-view-template",
props: ["index", "config", "template", "state"],
props: [ "index", "config", "template", "state" ],
computed: {
metric: function () {

View File

@@ -22,9 +22,9 @@ const OrbitControls = function (object, domElement) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const scope = this;
const changeEvent = {type: "change"};
const startEvent = {type: "start"};
const endEvent = {type: "end"};
const changeEvent = { type: "change" };
const startEvent = { type: "start" };
const endEvent = { type: "end" };
const STATE = {
NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY_PAN: 4
@@ -106,7 +106,7 @@ const OrbitControls = function (object, domElement) {
this.enableKeys = true;
// The four arrow keys
this.keys = {LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40};
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };
// Mouse buttons
this.mouseButtons = {

View File

@@ -6,7 +6,7 @@ const font = require("./helvetiker_regular.typeface.json");
module.exports = {
template: "#path-viewer-template",
props: ["toolpath"],
props: [ "toolpath" ],
data: function () {
return {
@@ -128,7 +128,7 @@ module.exports = {
return new Float32Array(arrayBuffer);
}
const [positions, speeds] = await Promise.all([
const [ positions, speeds ] = await Promise.all([
get(`/api/path/${this.toolpath.filename}/positions`),
get(`/api/path/${this.toolpath.filename}/speeds`)
]);
@@ -275,7 +275,7 @@ module.exports = {
try {
// Renderer
this.renderer = new THREE.WebGLRenderer({antialias: true, alpha: true});
this.renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
this.renderer.setPixelRatio(window.devicePixelRatio);
this.renderer.setClearColor(0, 0);
this.target.appendChild(this.renderer.domElement);
@@ -502,7 +502,7 @@ module.exports = {
get_color: function (speed) {
if (isNaN(speed)) {
return [255, 0, 0];
return [ 255, 0, 0 ];
} // Rapid
let intensity = speed / this.toolpath.maxSpeed;
@@ -510,7 +510,7 @@ module.exports = {
intensity = 1;
}
return [0, 255 * intensity, 127 * (1 - intensity)];
return [ 0, 255 * intensity, 127 * (1 - intensity) ];
},
draw_path: function (scene) {
@@ -595,7 +595,7 @@ module.exports = {
draw_bbox: function (scene, bbox) {
const geometry = this.create_bbox_geom(bbox);
const material = new THREE.LineBasicMaterial({color: 0xffffff});
const material = new THREE.LineBasicMaterial({ color: 0xffffff });
const line = new THREE.LineSegments(geometry, material);
line.visible = this.showBBox;
@@ -607,7 +607,7 @@ module.exports = {
draw_envelope: function (scene) {
const geometry = this.create_empty_geom();
const material = new THREE.LineBasicMaterial({color: 0x00f7ff});
const material = new THREE.LineBasicMaterial({ color: 0x00f7ff });
const line = new THREE.LineSegments(geometry, material);
line.visible = this.showBBox;
@@ -769,5 +769,5 @@ module.exports = {
}
},
mixins: [require("./axis-vars")]
mixins: [ require("./axis-vars") ]
};

View File

@@ -3,7 +3,7 @@
module.exports = {
replace: true,
template: "#templated-input-template",
props: ["name", "model", "template"],
props: [ "name", "model", "template" ],
data: function () {
return { view: "" };

View File

@@ -6,7 +6,7 @@ const merge = require("lodash.merge");
module.exports = {
template: "#tool-view-template",
props: ["config", "template", "state"],
props: [ "config", "template", "state" ],
data: function () {
return {

View File

@@ -3,7 +3,7 @@
module.exports = {
replace: true,
template: '{{text}}<span class="unit">{{metric ? unit : iunit}}</span>',
props: ["value", "precision", "unit", "iunit", "scale"],
props: [ "value", "precision", "unit", "iunit", "scale" ],
computed: {
metric: {