no-proto
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-proto": "error",
},
},
];const a = obj.__proto__;
const a1 = obj["__proto__"];
obj.__proto__ = b;
obj["__proto__"] = b;const a = Object.getPrototypeOf(obj);
Object.setPrototypeOf(obj, b);
const c = { __proto__: a };Examples from the ESLint documentation.
no-proto
eslint
export default [
{
rules: {
"no-proto": "error",
},
},
];no-proto
eslint plugin · restriction
{
"rules": {
"no-proto": "error"
}
}suspicious/noProto
suspicious · since 2.3.8
{
"linter": {
"rules": {
"suspicious": {
"noProto": "error"
}
}
}
}Disallow initializing variables to undefined
Disallow labels that share a name with a variable
Require constructor names to begin with a capital letter