Skip to content

Commit ddfbef5

Browse files
authored
Fix astro add adding lines from extended configurations (#5095)
1 parent 0173c2b commit ddfbef5

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fix `astro add` trying to add lines from extended configurations when adding frameworks

.changeset/neat-phones-sin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/react': patch
3+
---
4+
5+
Add `@types/` packages as peerDependencies

packages/astro/src/core/config/tsconfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export function loadTSConfig(cwd: string | undefined, resolve = true): tsr.TsCon
5656
let config = tsr.tsconfigResolverSync({
5757
cwd,
5858
filePath: resolve ? undefined : cwd,
59+
ignoreExtends: !resolve,
5960
});
6061

6162
// When a direct filepath is provided to `tsconfigResolver`, it'll instead return invalid-config even when
@@ -70,6 +71,7 @@ export function loadTSConfig(cwd: string | undefined, resolve = true): tsr.TsCon
7071
cwd,
7172
filePath: resolve ? undefined : cwd,
7273
searchName: 'jsconfig.json',
74+
ignoreExtends: !resolve,
7375
});
7476

7577
if (

packages/integrations/react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"peerDependencies": {
4949
"react": "^17.0.2 || ^18.0.0",
5050
"react-dom": "^17.0.2 || ^18.0.0",
51-
"@types/react": "^17.0.50 || ^18.0.21"
51+
"@types/react": "^17.0.50 || ^18.0.21",
52+
"@types/react-dom": "^17.0.17 || ^18.0.6"
5253
},
5354
"engines": {
5455
"node": "^14.18.0 || >=16.12.0"

0 commit comments

Comments
 (0)