|
| 1 | +# Remove Path Aliases |
| 2 | + |
| 3 | +Date: 2025-10-23 |
| 4 | + |
| 5 | +Status: accepted |
| 6 | + |
| 7 | +## Context |
| 8 | + |
| 9 | +In [031-imports](./031-imports.md), we implemented path aliases using both the |
| 10 | +`"imports"` field in `package.json` and the `paths` field in `tsconfig.json`. |
| 11 | +This was done as a temporary solution because TypeScript didn't natively support |
| 12 | +the `"imports"` field, requiring us to maintain both configurations to get |
| 13 | +autocomplete and type checking. |
| 14 | + |
| 15 | +However, TypeScript has now added native support for the `"imports"` field in |
| 16 | +`package.json` (as referenced in the original decision's "yet" link). This means |
| 17 | +we no longer need the `paths` configuration in `tsconfig.json` to get proper |
| 18 | +TypeScript support for our imports. |
| 19 | + |
| 20 | +## Decision |
| 21 | + |
| 22 | +We're removing the path aliases configuration from `tsconfig.json` and relying |
| 23 | +solely on the `"imports"` field in `package.json`. This simplifies our |
| 24 | +configuration and aligns with the standard Node.js approach. |
| 25 | + |
| 26 | +The `"imports"` field will continue to work as before, providing the same import |
| 27 | +resolution functionality, but now with full TypeScript support without requiring |
| 28 | +duplicate configuration. |
| 29 | + |
| 30 | +## Consequences |
| 31 | + |
| 32 | +- **Simplified configuration**: We no longer need to maintain both |
| 33 | + `package.json` imports and `tsconfig.json` paths |
| 34 | +- **Standard compliance**: We're now using the standard Node.js approach without |
| 35 | + TypeScript-specific workarounds |
| 36 | +- **Reduced maintenance**: One less configuration to keep in sync |
| 37 | +- **Better tooling support**: TypeScript now natively understands the |
| 38 | + `"imports"` field, providing better IDE support |
| 39 | + |
| 40 | +This supersedes [031-imports](./031-imports.md) as the current approach for |
| 41 | +handling imports in the Epic Stack. |
0 commit comments