-
- Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
AcceptedThis issue or PR has been accepted.This issue or PR has been accepted.Status: ReleasedIt's now live.It's now live.Type: BugInconsistencies or issues which will cause a problem for users or implementors.Inconsistencies or issues which will cause a problem for users or implementors.
Description
Bug Report
the functional/immutable-data rule with ignoreImmediateMutation: true will trigger an error when immediately mutating an array created with the string .split() method
Expected behavior
these rules
'functional/immutable-data': [ 'error', { ignoreImmediateMutation: true, }, ] should allow this code:
const x = ''.split('').pop() Actual behavior
error:
Modifying an array is not allowed I know the rules are setup correctly because this does not error:
const x = [].pop() Steps to reproduce
latest version (6.0.0) with the rule snippet above
Proposed changes
Metadata
Metadata
Assignees
Labels
AcceptedThis issue or PR has been accepted.This issue or PR has been accepted.Status: ReleasedIt's now live.It's now live.Type: BugInconsistencies or issues which will cause a problem for users or implementors.Inconsistencies or issues which will cause a problem for users or implementors.