# no-native-reassign

Rule `eslint/no-native-reassign`. Disallow assignments to native objects or read-only global variables

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Deprecated: yes
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1702 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-native-reassign` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-native-reassign) |
| Biome | `suspicious/noGlobalAssign` | yes | no | group suspicious, since 1.5.0 | [docs](https://biomejs.dev/linter/rules/no-global-assign/) |

## Code examples

### Incorrect: the rule reports this

```js
Object = null
undefined = 1
```

```js
/*global window:readonly*/

window = {}
```

### Correct: the rule accepts this

```js
a = 1
var b = 1
b = 2
```

```js
/*global onload:writable*/

onload = function() {}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-native-reassign": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noGlobalAssign": "error"
      }
    }
  }
}
```

## Related rules

- [eslint/sort-keys](https://lintradar.dev/rules/eslint/sort-keys.md): Require object keys to be sorted
- [eslint/sort-imports](https://lintradar.dev/rules/eslint/sort-imports.md): Enforce sorted `import` declarations within modules
- [eslint/no-undefined](https://lintradar.dev/rules/eslint/no-undefined.md): Disallow the use of `undefined` as an identifier
- [eslint/id-length](https://lintradar.dev/rules/eslint/id-length.md): Enforce minimum and maximum identifier lengths
- [eslint/no-ternary](https://lintradar.dev/rules/eslint/no-ternary.md): Disallow ternary operators
- [eslint/no-magic-numbers](https://lintradar.dev/rules/eslint/no-magic-numbers.md): Disallow magic numbers

---

Web page: https://lintradar.dev/rules/eslint/no-native-reassign. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
