Avatar ·

How to configure path aliases in tsconfig.json for TypeScript?

Hi! I'm new to TypeScript and trying to organize my project structure. I have this simple folder structure:\n\n```\nsrc/\n ├── components/\n │ └── Header.ts\n ├── utils/\n │ └── helpers.ts\n └── index.ts\n```\n\nIn the `index.ts` file, I import components and utilities like this:\n\n```typescript\nimport { Header } from './components/Header';\nimport { formatDate } from './utils/helpers';\n```\n\nEverything works, but when the project grows, relative paths become very long and inconvenient, for example: `../../components/Header` or `../../../utils/helpers`. It looks terrible and is hard to maintain.\n\nI heard that in `tsconfig.json` you can configure path aliases to write imports like `@components/Header` or `@utils/helpers`. I tried to add