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
This commit is contained in:
Родитель
bd32234e6e
Коммит
2c3f807ace
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -174,9 +174,9 @@ describe('VirtualizedList', () => {
|
|||
const props = {
|
||||
data,
|
||||
renderItem: ({item}) => <item value={item.key} />,
|
||||
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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче