Skip to content

anyArguments

Reports calling a function with a value typed as any as an argument.

✅ This rule is included in the ts logical preset.

Passing a value typed as any as a function argument defeats TypeScript’s type safety guarantees. The any type bypasses type checking, allowing unexpected types to propagate through your codebase and potentially cause runtime errors.

This rule also detects spreading arrays or tuples with any typed elements as function arguments.

declare const value: any;
declare function processString(input: string): void;
processString(value);
declare const values: any[];
declare function logAll(...items: string[]): void;
logAll(...values);

This rule is not configurable.

If your codebase has many existing any types or areas of unsafe code, it may be difficult to enable this rule. Consider using ESLint disable comments for specific situations while working to improve type safety incrementally.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.