# no-restricted-properties

Rule `eslint/no-restricted-properties`. Disallow certain properties on certain objects

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 15.3M weekly downloads of presets that enable it
- Trend: +4.7% last quarter
- Rank: #674 by reach, #1523 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-restricted-properties` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-restricted-properties) |
| Oxlint | `no-restricted-properties` | no | no | plugin `eslint`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-restricted-properties.html) |
| Biome | `nursery/noJsRestrictedProperties` | no | no | group nursery, since 2.5.6 | [docs](https://biomejs.dev/linter/rules/no-js-restricted-properties/) |

## Code examples

### Incorrect: the rule reports this

```js
/* eslint no-restricted-properties: [2, {
    "object": "disallowedObjectName",
    "property": "disallowedPropertyName"
}] */

const example = disallowedObjectName.disallowedPropertyName; /*error Disallowed object property: disallowedObjectName.disallowedPropertyName.*/

disallowedObjectName.disallowedPropertyName(); /*error Disallowed object property: disallowedObjectName.disallowedPropertyName.*/
```

```js
/* eslint no-restricted-properties: [2, {
    "property": "__defineGetter__"
}] */

foo.__defineGetter__(bar, baz);

const { __defineGetter__ } = qux();

({ __defineGetter__ }) => {};
```

```js
/* eslint no-restricted-properties: [2, {
    "object": "require"
}] */

require.resolve('foo');
```

### Correct: the rule accepts this

```js
/* eslint no-restricted-properties: [2, {
    "object": "disallowedObjectName",
    "property": "disallowedPropertyName"
}] */

const example = disallowedObjectName.somePropertyName;

allowedObjectName.disallowedPropertyName();
```

```js
/* eslint no-restricted-properties: [2, {
    "object": "require"
}] */

require('foo');
```

```js
/* eslint no-restricted-properties: [2, {
    "property": "push",
    "allowObjects": ["router", "history"],
}] */

router.push('/home');
history.push('/about');
```

Examples from the ESLint documentation.

## Enable it

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-restricted-properties": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noJsRestrictedProperties": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [Google TypeScript Style](https://lintradar.dev/presets/gts.md) | ESLint | `gts` | 71 | 553.3K | +10.3% |

## Related rules

- [eslint/strict](https://lintradar.dev/rules/eslint/strict.md): Require or disallow strict mode directives
- [eslint/no-loop-func](https://lintradar.dev/rules/eslint/no-loop-func.md): Disallow function declarations that contain unsafe references inside loop statements
- [eslint/curly](https://lintradar.dev/rules/eslint/curly.md): Enforce consistent brace style for all control statements
- [eslint/no-useless-concat](https://lintradar.dev/rules/eslint/no-useless-concat.md): Disallow unnecessary concatenation of literals or template literals
- [eslint/camelcase](https://lintradar.dev/rules/eslint/camelcase.md): Enforce camelcase naming convention
- [eslint/no-restricted-syntax](https://lintradar.dev/rules/eslint/no-restricted-syntax.md): Disallow specified syntax

---

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