@gumuskit/ts-error
v1.0.1
Published
Translates TypeScript compiler errors into human readable messages
Readme
@gumuskit/ts-error
TypeScript'in ürettiği karmaşık hata mesajlarını okunabilir açıklamalara ve actionable çözüm önerilerine çeviren CLI aracı.
Problem
src/auth/user.ts(42,13): error TS2322: Type 'string | undefined'
is not assignable to type 'string'.Bu mesaj ne anlama geliyor? Nasıl düzeltilir? @gumuskit/ts-error bunu senin için çözer.
Çözüm
tsc --noEmit 2>&1 | gumuskit ts-error✗ src/auth/user.ts — 42:13
Yanlış tip atanıyor.
→ null kontrolü ekle: user.email ?? ''
──────────────────────────────────────
1 hata bulundu.Kurulum
# Global CLI olarak
npm install -g gumuskit-cli
# Sadece bu paketi kullanmak için
npm install @gumuskit/ts-errorKullanım
# tsc çıktısını pipe ile
tsc --noEmit 2>&1 | gumuskit ts-error
# tsconfig üzerinden direkt
gumuskit ts-error --project ./tsconfig.json
# CI için JSON çıktı
gumuskit ts-error --json > errors.jsonNode.js API
import { parseErrors, format } from '@gumuskit/ts-error'
const errors = parseErrors('./tsconfig.json')
console.log(format(errors))Desteklenen Hata Kodları
| Kod | Açıklama | |-----|----------| | TS2322 | Yanlış tip atanıyor | | TS2345 | Yanlış tipte argüman | | TS2339 | Özellik bu tipte tanımlı değil | | TS2304 | İsim bulunamıyor | | TS2307 | Modül bulunamıyor | | TS2532 | Değer undefined olabilir | | TS2531 | Değer null olabilir | | TS2741 | Gerekli özellik eksik | | TS7006 | Parametre tipi belirtilmemiş | | TS7016 | Tip tanımı bulunamıyor |
CI Entegrasyonu
# .github/workflows/typecheck.yml
- name: Type check
run: tsc --noEmit 2>&1 | npx @gumuskit/ts-error --json > ts-errors.json