Skip to content

Standardize All Imports to Absolute src/ Path Aliias #295

Description

@grantfox-oss

Description
The codebase mixes absolute (src/core/auth/...) and relative (../../core/auth/...) import styles. Relative imports are fragile — any file move breaks them, as demonstrated by the build failures in delegation.service.ts and enhanced-auth.service.ts. The tsconfig.json already supports path aliases. Standardizing on src/-prefixed absolute imports eliminates an entire class of build errors.

Direction

  1. Confirm tsconfig.json has "paths": { "src/*": ["src/*"] } (add if missing).
  2. Run a codebase-wide replacement:
    • Replace all from "../../ and from "../ relative imports that cross domain boundaries with from "src/... absolute imports.
    • Keep same-directory relative imports (e.g., ./dto/create-payload.dto) as-is — these are appropriate.
  3. Add an ESLint rule (no-restricted-paths or import/no-relative-parent-imports) to enforce the convention going forward.

Definition of Done

  • Every cross-directory import uses the src/ absolute alias.
  • Relative imports are only used for same-directory or direct-child references.

Acceptance Criteria

  • tsconfig.json contains the src/* path alias
  • Zero imports use ../../ to reach across domain boundaries
  • ESLint rule is configured and enforced (npm run lint passes)
  • npm run build succeeds
  • npm run test passes

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions