#Code works when running but the linter still screams error at me?

12 messages · Page 1 of 1 (latest)

tawny wren
#

Anyone know why?

#

Code works when running but the linter still screams error at me?

feral bluff
#

show us the _ declaration

#

what a bad name for a var

gloomy island
#

You have a double array of numbers and you're trying to assign an array of numbers to it.

#
let a = [ [ 1, 2, 3 ], [ 1, 2, 3 ] ]
a = [ 1, 2, 3 ] // Type Error.
#

Also. _ is a horrible name for a variable. It is normally reserved in practice to prefix variables with _ that you want to declare but know aren't/won't being used in the code.

stiff frigate
#

by the way, instead of using sort then reverse, you could just replace a - b with b - a

#

(and remove the .reverse() completely)

#

another thing, Deno ignores TS errors unless you provide the --check flag

#

which is somewhat good, you dont want to --check a huge production codebase every time - it would take too long (ts errors are treated more of a development concern)

tawny wren