requireArrayDestructuring

Requires that variable assignment from array values are * destructured.

Type: Boolean

Values: true

Version: ES6

Example

"requireArrayDestructuring": true
Valid
var colors = ['red', 'green', 'blue'];
var [ red ] = colors;

var attributes = {
  colors: ['red', 'green', 'blue'];
};

var [ red ] = attributes.colors;
Invalid
var colors = ['red', 'green', 'blue'];
var red = colors[0];

var attributes = {
  colors: ['red', 'green', 'blue'];
};

var red = attributes.colors[0];
Rule source
Test source