hi,
today I installed Flow Linter and have been reported many errors ...
I fixed most of them but I have 3 errors pending ...
1° error
[msg] Parsing error: Unexpected token
I have this error in all the function where I use
setTimeout(() => { node.send([output[0]]) }, 2000);
like this:
const output = [null];
output[0] = { reset: true };
setTimeout(() => { node.send([output[0]]) }, 2000);
2° error
[msg] Do not access Object.prototype method 'hasOwnProperty' from target object.
this is the function:
if (msg.hasOwnProperty('ui_control') && msg.ui_control.callback === "renderComplete") {
var msgOut = {
payload: {
command: "selectRow",
arguments: [1],
returnPromise: false
}
}
return msgOut;
}
3* error
[msg] 'suncalc' is not defined
and this is the function:
function sunData() {
return suncalc.getSunTimes(new Date(), 43.690419, 10.816769);
}
function moonData() {
return suncalc.getMoonData(new Date(), 43.690419, 10.816769);
}
Can you help me to fix these errors?
version 4.0.3
node.js v20.15.0
Linux 6.1.21-v8+ arm LE
Dashborad version 3.6.5
Dashboard 2.0 v1.8.1
Raspberry Pi4 - SO raspberry