no-native-reassign
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-native-reassign": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Disallow assignments to native objects or read-only global variables
Object = null
undefined = 1/*global window:readonly*/
window = {}a = 1
var b = 1
b = 2/*global onload:writable*/
onload = function() {}Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
no-native-reassign
eslint
export default [
{
rules: {
"no-native-reassign": "error",
},
},
];Oxlint does not have this rule.
suspicious/noGlobalAssign
suspicious · since 1.5.0
{
"linter": {
"rules": {
"suspicious": {
"noGlobalAssign": "error"
}
}
}
}