no-extraneous-function-wrapping
option to curry/partially apply a function
#7
Labels
no-extraneous-function-wrapping
option to curry/partially apply a function
#7
Add an option to
no-extraneous-function-wrapping
to error when a function, wrapping a non-Lodash function, can be made extraneous usingcurry
.Options
This rule supports the following options:
curry
(name TBD...): When set to true, will lint an error even for non-Lodash functions, encouraging the practice of methods like_.curry
,_.partial
. Default isfalse
. Note that this will probably lead to more false positives, as in some cases:_.flow/_compose
)_.ary
. For instance,array.map(parseInt)
will probably cause you unexpected behavior, asparseInt
will get called withparseInt(value, index)
andparseInt
takes two parameters (value
andradix
). Most Lodash-fp methods such asmap
therefore only pass one argument to their iteratee.You can set the option in configuration like this:
Another option
"placeholder": true
could be given to enhance the normal and thecurry
ed behavior by using a Lodash placeholder for curried functionsThe text was updated successfully, but these errors were encountered: