-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
forbid-methods
This rule forbids the use of a configured set of lodash methods.
Rule Details
This rule takes one argument:
- The first (required), which methods to forbid calling
The following patterns are considered warnings:
/* eslint lodash/forbid-methods: [2, ['get'] */
var result = _.get(user, 'name');
/* eslint lodash/forbid-methods: [2, ['get'] */
var result = _(user).omit('id').get('name')
/* eslint lodash/forbid-methods: [2, ['keys', 'values'] */
var result = _.keys(user);
The following patterns are not considered warnings:
/* eslint lodash/forbid-methods: [2, ['keys', 'values'] */
var result = _.get(user, 'name');
/* eslint lodash/forbid-methods: [2, ['get'] */
var result = _.keys(user);
When Not To Use It
If you do not want to forbid the use of any lodash methods, then you can disable this rule.
garyking, cameronboyer and TSMMark
Metadata
Metadata
Assignees
Labels
No labels