Commit 7cfc5ac
committed
fix(tsconfig): apply
When a project reference uses `extends` to inherit its `baseUrl`/`paths`
from a shared base config, those fields must be merged before the
reference is consulted for resolution. The previous flow loaded each
reference through `cache.tsconfig` and only ran the extends-merging
logic on the entry tsconfig, so a transitively-referenced project
whose aliases live in an extended base file would resolve as if it had
no aliases at all.
This was a pre-existing latent bug at depth 1 — direct references with
`extends` did not inherit their aliases either — that the new
transitive-references support made easier to hit.
Changes:
- Extract `merge_tsconfig_extends` from `load_tsconfig` and call it
from `load_references`' inner callback after the self-reference
check, before recursing into nested references.
- Update the `references-transitive` fixture: `project_c` now reads its
`paths` from a sibling `tsconfig.base.json` via `extends`. The
existing `transitive_references` test fails before this fix
(NotFound) and passes after.
Detected via Codex review of #213.extends to project references before recursing1 parent 415504a commit 7cfc5ac
3 files changed
Lines changed: 56 additions & 33 deletions
File tree
- fixtures/tsconfig/cases/references-transitive
- project_c
- src
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1475 | 1475 | | |
1476 | 1476 | | |
1477 | 1477 | | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1507 | 1481 | | |
1508 | 1482 | | |
1509 | 1483 | | |
| |||
1562 | 1536 | | |
1563 | 1537 | | |
1564 | 1538 | | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
1565 | 1545 | | |
1566 | 1546 | | |
1567 | 1547 | | |
| |||
1577 | 1557 | | |
1578 | 1558 | | |
1579 | 1559 | | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
1580 | 1598 | | |
1581 | 1599 | | |
1582 | 1600 | | |
| |||
0 commit comments