Closed jasonswearingen closed 5 years ago
in some private code I found some accidental calls like such:
const loadAvg = ( nlib.os.loadavg[ 0 ] / nlib.os.cpus.length );
this is a bug because cpus is actually a function that needs to be called as such: cpus().length
cpus
cpus().length
same with loadavg. it's a function.
loadavg
however it is valid JS code so compiler didn't catch it. find a tslint rule that can catch these mistakes and set it to error
as shown here, no solution: https://stackoverflow.com/questions/53639295/tslint-ban-usage-of-the-function-length-property
however partial fix via "implicit any with no index signature" for os.loadavg[0]
in some private code I found some accidental calls like such:
const loadAvg = ( nlib.os.loadavg[ 0 ] / nlib.os.cpus.length );
this is a bug because
cpus
is actually a function that needs to be called as such:cpus().length
same with
loadavg
. it's a function.however it is valid JS code so compiler didn't catch it. find a tslint rule that can catch these mistakes and set it to error