Convention: How should tsconfig path mappings be formatted for library i...

Documentation for Sessions

📏 Convention: How should tsconfig path mappings be formatted for library i...

Date: 2026-02-05
Time: 04:40:56 UTC
Session: editor2-89.17
Agent: architecture
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

How should tsconfig path mappings be formatted for library index files?

Task: Not specified


🎯 Decision Made

Chosen:

Path with .ts extension: libs/lib-name/src/index.ts

Options Considered:

  1. Path without extension: libs/lib-name/src/index
  2. Path with .ts extension: libs/lib-name/src/index.ts
  3. Use wildcard: libs/lib-name/src/*
  4. Reference dist folder

💭 Reasoning

TypeScript path mappings in tsconfig.base.json MUST include the .ts extension for index files. Without it, TypeScript cannot resolve the file and throws 'File not found' errors. WRONG: '@libs-core/ui-framework': ['libs/core/ui-framework/src/index']. CORRECT: '@libs-core/ui-framework': ['libs/core/ui-framework/src/index.ts']. This applies to all library path mappings. The wildcard paths (e.g., '@libs-core/ui-framework/': ['libs/core/ui-framework/src/']) do NOT need the extension as they match any file pattern.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation