Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): fix issues with react ts setup
Browse files Browse the repository at this point in the history
jaysoo committed Dec 11, 2024
1 parent 726c07d commit 45cb3ed
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/expo/src/generators/library/library.ts
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ export async function expoLibraryGeneratorInternal(

// Always run install to link packages.
if (options.isUsingTsSolutionConfig) {
tasks.push(() => installPackagesTask(host));
tasks.push(() => installPackagesTask(host, true));
}

tasks.push(() => {
2 changes: 1 addition & 1 deletion packages/react-native/src/generators/library/library.ts
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ export async function reactNativeLibraryGeneratorInternal(

// Always run install to link packages.
if (options.isUsingTsSolutionConfig) {
tasks.push(() => installPackagesTask(host));
tasks.push(() => installPackagesTask(host, true));
}

tasks.push(() => {
18 changes: 13 additions & 5 deletions packages/react/src/generators/application/application.ts
Original file line number Diff line number Diff line change
@@ -361,11 +361,19 @@ export async function applicationGeneratorInternal(
);
}

updateTsconfigFiles(host, options.appProjectRoot, 'tsconfig.app.json', {
jsx: 'react-jsx',
module: 'esnext',
moduleResolution: 'bundler',
});
updateTsconfigFiles(
host,
options.appProjectRoot,
'tsconfig.app.json',
{
jsx: 'react-jsx',
module: 'esnext',
moduleResolution: 'bundler',
},
options.linter === 'eslint'
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
: undefined
);

if (!options.skipFormat) {
await formatFiles(host);
2 changes: 1 addition & 1 deletion packages/react/src/generators/library/library.ts
Original file line number Diff line number Diff line change
@@ -286,7 +286,7 @@ export async function libraryGeneratorInternal(host: Tree, schema: Schema) {

// Always run install to link packages.
if (options.isUsingTsSolutionConfig) {
tasks.push(() => installPackagesTask(host));
tasks.push(() => installPackagesTask(host, true));
}

tasks.push(() => {

0 comments on commit 45cb3ed

Please sign in to comment.