Permalink
Browse files

ESLint: Enforce array destructuring

This is a follow-up to #237
  • Loading branch information...
josephfrazier authored and slevithan committed Apr 23, 2018
1 parent cc11a5d commit 956747f50a0d40fb26796ba12b53969d67579f2e
Showing with 5 additions and 5 deletions.
  1. +1 −1 .eslintrc.js
  2. +2 −2 src/xregexp.js
  3. +2 −2 tools/scripts/utils.js
@@ -248,7 +248,7 @@ module.exports = {
"prefer-destructuring": [
"error",
{
"array": false,
"array": true,
"object": true
}
],
@@ -602,7 +602,7 @@ function XRegExp(pattern, flags) {
pos += (result.matchLength || 1);
} else {
// Get the native token at the current position
const token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0];
const [token] = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky');
output += token;
pos += token.length;
if (token === '[' && scope === defaultScope) {
@@ -1525,7 +1525,7 @@ fixed.replace = function(search, replacement) {
// Change the `args[0]` string primitive to a `String` object that can store
// properties. This really does need to use `String` as a constructor
args[0] = new String(args[0]);
groupsObject = args[0];
[groupsObject] = args;
}
// Store named backreferences
@@ -80,8 +80,8 @@ const createBmpRange = (r, {addBrackets} = {addBrackets: true}) => {
if (r.length === 0) {return '';}
const buf = [];
let start = r[0];
let end = r[0];
let [start] = r;
let [end] = r;
let predict = start + 1;
r = r.slice(1);

0 comments on commit 956747f

Please sign in to comment.