javascript/typescript – force to pass object as function argument by eslint rule

Is it possible to force the following rule by eslint?

  • if the number of function arguments is more than one, use “object” as an argument.

For example,

  • good
    • const f = (x: string) => …
    • const f = (x: {id: string}) => …
    • const f = (x: {id: string; name: string}) => …
  • bad
    • const f= (x: string; y: string) => …

I checked the official document ( https://eslint.org/docs/rules/ ), but I couldn’t find appropriate rules.
I wonder if some kind of custom rules can realize this.