mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
1 parent
bd32234e6e
commit
2c3f807ace
4 files changed
+14
-14
No files matched your search
Vendored
+4
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user