Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunrajput committed Aug 17, 2023
1 parent e3fa151 commit 26f59e5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/cli-doctor/src/tools/healthchecks/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const cliPackages = [
'@react-native-community/cli-types',
];

const reactNativeCliCompatiblityMatrix = {
const reactNativeCliCompatibilityMatrix = {
12: ['0.73'],
11: ['0.72'],
10: ['0.71'],
Expand All @@ -44,10 +44,7 @@ const reactNativeCliCompatiblityMatrix = {
const getPackageJson = (root?: string): Record<string, any> => {
try {
root = root || findProjectRoot();
const packageJson = JSON.parse(
fs.readFileSync(path.join(root, 'package.json'), 'utf8'),
);
return packageJson;
return JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
} catch (e) {
logger.log(); // for extra space
logger.error(`Couldn't find a "package.json" in ${root || process.cwd()}.`);
Expand Down Expand Up @@ -116,8 +113,8 @@ export default {

if (packageMajorVersion) {
const compatibleRNVersions =
reactNativeCliCompatiblityMatrix[
packageMajorVersion as keyof typeof reactNativeCliCompatiblityMatrix
reactNativeCliCompatibilityMatrix[
packageMajorVersion as keyof typeof reactNativeCliCompatibilityMatrix
] || [];
if (!compatibleRNVersions.includes(RNVersion)) {
issues.push(
Expand Down

0 comments on commit 26f59e5

Please sign in to comment.