# no-unsafe-member-access

Rule `typescript/no-unsafe-member-access`. Disallow member access on a value with type `any`

- Source: typescript
- Technologies: TypeScript
- Kind: suspicious
- Needs type information: yes
- Autofix: no
- Reach: 46.6M weekly downloads of presets that enable it
- Trend: +31.9% last quarter
- Rank: #277 by reach, #1103 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-unsafe-member-access` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-unsafe-member-access) |
| Oxlint | `typescript/no-unsafe-member-access` | no | no | plugin `typescript`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unsafe-member-access.html) |

## Code examples

### Incorrect: the rule reports this

```ts
declare const anyVar: any;
declare const nestedAny: { prop: any };

anyVar.a;
anyVar.a.b;
anyVar['a'];
anyVar['a']['b'];

nestedAny.prop.a;
nestedAny.prop['a'];

const key = 'a';
nestedAny.prop[key];

// Using an any to access a member is unsafe
const arr = [1, 2, 3];
arr[anyVar];
nestedAny[anyVar];
```

### Correct: the rule accepts this

```ts
declare const properlyTyped: { prop: { a: string } };

properlyTyped.prop.a;
properlyTyped.prop['a'];

const key = 'a';
properlyTyped.prop[key];

const arr = [1, 2, 3];
arr[1];
let idx = 1;
arr[idx];
arr[idx++];
```

Examples from the ESLint documentation.

## Enable it

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

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/no-unsafe-member-access": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/no-unsafe-member-access": "error"
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [typescript-eslint strict type-checked](https://lintradar.dev/presets/typescript-eslint-strict-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 75 | 175.9M | +29.5% |
| [typescript-eslint recommended type-checked](https://lintradar.dev/presets/typescript-eslint-recommended-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 47 | 175.9M | +29.5% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [typescript/no-unsafe-enum-comparison](https://lintradar.dev/rules/typescript/no-unsafe-enum-comparison.md): Disallow comparing an enum value with a non-enum value
- [typescript/consistent-indexed-object-style](https://lintradar.dev/rules/typescript/consistent-indexed-object-style.md): Require or disallow the `Record` type
- [typescript/no-unsafe-assignment](https://lintradar.dev/rules/typescript/no-unsafe-assignment.md): Disallow assigning a value with type `any` to variables and properties
- [typescript/no-deprecated](https://lintradar.dev/rules/typescript/no-deprecated.md): Disallow using code marked as `@deprecated`
- [typescript/restrict-plus-operands](https://lintradar.dev/rules/typescript/restrict-plus-operands.md): Require both operands of addition to be the same type and be `bigint`, `number`, or `string`
- [typescript/no-unnecessary-type-conversion](https://lintradar.dev/rules/typescript/no-unnecessary-type-conversion.md): Disallow conversion idioms when they do not change the type or value of the expression

---

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