eslint/no-proto Restriction
What it does
Disallow the use of the __proto__ property
Why is this bad?
The __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn’t be used in new code. Use Object.getPrototypeOf and Object.setPrototypeOf instead.
Examples
Examples of incorrect code for this rule:
javascript
/*eslint no-proto: "error"*/
var a = obj.__proto__;
var a = obj["__proto__"];
obj.__proto__ = b;
obj["__proto__"] = b;How to use
To enable this rule in the CLI or using the config file, you can use:
bash
oxlint --deny no-protojson
{
"rules": {
"no-proto": "error"
}
}