deno_lint logodeno_lint

All rules/no-prototype-builtins

Disallows the use of Object.prototype builtins directly

If objects are created via Object.create(null) they have no prototype specified. This can lead to runtime errors when you assume objects have properties from Object.prototype and attempt to call the following methods:

  • hasOwnProperty
  • isPrototypeOf
  • propertyIsEnumerable

Instead, it's always encouraged to call these methods from Object.prototype explicitly.


const a = foo.hasOwnProperty("bar");
const b = foo.isPrototypeOf("bar");
const c = foo.propertyIsEnumerable("bar");


const a =, "bar");
const b =, "bar");
const c =, "bar");