DenoDDeno
Powered by
dandvD
Denoβ€’13mo 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 } ]));
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
deno lint --rules-tags=recommended
but it doesn't detect anything. This is quite worrying. PS: should there be a
Lint
Lint
tag when posting here, now that we have lint plugins?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

deno lint doesn't notice function call to unimported function
molssonMmolsson / help
16mo ago
deno lint missing imports
TinoTTino / help
2y ago
Deno lint custom rules
MqxMMqx / help
3y ago
What does deno lint do, if not type check?
bozdozBbozdoz / help
2y ago