Overview
tsconfig.json defines nine path aliases and jest.config.js mirrors seven of them, but the codebase overwhelmingly uses relative imports — ../../config, ../../store, ../../utils/logger — up to three levels deep. The useProfileData.ts bug (three imports with one ../ too many, breaking the module) is a direct consequence: relative depth is easy to get wrong and invisible in review. The alias definitions in tsconfig.json and jest.config.js have also drifted; @/components/* and @/constants/* exist in one and not the other.
Specifications
Features:
- Aliases used for all cross-directory imports; relative paths only within a directory
- Alias definitions synchronised across
tsconfig.json, jest.config.js and babel.config.js
- A lint rule discouraging
../../ and deeper
Tasks:
- Reconcile the alias lists across the three configuration files
- Codemod cross-directory relative imports to aliases
- Add
no-restricted-imports forbidding patterns with two or more ../ segments
- Verify Metro resolves the aliases in a production export
Impacted Files:
tsconfig.json
jest.config.js
babel.config.js
metro.config.js
src/
Acceptance Criteria
- No import contains
../../
- Alias definitions are identical across all configs
- A production export resolves all aliases
Overview
tsconfig.jsondefines nine path aliases andjest.config.jsmirrors seven of them, but the codebase overwhelmingly uses relative imports —../../config,../../store,../../utils/logger— up to three levels deep. TheuseProfileData.tsbug (three imports with one../too many, breaking the module) is a direct consequence: relative depth is easy to get wrong and invisible in review. The alias definitions intsconfig.jsonandjest.config.jshave also drifted;@/components/*and@/constants/*exist in one and not the other.Specifications
Features:
tsconfig.json,jest.config.jsandbabel.config.js../../and deeperTasks:
no-restricted-importsforbidding patterns with two or more../segmentsImpacted Files:
tsconfig.jsonjest.config.jsbabel.config.jsmetro.config.jssrc/Acceptance Criteria
../../