no-extend-native
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-extend-native": "error",
},
},
];Object.prototype.a = "a";
Object.defineProperty(Array.prototype, "times", { value: 999 });Object.prototype.a = "a";Examples from the ESLint documentation.
no-extend-native
eslint
export default [
{
rules: {
"no-extend-native": "error",
},
},
];no-extend-native
eslint plugin · suspicious
{
"rules": {
"no-extend-native": "error"
}
}nursery/noExtendNative
nursery · since 2.5.7
{
"linter": {
"rules": {
"nursery": {
"noExtendNative": "error"
}
}
}
}Disallow new operators with the String, Number, and Boolean objects
Disallow unnecessary calls to .bind()
Disallow new operators with the Function object
Disallow throwing literals as exceptions
Disallow unnecessary computed property keys in objects and classes