From 61777c767a3594c197dcf98baaae7d966733db65 Mon Sep 17 00:00:00 2001 From: samreid Date: Mon, 23 Sep 2019 11:46:38 -0600 Subject: [PATCH] Update to ES6 var/let, see https://github.com/phetsims/chipper/issues/786 --- eslint/rules/string-require-statement-match.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/rules/string-require-statement-match.js b/eslint/rules/string-require-statement-match.js index 2c497039..c469a343 100644 --- a/eslint/rules/string-require-statement-match.js +++ b/eslint/rules/string-require-statement-match.js @@ -53,7 +53,7 @@ module.exports = function( context ) { if ( rhs && rhs.indexOf( 'string!' ) === 0 ) { const lastSlash = rhs.lastIndexOf( '/' ); - const key = rhs.substring( lastSlash + 1 ); + let key = rhs.substring( lastSlash + 1 ); // For a11y strings, no need to prefix vars with "a11y" if ( key.indexOf( 'a11y.' ) === 0 ) { @@ -61,7 +61,7 @@ module.exports = function( context ) { } // Convert various separators to whitespace - const withWhitespace = key.replace( /\./g, ' ' ).replace( /-/g, ' ' ).replace( /_/g, ' ' ); + const withWhitespace = key.replace( /[.\-_]/g, ' ' ); // Convert whitespace delimited string to camel case and append string suffix const desiredVarName = toCamelCase( withWhitespace ) + 'String';