diff --git a/scripts/copyMetafiles.js b/scripts/copyMetafiles.js index d14964f1c..6140bd2dc 100644 --- a/scripts/copyMetafiles.js +++ b/scripts/copyMetafiles.js @@ -8,11 +8,11 @@ const files = [ '.nycrc', ]; -const directories = [ +const directories = [].concat( 'memo-parser', - ...resolverDirectories, + resolverDirectories, 'utils', -]; +); for (const directory of directories) { for (const file of files) { diff --git a/src/rules/export.js b/src/rules/export.js index da0df1ee7..92583bdd8 100644 --- a/src/rules/export.js +++ b/src/rules/export.js @@ -37,7 +37,6 @@ const tsTypePrefix = 'type:'; */ function isTypescriptFunctionOverloads(nodes) { const nodesArr = Array.from(nodes); - const types = new Set(nodesArr.map(node => node.parent.type)); const idents = flatMap(nodesArr, (node) => ( node.declaration && ( @@ -51,6 +50,7 @@ function isTypescriptFunctionOverloads(nodes) { return true; } + const types = new Set(nodesArr.map(node => node.parent.type)); if (!types.has('TSDeclareFunction')) { return false; } diff --git a/src/rules/no-namespace.js b/src/rules/no-namespace.js index 4382007a5..a078137e6 100644 --- a/src/rules/no-namespace.js +++ b/src/rules/no-namespace.js @@ -144,10 +144,7 @@ function getVariableNamesInScope(scopeManager, node) { currentNode = currentNode.parent; scope = scopeManager.acquire(currentNode, true); } - return new Set([ - ...scope.variables.map(variable => variable.name), - ...scope.upper.variables.map(variable => variable.name), - ]); + return new Set(scope.variables.concat(scope.upper.variables).map(variable => variable.name)); } /** diff --git a/tests/src/rules/consistent-type-specifier-style.js b/tests/src/rules/consistent-type-specifier-style.js index 31a4c09ff..440ef3aff 100644 --- a/tests/src/rules/consistent-type-specifier-style.js +++ b/tests/src/rules/consistent-type-specifier-style.js @@ -367,14 +367,14 @@ context('TypeScript', () => { }, }); ruleTester.run('consistent-type-specifier-style', rule, { - valid: [ - ...COMMON_TESTS.valid, - ...TS_ONLY.valid, - ], - invalid: [ - ...COMMON_TESTS.invalid, - ...TS_ONLY.invalid, - ], + valid: [].concat( + COMMON_TESTS.valid, + TS_ONLY.valid, + ), + invalid: [].concat( + COMMON_TESTS.invalid, + TS_ONLY.invalid, + ), }); }); @@ -391,13 +391,13 @@ context('Babel/Flow', () => { }, }); ruleTester.run('consistent-type-specifier-style', rule, { - valid: [ - ...COMMON_TESTS.valid, - ...FLOW_ONLY.valid, - ], - invalid: [ - ...COMMON_TESTS.invalid, - ...FLOW_ONLY.invalid, - ], + valid: [].concat( + COMMON_TESTS.valid, + FLOW_ONLY.valid, + ), + invalid: [].concat( + COMMON_TESTS.invalid, + FLOW_ONLY.invalid, + ), }); });