mirror of
https://github.com/status-im/react-native.git
synced 2025-02-20 13:18:07 +00:00
Fix no-shadow
eslint warning & remove var (#22124)
Summary: Fixes `no-shadow` warning for `local-cli/link/ios/getGroup.js` and remove `var` declaration keyword. ``` react-native/local-cli/link/ios/getGroup.js 13:23 warning 'group' is already declared in the upper scope no-shadow ``` - [x] Check `npm run flow` - [x] Check `npm run flow-check-ios` - [x] Check `npm run flow-check-android` - [x] Check `npm run lint` N/A Pull Request resolved: https://github.com/facebook/react-native/pull/22124 Differential Revision: D12929717 Pulled By: TheSavior fbshipit-source-id: 10f8269ae7a0e61f4d0ec6fe710889c3a7c90b3b
This commit is contained in:
parent
ffd7195543
commit
f8040ed16f
@ -9,8 +9,8 @@
|
||||
|
||||
const getFirstProject = project => project.getFirstProject().firstProject;
|
||||
|
||||
const findGroup = (group, name) =>
|
||||
group.children.find(group => group.comment === name);
|
||||
const findGroup = (groups, name) =>
|
||||
groups.children.find(group => group.comment === name);
|
||||
|
||||
/**
|
||||
* Returns group from .xcodeproj if one exists, null otherwise
|
||||
@ -23,22 +23,22 @@ const findGroup = (group, name) =>
|
||||
module.exports = function getGroup(project, path) {
|
||||
const firstProject = getFirstProject(project);
|
||||
|
||||
var group = project.getPBXGroupByKey(firstProject.mainGroup);
|
||||
let groups = project.getPBXGroupByKey(firstProject.mainGroup);
|
||||
|
||||
if (!path) {
|
||||
return group;
|
||||
return groups;
|
||||
}
|
||||
|
||||
for (var name of path.split('/')) {
|
||||
var foundGroup = findGroup(group, name);
|
||||
var foundGroup = findGroup(groups, name);
|
||||
|
||||
if (foundGroup) {
|
||||
group = project.getPBXGroupByKey(foundGroup.value);
|
||||
groups = project.getPBXGroupByKey(foundGroup.value);
|
||||
} else {
|
||||
group = null;
|
||||
groups = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return group;
|
||||
return groups;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user