Apply consistent-return lint rule
This commit is contained in:
1 parent
d7f0b91bf0
commit
d85afcd2b5
12 files changed
+264
-231
No files matched your search
+12
-10
@@ -34,6 +34,8 @@ const COMMIT = Symbol();
|
||||
// Used to execute extensions and restart
|
||||
const EXT = Symbol();
|
||||
|
||||
const UNDEFINED = undefined;
|
||||
|
||||
const context = vm.createContext();
|
||||
|
||||
let state;
|
||||
@@ -117,14 +119,14 @@ class ParameterWrapper {
|
||||
);
|
||||
}
|
||||
|
||||
if (!unpacked.length) return undefined;
|
||||
if (!unpacked.length) return UNDEFINED;
|
||||
|
||||
let attr = state.sessionContext.deviceData.attributes.get(
|
||||
unpacked[0],
|
||||
state.revision
|
||||
)[attrName];
|
||||
|
||||
if (!attr) return undefined;
|
||||
if (!attr) return UNDEFINED;
|
||||
|
||||
return attr[1];
|
||||
}
|
||||
@@ -144,7 +146,7 @@ class ParameterWrapper {
|
||||
);
|
||||
}
|
||||
|
||||
if (!unpacked.length) return undefined;
|
||||
if (!unpacked.length) return UNDEFINED;
|
||||
|
||||
return unpacked[0].join(".");
|
||||
}
|
||||
@@ -163,7 +165,7 @@ class ParameterWrapper {
|
||||
);
|
||||
}
|
||||
|
||||
if (!unpacked.length) return undefined;
|
||||
if (!unpacked.length) return UNDEFINED;
|
||||
|
||||
return unpacked.length;
|
||||
}
|
||||
@@ -349,7 +351,7 @@ function run(
|
||||
} catch (err) {
|
||||
if (err === COMMIT) status = 1;
|
||||
else if (err === EXT) status = 2;
|
||||
else return callback(null, errorToFault(err));
|
||||
else return void callback(null, errorToFault(err));
|
||||
}
|
||||
|
||||
let _state = state;
|
||||
@@ -370,13 +372,13 @@ function run(
|
||||
(err, fault) => {
|
||||
if (err || fault) {
|
||||
if (counter & 1) callback(err, fault);
|
||||
return (counter = 0);
|
||||
return void (counter = 0);
|
||||
}
|
||||
if ((counter -= 2) === 1) {
|
||||
if (status === 2) {
|
||||
return run.apply(null, args);
|
||||
return void run.apply(null, args);
|
||||
} else {
|
||||
return callback(
|
||||
return void callback(
|
||||
null,
|
||||
null,
|
||||
_state.clear,
|
||||
@@ -392,9 +394,9 @@ function run(
|
||||
|
||||
if ((counter -= 2) === 1) {
|
||||
if (status === 2) {
|
||||
return run.apply(null, args);
|
||||
run.apply(null, args);
|
||||
} else {
|
||||
return callback(
|
||||
callback(
|
||||
null,
|
||||
null,
|
||||
_state.clear,
|
||||
|
||||
Reference in new issue
Block a user