Closed
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