Skip to content

objectProto

Reports using the deprecated proto property to access or modify an object's prototype.

✅ This rule is included in the ts untyped presets.

The __proto__ property is a deprecated way to access and modify an object’s prototype. While it is supported for backwards compatibility, it is not part of the ECMAScript standard and can cause performance issues. Direct manipulation of an object’s prototype can lead to “hidden classes” in JavaScript engines, resulting in slower code execution.

const
const proto: any
proto
=
const obj: any
obj
.
any
__proto__
;
const obj: any
obj
.
any
__proto__
=
const prototype: any
prototype
;
const
const value: any
value
=
const obj: any
obj
["__proto__"];

This rule is not configurable.

If you need to support very old JavaScript environments that don’t have Object.getPrototypeOf and Object.setPrototypeOf (pre-ES5), you might need to disable this rule. However, this is extremely rare in modern development, as even Internet Explorer 9 supports these methods.

Made with ❤️‍🔥 around the world by the Flint team and contributors.