# no-unsafe-argument

Rule `typescript/no-unsafe-argument`. Disallow calling a function with a value with type `any`

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```ts
declare function foo(arg1: string, arg2: number, arg3: string): void;

const anyTyped = 1 as any;

foo(...anyTyped);
foo(anyTyped, 1, 'a');

const anyArray: any[] = [];
foo(...anyArray);

const tuple1 = ['a', anyTyped, 'b'] as const;
foo(...tuple1);

const tuple2 = [1] as const;
foo('a', ...tuple2, anyTyped);

declare function bar(arg1: string, arg2: number, ...rest: string[]): void;
const x = [1, 2] as [number, ...number[]];
bar('a', ...x, anyTyped);

declare function baz(arg1: Set<string>, arg2: Map<string, string>): void;
baz(new Set<any>(), new Map<any, string>());
```

### Correct: the rule accepts this

```ts
declare function foo(arg1: string, arg2: number, arg3: string): void;

foo('a', 1, 'b');

const tuple1 = ['a', 1, 'b'] as const;
foo(...tuple1);

declare function bar(arg1: string, arg2: number, ...rest: string[]): void;
const array: string[] = ['a'];
bar('a', 1, ...array);

declare function baz(arg1: Set<string>, arg2: Map<string, string>): void;
baz(new Set<string>(), new Map<string, string>());
```

```ts
declare function foo(arg1: unknown, arg2: Set<unknown>, arg3: unknown[]): void;
foo(1 as any, new Set<any>(), [] as any[]);
```

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-argument": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/no-unsafe-argument": "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% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [typescript/no-unsafe-call](https://lintradar.dev/rules/typescript/no-unsafe-call.md): Disallow calling a value with type `any`
- [typescript/no-unnecessary-condition](https://lintradar.dev/rules/typescript/no-unnecessary-condition.md): Disallow conditionals where the type is always truthy or always falsy
- [typescript/no-empty-function](https://lintradar.dev/rules/typescript/no-empty-function.md): Disallow empty functions
- [typescript/no-confusing-void-expression](https://lintradar.dev/rules/typescript/no-confusing-void-expression.md): Require expressions of type void to appear in statement position
- [typescript/no-generated-empty-object-type](https://lintradar.dev/rules/typescript/no-generated-empty-object-type.md): Disallow type operations that resolve to the "empty object" type
- [typescript/use-unknown-in-catch-callback-variable](https://lintradar.dev/rules/typescript/use-unknown-in-catch-callback-variable.md): Enforce typing arguments in Promise rejection callbacks as `unknown`

---

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