Skip to content

refactor: standardize all imports to absolute src/ path alias#19

Open
Tinna23 wants to merge 1 commit into
SourceXXL:mainfrom
Tinna23:feat/standardize-src-imports
Open

refactor: standardize all imports to absolute src/ path alias#19
Tinna23 wants to merge 1 commit into
SourceXXL:mainfrom
Tinna23:feat/standardize-src-imports

Conversation

@Tinna23

@Tinna23 Tinna23 commented Jun 18, 2026

Copy link
Copy Markdown

Summary

Closes #6

  • tsconfig.json: Added "paths": { "src/*": ["src/*"] } to compilerOptions (with baseUrl: "./") so TypeScript resolves src/... imports from the repo root
  • 28 files updated: All cross-domain relative imports (../../*, ../../../*) replaced with src/ absolute path aliases across modules: core/auth, core/user, blockchain/oracle, infrastructure/audit, investment/portfolio, investment/risk-management, defi, and common/guard
  • ESLint rule added: no-restricted-imports warn rule flags ../../* patterns to prevent future cross-domain relative imports
  • Bonus: Flattened redundant src/defi/defi/ nesting — all defi files moved to src/defi/ and imports updated accordingly

Test plan

  • npm run build passes with no errors (webpack compiled successfully)
  • npm run lint runs with no no-restricted-imports warnings on converted files
  • Same-directory imports (./dto/..., ./entities/..., ./services/...) left untouched
  • New files at src/defi/entities/ and src/defi/trade.controller.ts use src/ absolute imports

Moves all files from the nested src/defi/defi/ directory up one level
to src/defi/, matching the flat structure used by other domain modules.

- git mv all 19 files: controllers, module, dto, entities, services, protocols
- Update src/defi/trade.controller.ts import: ../../core/auth → ../core/auth
- Update entity imports: ../../../core/user/entities → ../../core/user/entities
- Update src/app.module.ts: ./defi/defi/ → ./defi/ for module and entity imports
- Replace src/defi/protocols/aave.adapter.ts and protocol-adapter.interface.ts
  with the more complete versions from src/defi/defi/protocols/
- Remove empty src/defi/defi/ directory

Closes SourceXXL#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize All Imports to Absolute src/ Path Aliias

2 participants