Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 649 Bytes

File metadata and controls

36 lines (24 loc) · 649 Bytes

no-array-mutation

Disallow mutating array methods.

Rule Details

Property Value
Type suggestion
Fixable No
Recommended warn
Strict error

Rationale

Mutating arrays in place creates hidden side effects. Immutable array operations make behavior easier to reason about and safer to refactor.

Examples

✅ Correct

const next = [...items, value];

❌ Incorrect

items.push(value);

Configuration

'zero-tolerance/no-array-mutation': 'error'