From 2c3f807ace66b943416bfda103bb063a63a03d41 Mon Sep 17 00:00:00 2001 From: Ignacio Olaciregui Date: Tue, 1 Jan 2019 17:10:38 -0800 Subject: [PATCH] Fix no shadow warnings (#22190) Summary: Fixes `no-shadow` eslint errors. Pull Request resolved: https://github.com/facebook/react-native/pull/22190 Differential Revision: D13564238 Pulled By: cpojer fbshipit-source-id: 96ba36b397088fa406e8f5781b1538a0b6804a8d --- .../Interaction/__tests__/InteractionManager-test.js | 4 ++-- Libraries/Lists/__tests__/VirtualizedList-test.js | 6 +++--- react-native-git-upgrade/cliEntry.js | 8 ++++---- scripts/android-e2e-test.js | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Libraries/Interaction/__tests__/InteractionManager-test.js b/Libraries/Interaction/__tests__/InteractionManager-test.js index 27647b7a642..2d1e0c73984 100644 --- a/Libraries/Interaction/__tests__/InteractionManager-test.js +++ b/Libraries/Interaction/__tests__/InteractionManager-test.js @@ -260,7 +260,7 @@ describe('promise tasks', () => { expectToBeCalledOnce(task2); }); - const bigAsyncTest = resolve => { + const bigAsyncTest = resolveTest => { jest.useRealTimers(); const task1 = createSequenceTask(1); @@ -298,7 +298,7 @@ describe('promise tasks', () => { expectToBeCalledOnce(task5); expectToBeCalledOnce(task6); - resolve(); + resolveTest(); }, 100); }; diff --git a/Libraries/Lists/__tests__/VirtualizedList-test.js b/Libraries/Lists/__tests__/VirtualizedList-test.js index e6dbe5a7d25..a4406fe80ee 100644 --- a/Libraries/Lists/__tests__/VirtualizedList-test.js +++ b/Libraries/Lists/__tests__/VirtualizedList-test.js @@ -174,9 +174,9 @@ describe('VirtualizedList', () => { const props = { data, renderItem: ({item}) => , - getItem: (data, index) => data[index], - getItemCount: data => data.length, - getItemLayout: (data, index) => ({ + getItem: (items, index) => items[index], + getItemCount: items => items.length, + getItemLayout: (items, index) => ({ length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index, diff --git a/react-native-git-upgrade/cliEntry.js b/react-native-git-upgrade/cliEntry.js index c09678a3d47..18359c36334 100644 --- a/react-native-git-upgrade/cliEntry.js +++ b/react-native-git-upgrade/cliEntry.js @@ -83,20 +83,20 @@ stdout: ${stdout}`), }); } -function parseJsonFile(path, useYarn) { +function parseJsonFile(filePath, useYarn) { const installHint = useYarn ? 'Make sure you ran "yarn" and that you are inside a React Native project.' : 'Make sure you ran "npm install" and that you are inside a React Native project.'; let fileContents; try { - fileContents = fs.readFileSync(path, 'utf8'); + fileContents = fs.readFileSync(filePath, 'utf8'); } catch (err) { - throw new Error('Cannot find "' + path + '". ' + installHint); + throw new Error('Cannot find "' + filePath + '". ' + installHint); } try { return JSON.parse(fileContents); } catch (err) { - throw new Error('Cannot parse "' + path + '": ' + err.message); + throw new Error('Cannot parse "' + filePath + '": ' + err.message); } } diff --git a/scripts/android-e2e-test.js b/scripts/android-e2e-test.js index abeabb4a55e..c1042142886 100644 --- a/scripts/android-e2e-test.js +++ b/scripts/android-e2e-test.js @@ -50,8 +50,8 @@ describe('Android Test App', function() { driver.on('status', function(info) { console.log(info.cyan); }); - driver.on('command', function(method, path, data) { - if (path === 'source()' && data) { + driver.on('command', function(method, command, data) { + if (command === 'source()' && data) { console.log( ' > ' + method.yellow, 'Screen contents'.grey, @@ -59,11 +59,11 @@ describe('Android Test App', function() { pd.xml(data).yellow, ); } else { - console.log(' > ' + method.yellow, path.grey, data || ''); + console.log(' > ' + method.yellow, command.grey, data || ''); } }); - driver.on('http', function(method, path, data) { - console.log(' > ' + method.magenta, path, (data || '').grey); + driver.on('http', function(method, urlPath, data) { + console.log(' > ' + method.magenta, urlPath, (data || '').grey); }); // every interval print what is on the screen