Bugfix: How to fix type mismatch between SkillStudioDataService (tru...

Documentation for Sessions

🐛 Bugfix: How to fix type mismatch between SkillStudioDataService (tru...

Date: 2026-03-04
Time: 16:34:51 UTC
Session: gspace1-175.11
Agent: angular
Confidence: 97%
Status: ✅ Documented


📋 Decision Context

Question:

How to fix type mismatch between SkillStudioDataService (trustLevel: string) and SkillMarketplaceGridComponent (trustLevel: 'verified' | 'community' | 'draft'), and the isolatedModules re-export error?

Task: Session 175: Fix TS2322 SkillListing type mismatch and TS1205 isolatedModules error


🎯 Decision Made

Chosen:

Imported the canonical SkillListing type from the grid component using 'import type' and re-exported with 'export type' in the data service. This ensures a single source of truth for the type while complying with Angular's isolatedModules compiler requirement.

Options Considered:

  1. Import canonical type with 'import type' + 'export type' (chosen)
  2. Create duplicate SkillListing interface with string trustLevel
  3. Widen the grid component to accept string trustLevel
  4. Use a shared types file in the skill-studio directory

💭 Reasoning

Root cause: when extracting SkillStudioDataService from the parent component, I created a duplicate SkillListing interface with trustLevel: string instead of importing the canonical type from the grid component. The grid component has the correct union type ('verified' | 'community' | 'draft'). Angular's isolatedModules setting requires export type for type-only re-exports — using bare export { SkillListing } triggers TS1205. This is a known convention (already in our conventions list). Early warning: always import canonical types rather than recreating interfaces when extracting services.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation