> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-global-object-property-assignment

[Added in v0.9.5](https://github.com/web-infra-dev/rslint/releases/tag/v0.9.5)
## Configuration

| Preset                              | Configured Value |
| ----------------------------------- | ---------------- |
| ✅ unicornPlugin.configs.recommended | `"error"`        |


```ts title=rslint.config.ts
import { defineConfig, unicornPlugin } from '@rslint/core';

export default defineConfig([
  unicornPlugin.configs.recommended,
  {
    rules: {
      'unicorn/no-global-object-property-assignment': 'error',
    },
  },
]);
```

Disallow assigning properties on the global object.

Global object mutation makes state harder to trace and can overwrite existing globals. Prefer module scope, explicit imports/exports, dependency injection, or a local singleton.

```js
// Incorrect
globalThis.foo = value;
window.foo += 1;
self.foo ||= value;

// Correct
export const foo = value;
const singleton = { foo: value };
globalThis.foo;
```

The rule checks statically named properties on the effective global `global`, `globalThis`, `self`, and `window` bindings. Shadowed bindings and dynamic computed properties are ignored. Reads and `delete` expressions are also allowed.

This port follows eslint-plugin-unicorn v75.0.0.

- [Upstream documentation](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v75.0.0/docs/rules/no-global-object-property-assignment.md)
- [Upstream source](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v75.0.0/rules/no-global-object-property-assignment.js)
