You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initially reported in sindresorhus/memoize#97, it's bad practice to place arguments after functions because functions tend to be inlined and eclipse the parameters that follow them.
For the purpose of this rule, this still seems readable. That's why it should probably default to "3 statements" and warn that "the inline function is too long and impacts readability" for anything longer.
Description
Initially reported in sindresorhus/memoize#97, it's bad practice to place arguments after functions because functions tend to be inlined and eclipse the parameters that follow them.
This could actually be two rules:
foo(() => {}, {something: true})
function foo(cb, options) {}
@sindresorhus doesn't like the latter so I'll focus on the first part 😅
Fail
Pass
{maxStatements: 3}
Additional info
This might conflict with https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md in some cases (reduce) if
maxStatements
defaults to 0👇
The text was updated successfully, but these errors were encountered: