Pular para o conteúdo

noProto

Este conteúdo não está disponível em sua língua ainda.

biome.json
{
"linter": {
"rules": {
"nursery": {
"noProto": "error"
}
}
}
}

Disallow the use of the __proto__ property.

The use of __proto__ for getting or setting the prototype of an object is deprecated. Use Object.getPrototypeOf() or Object.setPrototypeOf() instead.

obj.__proto__ = a;
code-block.js:1:1 lint/nursery/noProto ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected use of __proto__.

> 1 │ obj.__proto__ = a;
^^^^^^^^^^^^^
2 │

The use of __proto__ for getting or setting the prototype of an object is deprecated.

Use Object.getPrototypeOf() or Object.setPrototypeOf() instead.

const b = obj.__proto__;
code-block.js:1:11 lint/nursery/noProto ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected use of __proto__.

> 1 │ const b = obj.__proto__;
^^^^^^^^^^^^^
2 │

The use of __proto__ for getting or setting the prototype of an object is deprecated.

Use Object.getPrototypeOf() or Object.setPrototypeOf() instead.

const a = Object.getPrototypeOf(obj);
Object.setPrototypeOf(obj, b);