dandvD
Denoβ€’11mo agoβ€’
7 replies
dandv

Deno check/lint doesn't warn against obvious bugs

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 } ]));


I've run deno lint --rules-tags=recommended but it doesn't detect anything. This is quite worrying. PS: should there be a Lint tag when posting here, now that we have lint plugins?
Was this page helpful?