dandv
dandv
DDeno
Created by dandv on 3/3/2025 in #help
Deno check/lint doesn't warn against obvious bugs
@marvinh. deno check was my first line of defense, but it doesn't output anything about this code. tsc does:
$ cat warnme.ts
type Point = {
[key: string]: number
};

function processPoints(points: Point[]): string[] {
// Should error on Object.keys(number), TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.
// Should warn on points[3] possibly being undefined
return Object.keys(points[3].foo);
}

console.log(processPoints([ { bar: 2 } ]));

$ deno check warnme.ts

$ tsc warnme.ts
warnme.ts:8:22 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.

8 return Object.keys(points[3].foo);
~~~~~~~~~~~~~


Found 1 error in warnme.ts:8
$ cat warnme.ts
type Point = {
[key: string]: number
};

function processPoints(points: Point[]): string[] {
// Should error on Object.keys(number), TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.
// Should warn on points[3] possibly being undefined
return Object.keys(points[3].foo);
}

console.log(processPoints([ { bar: 2 } ]));

$ deno check warnme.ts

$ tsc warnme.ts
warnme.ts:8:22 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.

8 return Object.keys(points[3].foo);
~~~~~~~~~~~~~


Found 1 error in warnme.ts:8
7 replies
DDeno
Created by MrScarySpaceCat on 10/10/2024 in #help
Strange error when running Deno kubernetes container on only 1 node (out of my 3)
Saw your package.json. Are you running typescript-eslint on Deno .ts files? If so, could you take a look at https://stackoverflow.com/questions/79354265/using-typescript-eslint-with-deno ?
10 replies
DDeno
Created by CodyC on 12/23/2022 in #help
Lint for if you forgot to `await` a Promise?
Maybe typescript-eslint works in Deno nowadays
I'm also trying to figure out how! https://stackoverflow.com/questions/79354265/using-typescript-eslint-with-deno
7 replies