Apply prefer-const lint rule

This commit is contained in:
Zaid Abdulla committed 2018-08-25 16:14:34 -07:00
1 parent b43088c03c
commit 09e6a360af
26 files changed
+217 -215

No files matched your search

+10 -10
View File
@@ -26,13 +26,13 @@ const scheduling = require("./scheduling");
const MAX_DEPTH = config.get("MAX_DEPTH");
function refresh(sessionContext, provision, declarations) {
let path = common.parsePath(provision[1]).slice();
let l = path.length;
const path = common.parsePath(provision[1]).slice();
const l = path.length;
path.length = MAX_DEPTH;
path.fill("*", l);
let every = 1000 * (provision[2] || 1);
let offset = scheduling.variance(sessionContext.deviceId, every);
let t = scheduling.interval(sessionContext.timestamp, every, offset);
const every = 1000 * (provision[2] || 1);
const offset = scheduling.variance(sessionContext.deviceId, every);
const t = scheduling.interval(sessionContext.timestamp, every, offset);
for (let i = l; i < path.length; ++i) {
declarations.push([
@@ -46,14 +46,14 @@ function refresh(sessionContext, provision, declarations) {
}
function value(sessionContext, provision, declarations) {
let path = common.parsePath(provision[1]);
const path = common.parsePath(provision[1]);
declarations.push([path, 1, { value: 1 }, null, { value: [provision[2]] }]);
return true;
}
function tag(sessionContext, provision, declarations) {
let path = ["Tags", provision[1]];
const path = ["Tags", provision[1]];
declarations.push([path, 1, { value: 1 }, null, { value: [provision[2]] }]);
return true;
@@ -84,7 +84,7 @@ function reset(sessionContext, provision, declarations) {
}
function download(sessionContext, provision, declarations) {
let alias = [
const alias = [
["FileType"],
provision[1] || "",
["FileName"],
@@ -116,14 +116,14 @@ function instances(
if (Number.isNaN(count)) return true;
let path = common.parsePath(provision[1]);
const path = common.parsePath(provision[1]);
if (provision[2][0] === "+" || provision[2][0] === "-") {
declarations.push([path, 1]);
if (endRevision === startRevision) return false;
let unpacked = device.unpack(
const unpacked = device.unpack(
sessionContext.deviceData,
path,
startRevision + 1