Enforce using named parameters when invoking a function with more than N arguments
This rule accepts an array of options:
Index | Description | Default Value |
---|---|---|
0 | Rule severity. Must be one of “error”, “warn”, “off”. | warn |
1 | A Number specifying the max amount of arguments a function can have while still allowing positional arguments. | 3 |
{
"rules": {
"named-parameters-function": ["warn",3]
}
}
foo(10,200)
foo({amount: 10, price: 200})
foo({
amount: 10,
price: 200,
recipient: 0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990,
token: 0xdac17f958d2ee523a2206206994597c13d831ec7
})
foo(
10,
200,
0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990,
0xdac17f958d2ee523a2206206994597c13d831ec7
)
foo(10)
This rule was introduced in Solhint 3.6.0