From 3d9e354fc0d475d5ae0984daebed370992327b05 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Tue, 11 Jun 2024 15:12:36 -0300 Subject: [PATCH] use prettier from generator-jhipster. (#1810) --- generators/react-native/generator.mjs | 2 +- generators/react-native/templates/package.json | 1 - generators/react-native/templates/package.json.ejs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/generators/react-native/generator.mjs b/generators/react-native/generator.mjs index 7c27138b5..3bd063b15 100644 --- a/generators/react-native/generator.mjs +++ b/generators/react-native/generator.mjs @@ -217,7 +217,7 @@ export default class extends BaseApplicationGenerator { const replace = section => { if (packageJsonTarget[section]) { Object.entries(packageJsonTarget[section]).forEach(([dependency, dependencyReference]) => { - if (dependencyReference.startsWith(keyToReplace)) { + if (dependencyReference?.startsWith(keyToReplace)) { const [keyToReplaceAtSource, sectionAtSource = section, dependencyAtSource = dependency] = dependencyReference.split('#'); if (keyToReplaceAtSource !== keyToReplace) return; if (!packageJsonSource[sectionAtSource] || !packageJsonSource[sectionAtSource][dependencyAtSource]) { diff --git a/generators/react-native/templates/package.json b/generators/react-native/templates/package.json index eefe807cc..56e866924 100644 --- a/generators/react-native/templates/package.json +++ b/generators/react-native/templates/package.json @@ -58,7 +58,6 @@ "mockery": "2.1.0", "patch-package": "8.0.0", "path-exists": "5.0.0", - "prettier": "3.3.1", "react-test-renderer": "18.2.0", "resolve": "1.22.8", "rimraf": "5.0.7", diff --git a/generators/react-native/templates/package.json.ejs b/generators/react-native/templates/package.json.ejs index b0939534c..19ac727bb 100644 --- a/generators/react-native/templates/package.json.ejs +++ b/generators/react-native/templates/package.json.ejs @@ -113,7 +113,7 @@ "mockery": "REPLACE_WITH_VERSION", "patch-package": "REPLACE_WITH_VERSION", "path-exists": "REPLACE_WITH_VERSION", - "prettier": "REPLACE_WITH_VERSION", + "prettier": null, "react-test-renderer": "REPLACE_WITH_VERSION", "resolve": "REPLACE_WITH_VERSION", "rimraf": "REPLACE_WITH_VERSION",