Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 752 Bytes

no-extra-args.md

File metadata and controls

25 lines (14 loc) · 752 Bytes

No Extra Args

While some Lodash functions, like _.assign, can receive any number of arguments, some functions (e.g. _.uniq) have a fixed number of arguments, and superfluous arguments can be a result of a migration error. For example, in Lodash v4, _.uniq was split into _.uniqBy and _.uniqWith, and sending extra arguments to _.uniq is probably an error.

Rule Details

This rule takes no arguments. However, it is affected by the lodash version defined in the config's shared settings for Lodash.

The following patterns are considered warnings:

var x = _.uniq(arr, 'property');

The following patterns are not considered warnings:

var x = _.uniqBy(arr, 'property');