[{"data":1,"prerenderedAt":1259},["Reactive",2],{"/posts/typescript-nedir":3,"/posts/typescript-nedir:related":1160,"/posts/typescript-nedir:alternate":1258},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"read":11,"lang":12,"body":13,"_type":1154,"_id":1155,"_source":1156,"_file":1157,"_extension":1158,"sitemap":1159},"/posts/typescript-nedir","posts",false,"","TypeScript nedir? JavaScript'e ne ekler, tsconfig nasıl ayarlanır?","TypeScript nedir, JavaScript'ten farkı ne? Tipler, union, generic ve narrowing örnekleri, tsconfig.json'un temel ayarları ve Node.js ile kullanımı.","2026-11-21","8 dk","tr",{"type":14,"children":15,"toc":1130},"root",[16,33,65,72,93,98,100,202,215,221,228,233,245,274,284,290,295,304,325,331,344,353,374,380,385,394,405,411,424,433,452,458,463,474,508,513,525,534,594,607,613,631,642,647,656,661,876,934,940,945,950,963,994,999,1005,1011,1032,1038,1050,1056,1061,1081,1093,1105],{"type":17,"tag":18,"props":19,"children":20},"element","p",{},[21,24,31],{"type":22,"value":23},"text","TypeScript, JavaScript'in üzerine tip sistemi ekleyen bir dil. Yazdığınız kod derlendiğinde düz JavaScript'e dönüşüyor ve tarayıcıda ya da Node.js'te normal JavaScript gibi çalışıyor. Fark, kodu çalıştırmadan önce ortaya çıkıyor: yanlış tipte bir değer gönderdiğinizde, olmayan bir alana eriştiğinizde ya da ",{"type":17,"tag":25,"props":26,"children":28},"code",{"className":27},[],[29],{"type":22,"value":30},"undefined",{"type":22,"value":32}," olabilecek bir şeyi kontrol etmeden kullandığınızda TypeScript sizi daha editörde uyarıyor.",{"type":17,"tag":18,"props":34,"children":35},{},[36,38,45,47,55,57,63],{"type":22,"value":37},"TypeScript nedir sorusuna benim pratik cevabım şu: JavaScript'te çalışma anında, çoğu zaman production'da öğrendiğiniz hataların büyük kısmını yazarken öğrenmenizi sağlayan bir araç. ",{"type":17,"tag":39,"props":40,"children":42},"a",{"href":41},"/tr",[43],{"type":22,"value":44},"Kullandığım diller",{"type":22,"value":46}," arasında ilk sırada TypeScript var. Backend servislerini Node.js ve NestJS ile TypeScript'te yazıyorum, açık kaynak web proxy'm ",{"type":17,"tag":39,"props":48,"children":52},{"href":49,"rel":50},"https://github.com/halitsever/girici-web-proxy",[51],"noopener",[53],{"type":22,"value":54},"girici-web-proxy",{"type":22,"value":56}," de TypeScript ve Vue ile yazılı. Bu yazıda TypeScript'in JavaScript'e ne eklediğini küçük örneklerle, sonra da ",{"type":17,"tag":25,"props":58,"children":60},{"className":59},[],[61],{"type":22,"value":62},"tsconfig.json",{"type":22,"value":64}," dosyasının temel ayarlarını anlatıyorum.",{"type":17,"tag":66,"props":67,"children":69},"h2",{"id":68},"typescript-nedir-javascriptten-farkı-ne",[70],{"type":22,"value":71},"TypeScript nedir, JavaScript'ten farkı ne?",{"type":17,"tag":18,"props":73,"children":74},{},[75,77,83,85,91],{"type":22,"value":76},"TypeScript, Microsoft'un geliştirdiği açık kaynak bir dil. JavaScript'in bir üst kümesi, yani her geçerli JavaScript kodu aynı zamanda geçerli bir TypeScript kodu. Bir ",{"type":17,"tag":25,"props":78,"children":80},{"className":79},[],[81],{"type":22,"value":82},".js",{"type":22,"value":84}," dosyasının uzantısını ",{"type":17,"tag":25,"props":86,"children":88},{"className":87},[],[89],{"type":22,"value":90},".ts",{"type":22,"value":92}," yapıp üzerine yavaş yavaş tip eklemeye başlayabiliyorsunuz.",{"type":17,"tag":18,"props":94,"children":95},{},[96],{"type":22,"value":97},"Temel fark şu:",{"type":22,"value":99},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":17,"tag":101,"props":102,"children":103},"table",{},[104,125],{"type":17,"tag":105,"props":106,"children":107},"thead",{},[108],{"type":17,"tag":12,"props":109,"children":110},{},[111,115,120],{"type":17,"tag":112,"props":113,"children":114},"th",{},[],{"type":17,"tag":112,"props":116,"children":117},{},[118],{"type":22,"value":119},"JavaScript",{"type":17,"tag":112,"props":121,"children":122},{},[123],{"type":22,"value":124},"TypeScript",{"type":17,"tag":126,"props":127,"children":128},"tbody",{},[129,148,166,184],{"type":17,"tag":12,"props":130,"children":131},{},[132,138,143],{"type":17,"tag":133,"props":134,"children":135},"td",{},[136],{"type":22,"value":137},"Tip kontrolü",{"type":17,"tag":133,"props":139,"children":140},{},[141],{"type":22,"value":142},"Çalışma anında, hata olursa",{"type":17,"tag":133,"props":144,"children":145},{},[146],{"type":22,"value":147},"Yazarken ve derlerken",{"type":17,"tag":12,"props":149,"children":150},{},[151,156,161],{"type":17,"tag":133,"props":152,"children":153},{},[154],{"type":22,"value":155},"Çalıştığı yer",{"type":17,"tag":133,"props":157,"children":158},{},[159],{"type":22,"value":160},"Tarayıcı, Node.js",{"type":17,"tag":133,"props":162,"children":163},{},[164],{"type":22,"value":165},"Önce JavaScript'e derleniyor, sonra aynı yerlerde",{"type":17,"tag":12,"props":167,"children":168},{},[169,174,179],{"type":17,"tag":133,"props":170,"children":171},{},[172],{"type":22,"value":173},"Editör desteği",{"type":17,"tag":133,"props":175,"children":176},{},[177],{"type":22,"value":178},"Sınırlı tahmin",{"type":17,"tag":133,"props":180,"children":181},{},[182],{"type":22,"value":183},"Otomatik tamamlama, güvenli yeniden adlandırma",{"type":17,"tag":12,"props":185,"children":186},{},[187,192,197],{"type":17,"tag":133,"props":188,"children":189},{},[190],{"type":22,"value":191},"Öğrenme",{"type":17,"tag":133,"props":193,"children":194},{},[195],{"type":22,"value":196},"Daha kısa",{"type":17,"tag":133,"props":198,"children":199},{},[200],{"type":22,"value":201},"JavaScript'in üzerine tip sistemi",{"type":17,"tag":18,"props":203,"children":204},{},[205,207,213],{"type":22,"value":206},"TypeScript'in tipleri çalışma anında yok. Derleme sırasında siliniyorlar. Yani API'den gelen bir JSON'un gerçekten beklediğiniz şekilde olup olmadığını TypeScript tek başına kontrol edemiyor. Dış dünyadan gelen veriyi yine doğrulamanız gerekiyor. Bunun için Zod gibi kütüphaneler ya da NestJS'te ",{"type":17,"tag":25,"props":208,"children":210},{"className":209},[],[211],{"type":22,"value":212},"class-validator",{"type":22,"value":214}," kullanılıyor.",{"type":17,"tag":66,"props":216,"children":218},{"id":217},"typescript-javascripte-ne-ekler-küçük-örneklerle",[219],{"type":22,"value":220},"TypeScript JavaScript'e ne ekler? Küçük örneklerle",{"type":17,"tag":222,"props":223,"children":225},"h3",{"id":224},"tipler-ve-hatayı-erken-yakalamak",[226],{"type":22,"value":227},"Tipler ve hatayı erken yakalamak",{"type":17,"tag":18,"props":229,"children":230},{},[231],{"type":22,"value":232},"Bir sepet toplamı hesaplayan fonksiyon düşünün:",{"type":17,"tag":234,"props":235,"children":240},"pre",{"className":236,"code":238,"language":239,"meta":7},[237],"language-ts","type Urun = {\n  ad: string;\n  fiyat: number;\n};\n\nfunction toplam(urunler: Urun[]): number {\n  return urunler.reduce((t, u) => t + u.fiyat, 0);\n}\n\ntoplam([\n  { ad: \"Kahve\", fiyat: \"120\" },\n  { ad: \"Kurabiye\", fiyat: 80 },\n]);\n","ts",[241],{"type":17,"tag":25,"props":242,"children":243},{"__ignoreMap":7},[244],{"type":22,"value":238},{"type":17,"tag":18,"props":246,"children":247},{},[248,250,256,258,264,266,272],{"type":22,"value":249},"JavaScript'te bu kod hata vermeden çalışır ve ",{"type":17,"tag":25,"props":251,"children":253},{"className":252},[],[254],{"type":22,"value":255},"200",{"type":22,"value":257}," yerine ",{"type":17,"tag":25,"props":259,"children":261},{"className":260},[],[262],{"type":22,"value":263},"\"012080\"",{"type":22,"value":265}," döner, çünkü ",{"type":17,"tag":25,"props":267,"children":269},{"className":268},[],[270],{"type":22,"value":271},"+",{"type":22,"value":273}," operatörü sayıyla metni birleştirir. Fiyat bir formdan ya da bir API'den metin olarak geldiğinde bu hata kolayca production'a kadar gidiyor. TypeScript ise kodu çalıştırmadan durduruyor:",{"type":17,"tag":234,"props":275,"children":279},{"className":276,"code":278,"language":22,"meta":7},[277],"language-text","error TS2322: Type 'string' is not assignable to type 'number'.\n",[280],{"type":17,"tag":25,"props":281,"children":282},{"__ignoreMap":7},[283],{"type":22,"value":278},{"type":17,"tag":222,"props":285,"children":287},{"id":286},"union-tipleri",[288],{"type":22,"value":289},"Union tipleri",{"type":17,"tag":18,"props":291,"children":292},{},[293],{"type":22,"value":294},"Bir değerin yalnızca belirli birkaç değerden biri olabileceğini söylemek için:",{"type":17,"tag":234,"props":296,"children":299},{"className":297,"code":298,"language":239,"meta":7},[237],"type Durum = \"beklemede\" | \"hazirlaniyor\" | \"teslim-edildi\";\n\nfunction etiket(durum: Durum): string {\n  switch (durum) {\n    case \"beklemede\":\n      return \"Sipariş alındı\";\n    case \"hazirlaniyor\":\n      return \"Hazırlanıyor\";\n    case \"teslim-edildi\":\n      return \"Teslim edildi\";\n  }\n}\n\netiket(\"iptal\");\n// error TS2345: Argument of type '\"iptal\"' is not assignable to parameter of type 'Durum'.\n",[300],{"type":17,"tag":25,"props":301,"children":302},{"__ignoreMap":7},[303],{"type":22,"value":298},{"type":17,"tag":18,"props":305,"children":306},{},[307,309,315,317,323],{"type":22,"value":308},"Yazım hatası yapılmış bir durum adı artık bir hata, sessiz bir bug değil. ",{"type":17,"tag":25,"props":310,"children":312},{"className":311},[],[313],{"type":22,"value":314},"Durum",{"type":22,"value":316}," tipine yeni bir değer eklediğinizde, ",{"type":17,"tag":25,"props":318,"children":320},{"className":319},[],[321],{"type":22,"value":322},"switch",{"type":22,"value":324}," içinde onu karşılamayan her fonksiyon da hata veriyor. Büyük bir kod tabanında bir değişikliğin nereleri etkilediğini bulmanın en hızlı yolu bu.",{"type":17,"tag":222,"props":326,"children":328},{"id":327},"undefined-kontrolü",[329],{"type":22,"value":330},"undefined kontrolü",{"type":17,"tag":18,"props":332,"children":333},{},[334,336,342],{"type":22,"value":335},"JavaScript'te en sık görülen hatalardan biri ",{"type":17,"tag":25,"props":337,"children":339},{"className":338},[],[340],{"type":22,"value":341},"Cannot read properties of undefined",{"type":22,"value":343},". TypeScript strict modda bunu derleme anında yakalıyor:",{"type":17,"tag":234,"props":345,"children":348},{"className":346,"code":347,"language":239,"meta":7},[237],"interface Kullanici {\n  id: number;\n  ad: string;\n  email?: string;\n}\n\nfunction selamla(k: Kullanici) {\n  return k.email.toLowerCase();\n  // error TS18048: 'k.email' is possibly 'undefined'.\n}\n",[349],{"type":17,"tag":25,"props":350,"children":351},{"__ignoreMap":7},[352],{"type":22,"value":347},{"type":17,"tag":18,"props":354,"children":355},{},[356,358,364,366,372],{"type":22,"value":357},"Düzeltmek için ya kontrol ediyorsunuz (",{"type":17,"tag":25,"props":359,"children":361},{"className":360},[],[362],{"type":22,"value":363},"if (k.email)",{"type":22,"value":365},") ya da ",{"type":17,"tag":25,"props":367,"children":369},{"className":368},[],[370],{"type":22,"value":371},"k.email?.toLowerCase()",{"type":22,"value":373}," yazıyorsunuz.",{"type":17,"tag":222,"props":375,"children":377},{"id":376},"genericler",[378],{"type":22,"value":379},"Generic'ler",{"type":17,"tag":18,"props":381,"children":382},{},[383],{"type":22,"value":384},"Her tiple çalışan ama tip bilgisini kaybetmeyen fonksiyonlar için:",{"type":17,"tag":234,"props":386,"children":389},{"className":387,"code":388,"language":239,"meta":7},[237],"function ilk\u003CT>(liste: T[]): T | undefined {\n  return liste[0];\n}\n\nconst sayi = ilk([1, 2, 3]);        // number | undefined\nconst isim = ilk([\"Ali\", \"Ayşe\"]); // string | undefined\n",[390],{"type":17,"tag":25,"props":391,"children":392},{"__ignoreMap":7},[393],{"type":22,"value":388},{"type":17,"tag":18,"props":395,"children":396},{},[397,403],{"type":17,"tag":25,"props":398,"children":400},{"className":399},[],[401],{"type":22,"value":402},"T",{"type":22,"value":404}," burada bir yer tutucu. Fonksiyonu çağırdığınızda TypeScript onun ne olduğunu kendisi çıkarıyor.",{"type":17,"tag":222,"props":406,"children":408},{"id":407},"narrowing",[409],{"type":22,"value":410},"Narrowing",{"type":17,"tag":18,"props":412,"children":413},{},[414,416,422],{"type":22,"value":415},"Bir ",{"type":17,"tag":39,"props":417,"children":419},{"href":418},"/posts/api-nedir",[420],{"type":22,"value":421},"API",{"type":22,"value":423}," çağrısının sonucu başarılı ya da hatalı olabilir. Bunu tipte göstermek:",{"type":17,"tag":234,"props":425,"children":428},{"className":426,"code":427,"language":239,"meta":7},[237],"type Sonuc =\n  | { ok: true; veri: Kullanici }\n  | { ok: false; hata: string };\n\nfunction yazdir(s: Sonuc) {\n  if (s.ok) {\n    console.log(s.veri.ad); // burada TypeScript s'nin başarılı olduğunu biliyor\n  } else {\n    console.log(s.hata);\n  }\n}\n",[429],{"type":17,"tag":25,"props":430,"children":431},{"__ignoreMap":7},[432],{"type":22,"value":427},{"type":17,"tag":18,"props":434,"children":435},{},[436,442,444,450],{"type":17,"tag":25,"props":437,"children":439},{"className":438},[],[440],{"type":22,"value":441},"if (s.ok)",{"type":22,"value":443}," kontrolünden sonra TypeScript hangi dalda hangi alanların var olduğunu biliyor. Başarısız bir sonuçta ",{"type":17,"tag":25,"props":445,"children":447},{"className":446},[],[448],{"type":22,"value":449},"s.veri",{"type":22,"value":451},"'ye erişmeye çalışırsanız hata alıyorsunuz.",{"type":17,"tag":66,"props":453,"children":455},{"id":454},"typescript-nasıl-kurulur-ve-çalıştırılır",[456],{"type":22,"value":457},"TypeScript nasıl kurulur ve çalıştırılır?",{"type":17,"tag":18,"props":459,"children":460},{},[461],{"type":22,"value":462},"TypeScript bir npm paketi. Projeye geliştirme bağımlılığı olarak ekleyin:",{"type":17,"tag":234,"props":464,"children":469},{"className":465,"code":467,"language":468,"meta":7},[466],"language-bash","npm install -D typescript\nnpx tsc --init\n","bash",[470],{"type":17,"tag":25,"props":471,"children":472},{"__ignoreMap":7},[473],{"type":22,"value":467},{"type":17,"tag":18,"props":475,"children":476},{},[477,483,485,491,493,498,500,506],{"type":17,"tag":25,"props":478,"children":480},{"className":479},[],[481],{"type":22,"value":482},"tsc",{"type":22,"value":484}," TypeScript derleyicisi. ",{"type":17,"tag":25,"props":486,"children":488},{"className":487},[],[489],{"type":22,"value":490},"npx tsc",{"type":22,"value":492}," komutu ",{"type":17,"tag":25,"props":494,"children":496},{"className":495},[],[497],{"type":22,"value":62},{"type":22,"value":499}," dosyasını okuyup kodu kontrol ediyor ve JavaScript çıktısını üretiyor. Yalnızca tip kontrolü yapıp dosya üretmemesini istiyorsanız ",{"type":17,"tag":25,"props":501,"children":503},{"className":502},[],[504],{"type":22,"value":505},"npx tsc --noEmit",{"type":22,"value":507}," kullanın. CI'da çalıştırmak için uygun olan komut bu.",{"type":17,"tag":18,"props":509,"children":510},{},[511],{"type":22,"value":512},"Güncel sürüm TypeScript 7. Bu sürümle derleyici native koda taşındı ve TypeScript ekibinin açıklamasına göre çoğu projede 6.0'dan yaklaşık 10 kat daha hızlı. 6.0'da temiz derlenen kod 7.0'da da aynı şekilde derleniyor.",{"type":17,"tag":18,"props":514,"children":515},{},[516,518,523],{"type":22,"value":517},"Node.js tarafında da işler kolaylaştı. Node.js 22.18 ve 23.6'dan itibaren yalnızca tip açıklaması içeren ",{"type":17,"tag":25,"props":519,"children":521},{"className":520},[],[522],{"type":22,"value":90},{"type":22,"value":524}," dosyalarını doğrudan çalıştırabiliyor:",{"type":17,"tag":234,"props":526,"children":529},{"className":527,"code":528,"language":468,"meta":7},[466],"node src/index.ts\n",[530],{"type":17,"tag":25,"props":531,"children":532},{"__ignoreMap":7},[533],{"type":22,"value":528},{"type":17,"tag":18,"props":535,"children":536},{},[537,539,545,547,553,555,560,562,568,570,576,577,583,585,592],{"type":22,"value":538},"Node.js burada tipleri silip kodu çalıştırıyor, tip kontrolü yapmıyor. ",{"type":17,"tag":25,"props":540,"children":542},{"className":541},[],[543],{"type":22,"value":544},"enum",{"type":22,"value":546},", çalışma anı kodu içeren ",{"type":17,"tag":25,"props":548,"children":550},{"className":549},[],[551],{"type":22,"value":552},"namespace",{"type":22,"value":554}," ve constructor parametre property'leri gibi JavaScript'e çevrilmesi gereken özellikler desteklenmiyor. Bu yüzden Node.js'e doğrudan verilecek kodda ",{"type":17,"tag":25,"props":556,"children":558},{"className":557},[],[559],{"type":22,"value":544},{"type":22,"value":561}," yerine yukarıdaki gibi union tipleri kullanmak daha güvenli. Bir uyarı: Ubuntu'nun kendi deposundan kurulan ",{"type":17,"tag":25,"props":563,"children":565},{"className":564},[],[566],{"type":22,"value":567},"nodejs",{"type":22,"value":569}," paketinde bu özellik kapalı gelebiliyor. ",{"type":17,"tag":25,"props":571,"children":573},{"className":572},[],[574],{"type":22,"value":575},"node -p process.features.typescript",{"type":22,"value":492},{"type":17,"tag":25,"props":578,"children":580},{"className":579},[],[581],{"type":22,"value":582},"false",{"type":22,"value":584}," dönüyorsa Node.js'i ",{"type":17,"tag":39,"props":586,"children":589},{"href":587,"rel":588},"https://nodejs.org/",[51],[590],{"type":22,"value":591},"nodejs.org",{"type":22,"value":593}," üzerinden ya da bir sürüm yöneticisiyle kurun.",{"type":17,"tag":18,"props":595,"children":596},{},[597,599,605],{"type":22,"value":598},"Node.js'in kendisini merak ediyorsanız ",{"type":17,"tag":39,"props":600,"children":602},{"href":601},"/posts/node-js-nedir",[603],{"type":22,"value":604},"Node.js nedir",{"type":22,"value":606}," yazısında event loop'tan HTTP sunucusuna kadar anlattım.",{"type":17,"tag":66,"props":608,"children":610},{"id":609},"tsconfigjson-temel-ayarları",[611],{"type":22,"value":612},"tsconfig.json temel ayarları",{"type":17,"tag":18,"props":614,"children":615},{},[616,621,623,629],{"type":17,"tag":25,"props":617,"children":619},{"className":618},[],[620],{"type":22,"value":62},{"type":22,"value":622},", TypeScript'e kodunuzu nasıl kontrol edip nasıl derleyeceğini söyleyen dosya. ",{"type":17,"tag":25,"props":624,"children":626},{"className":625},[],[627],{"type":22,"value":628},"npx tsc --init",{"type":22,"value":630}," TypeScript 7'de şuna benzer bir dosya üretiyor (yorum satırları çıkarılmış hali):",{"type":17,"tag":234,"props":632,"children":637},{"className":633,"code":635,"language":636,"meta":7},[634],"language-json","{\n  \"compilerOptions\": {\n    \"module\": \"nodenext\",\n    \"target\": \"esnext\",\n    \"types\": [],\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"noUncheckedIndexedAccess\": true,\n    \"exactOptionalPropertyTypes\": true,\n    \"strict\": true,\n    \"jsx\": \"react-jsx\",\n    \"verbatimModuleSyntax\": true,\n    \"isolatedModules\": true,\n    \"noUncheckedSideEffectImports\": true,\n    \"moduleDetection\": \"force\",\n    \"skipLibCheck\": true\n  }\n}\n","json",[638],{"type":17,"tag":25,"props":639,"children":640},{"__ignoreMap":7},[641],{"type":22,"value":635},{"type":17,"tag":18,"props":643,"children":644},{},[645],{"type":22,"value":646},"Bir Node.js backend'i için daha sade bir başlangıç:",{"type":17,"tag":234,"props":648,"children":651},{"className":649,"code":650,"language":636,"meta":7},[634],"{\n  \"compilerOptions\": {\n    \"target\": \"es2024\",\n    \"module\": \"nodenext\",\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"strict\": true,\n    \"types\": [\"node\"],\n    \"sourceMap\": true,\n    \"skipLibCheck\": true\n  },\n  \"include\": [\"src\"]\n}\n",[652],{"type":17,"tag":25,"props":653,"children":654},{"__ignoreMap":7},[655],{"type":22,"value":650},{"type":17,"tag":18,"props":657,"children":658},{},[659],{"type":22,"value":660},"Ayarların ne işe yaradığı:",{"type":17,"tag":662,"props":663,"children":664},"ul",{},[665,689,727,765,786,840,862],{"type":17,"tag":666,"props":667,"children":668},"li",{},[669,679,681,687],{"type":17,"tag":670,"props":671,"children":672},"strong",{},[673],{"type":17,"tag":25,"props":674,"children":676},{"className":675},[],[677],{"type":22,"value":678},"target",{"type":22,"value":680},": Çıktının hangi JavaScript sürümüne göre üretileceği. Güncel Node.js için ",{"type":17,"tag":25,"props":682,"children":684},{"className":683},[],[685],{"type":22,"value":686},"es2024",{"type":22,"value":688}," gibi yeni bir hedef seçebilirsiniz, eski tarayıcıları desteklemeniz gerekiyorsa daha eski bir hedef.",{"type":17,"tag":666,"props":690,"children":691},{},[692,701,703,709,711,717,719,725],{"type":17,"tag":670,"props":693,"children":694},{},[695],{"type":17,"tag":25,"props":696,"children":698},{"className":697},[],[699],{"type":22,"value":700},"module",{"type":22,"value":702},": Modül sistemi. Node.js projeleri için ",{"type":17,"tag":25,"props":704,"children":706},{"className":705},[],[707],{"type":22,"value":708},"nodenext",{"type":22,"value":710},", Vite gibi bir bundler kullanan frontend projeleri için genelde ",{"type":17,"tag":25,"props":712,"children":714},{"className":713},[],[715],{"type":22,"value":716},"esnext",{"type":22,"value":718}," ile birlikte ",{"type":17,"tag":25,"props":720,"children":722},{"className":721},[],[723],{"type":22,"value":724},"\"moduleResolution\": \"bundler\"",{"type":22,"value":726},".",{"type":17,"tag":666,"props":728,"children":729},{},[730,747,749,755,757,763],{"type":17,"tag":670,"props":731,"children":732},{},[733,739,741],{"type":17,"tag":25,"props":734,"children":736},{"className":735},[],[737],{"type":22,"value":738},"rootDir",{"type":22,"value":740}," ve ",{"type":17,"tag":25,"props":742,"children":744},{"className":743},[],[745],{"type":22,"value":746},"outDir",{"type":22,"value":748},": Kaynak dosyaların nerede olduğu ve derlenmiş JavaScript'in nereye yazılacağı. ",{"type":17,"tag":25,"props":750,"children":752},{"className":751},[],[753],{"type":22,"value":754},"src/index.ts",{"type":22,"value":756}," derlenince ",{"type":17,"tag":25,"props":758,"children":760},{"className":759},[],[761],{"type":22,"value":762},"dist/index.js",{"type":22,"value":764}," oluyor.",{"type":17,"tag":666,"props":766,"children":767},{},[768,777,779,784],{"type":17,"tag":670,"props":769,"children":770},{},[771],{"type":17,"tag":25,"props":772,"children":774},{"className":773},[],[775],{"type":22,"value":776},"strict",{"type":22,"value":778},": Bütün katı kontrolleri açıyor. ",{"type":17,"tag":25,"props":780,"children":782},{"className":781},[],[783],{"type":22,"value":30},{"type":22,"value":785}," kontrolü dahil yukarıdaki örneklerin çoğu bunun sayesinde çalışıyor. TypeScript 6.0'dan beri varsayılan olarak açık. Kapatmayın.",{"type":17,"tag":666,"props":787,"children":788},{},[789,798,800,806,808,814,816,822,824,830,832,838],{"type":17,"tag":670,"props":790,"children":791},{},[792],{"type":17,"tag":25,"props":793,"children":795},{"className":794},[],[796],{"type":22,"value":797},"types",{"type":22,"value":799},": Hangi ",{"type":17,"tag":25,"props":801,"children":803},{"className":802},[],[804],{"type":22,"value":805},"@types/*",{"type":22,"value":807}," paketlerinin otomatik yükleneceği. TypeScript 6.0 ile varsayılanı boş liste oldu, yani ",{"type":17,"tag":25,"props":809,"children":811},{"className":810},[],[812],{"type":22,"value":813},"@types/node",{"type":22,"value":815}," kurduysanız burada ",{"type":17,"tag":25,"props":817,"children":819},{"className":818},[],[820],{"type":22,"value":821},"\"node\"",{"type":22,"value":823}," yazmanız gerekiyor. Yazmazsanız ",{"type":17,"tag":25,"props":825,"children":827},{"className":826},[],[828],{"type":22,"value":829},"process",{"type":22,"value":831}," ya da ",{"type":17,"tag":25,"props":833,"children":835},{"className":834},[],[836],{"type":22,"value":837},"Buffer",{"type":22,"value":839}," için \"bulunamadı\" hatası alıyorsunuz.",{"type":17,"tag":666,"props":841,"children":842},{},[843,852,854,860],{"type":17,"tag":670,"props":844,"children":845},{},[846],{"type":17,"tag":25,"props":847,"children":849},{"className":848},[],[850],{"type":22,"value":851},"skipLibCheck",{"type":22,"value":853},": ",{"type":17,"tag":25,"props":855,"children":857},{"className":856},[],[858],{"type":22,"value":859},"node_modules",{"type":22,"value":861}," içindeki tip dosyalarının kontrolünü atlıyor. Derlemeyi hızlandırıyor, kendi kodunuzun kontrolünü etkilemiyor.",{"type":17,"tag":666,"props":863,"children":864},{},[865,874],{"type":17,"tag":670,"props":866,"children":867},{},[868],{"type":17,"tag":25,"props":869,"children":871},{"className":870},[],[872],{"type":22,"value":873},"sourceMap",{"type":22,"value":875},": Hata mesajlarında derlenmiş JavaScript yerine TypeScript dosyasındaki satırı görmenizi sağlıyor.",{"type":17,"tag":18,"props":877,"children":878},{},[879,885,887,893,895,901,903,909,911,917,919,925,926,932],{"type":17,"tag":25,"props":880,"children":882},{"className":881},[],[883],{"type":22,"value":884},"module: \"nodenext\"",{"type":22,"value":886}," kullanıyorsanız ",{"type":17,"tag":25,"props":888,"children":890},{"className":889},[],[891],{"type":22,"value":892},"package.json",{"type":22,"value":894}," dosyasına ",{"type":17,"tag":25,"props":896,"children":898},{"className":897},[],[899],{"type":22,"value":900},"\"type\": \"module\"",{"type":22,"value":902}," eklemeyi unutmayın. Eklemezseniz TypeScript dosyalarınızı CommonJS sayıyor ve ",{"type":17,"tag":25,"props":904,"children":906},{"className":905},[],[907],{"type":22,"value":908},"--init",{"type":22,"value":910},"'in açtığı ",{"type":17,"tag":25,"props":912,"children":914},{"className":913},[],[915],{"type":22,"value":916},"verbatimModuleSyntax",{"type":22,"value":918}," ile birlikte her ",{"type":17,"tag":25,"props":920,"children":922},{"className":921},[],[923],{"type":22,"value":924},"import",{"type":22,"value":740},{"type":17,"tag":25,"props":927,"children":929},{"className":928},[],[930],{"type":22,"value":931},"export",{"type":22,"value":933}," satırında hata veriyor.",{"type":17,"tag":66,"props":935,"children":937},{"id":936},"typescripti-neden-kullanıyorum",[938],{"type":22,"value":939},"TypeScript'i neden kullanıyorum?",{"type":17,"tag":18,"props":941,"children":942},{},[943],{"type":22,"value":944},"Küçük bir script için TypeScript gereksiz gelebilir. Fark, bir projede birden fazla kişi çalışmaya başladığında ya da kod birkaç ayı geçtiğinde ortaya çıkıyor.",{"type":17,"tag":18,"props":946,"children":947},{},[948],{"type":22,"value":949},"En çok işime yarayan şey yeniden düzenlemenin güvenli olması. Bir fonksiyonun parametresini değiştirdiğinizde onu yanlış çağıran her yer editörde kırmızıya dönüyor. JavaScript'te bunu ancak testleriniz yakalarsa öğreniyorsunuz. Bir fonksiyonun ne alıp ne döndürdüğünü de dokümana bakmadan tipinden okuyabiliyorsunuz.",{"type":17,"tag":18,"props":951,"children":952},{},[953,955,961],{"type":22,"value":954},"Backend ile frontend aynı tipleri paylaşabiliyor. Bir API'nin döndürdüğü veri için yazdığınız tipi hem NestJS servisinde hem Nuxt arayüzünde kullanabiliyorsunuz. ",{"type":17,"tag":39,"props":956,"children":958},{"href":957},"/posts/full-stack-developer-nedir",[959],{"type":22,"value":960},"Full stack",{"type":22,"value":962}," çalışırken bu, iki taraf arasındaki uyumsuzlukları daha yazarken yakalamak demek.",{"type":17,"tag":18,"props":964,"children":965},{},[966,968,975,976,983,985,992],{"type":22,"value":967},"Açık kaynak projelerimde de durum aynı. ",{"type":17,"tag":39,"props":969,"children":972},{"href":970,"rel":971},"https://github.com/halitsever/shotsnap",[51],[973],{"type":22,"value":974},"shotsnap",{"type":22,"value":740},{"type":17,"tag":39,"props":977,"children":980},{"href":978,"rel":979},"https://github.com/halitsever/temp-mail-plus-api",[51],[981],{"type":22,"value":982},"temp-mail-plus-api",{"type":22,"value":984}," TypeScript ile yazılı, ",{"type":17,"tag":39,"props":986,"children":989},{"href":987,"rel":988},"https://github.com/halitsever/random-memes",[51],[990],{"type":22,"value":991},"random-memes",{"type":22,"value":993}," JavaScript olsa da TypeScript tipleriyle birlikte geliyor. Kütüphane kullanan biri için tip dosyası otomatik tamamlama ve dokümantasyon demek.",{"type":17,"tag":18,"props":995,"children":996},{},[997],{"type":22,"value":998},"TypeScript'in de bir bedeli var: ilk başta tip hatalarıyla uğraşmak yavaşlatıyor, generic'li karmaşık tipleri okumak zaman alıyor. Bu bedel, projenin ömrü uzadıkça kendini geri ödüyor.",{"type":17,"tag":66,"props":1000,"children":1002},{"id":1001},"sık-sorulan-sorular",[1003],{"type":22,"value":1004},"Sık sorulan sorular",{"type":17,"tag":222,"props":1006,"children":1008},{"id":1007},"typescript-öğrenmek-için-önce-javascript-bilmek-gerekir-mi",[1009],{"type":22,"value":1010},"TypeScript öğrenmek için önce JavaScript bilmek gerekir mi?",{"type":17,"tag":18,"props":1012,"children":1013},{},[1014,1016,1022,1024,1030],{"type":22,"value":1015},"Evet. TypeScript JavaScript'in üzerine kurulu. Değişkenler, fonksiyonlar, nesneler ve ",{"type":17,"tag":25,"props":1017,"children":1019},{"className":1018},[],[1020],{"type":22,"value":1021},"async/await",{"type":22,"value":1023}," konularını bilmeden TypeScript öğrenmek, iki şeyi aynı anda öğrenmeye çalışmak demek. Yazılıma yeni başlıyorsanız ",{"type":17,"tag":39,"props":1025,"children":1027},{"href":1026},"/posts/yazilimci-nasil-olunur",[1028],{"type":22,"value":1029},"yazılımcı nasıl olunur",{"type":22,"value":1031}," yazısına da bakabilirsiniz.",{"type":17,"tag":222,"props":1033,"children":1035},{"id":1034},"typescript-kodu-tarayıcıda-doğrudan-çalışır-mı",[1036],{"type":22,"value":1037},"TypeScript kodu tarayıcıda doğrudan çalışır mı?",{"type":17,"tag":18,"props":1039,"children":1040},{},[1041,1043,1048],{"type":22,"value":1042},"Hayır. Tarayıcılar TypeScript'i anlamıyor. Kodu önce ",{"type":17,"tag":25,"props":1044,"children":1046},{"className":1045},[],[1047],{"type":22,"value":482},{"type":22,"value":1049}," ya da Vite gibi bir araçla JavaScript'e çevirmeniz gerekiyor. Vue, Nuxt, React gibi framework'lerin proje şablonları bunu sizin yerinize yapıyor.",{"type":17,"tag":222,"props":1051,"children":1053},{"id":1052},"typescript-performansı-etkiler-mi",[1054],{"type":22,"value":1055},"TypeScript performansı etkiler mi?",{"type":17,"tag":18,"props":1057,"children":1058},{},[1059],{"type":22,"value":1060},"Çalışma anında etkilemez, çünkü tipler derleme sırasında siliniyor ve ortaya çıkan JavaScript aynı hızda çalışıyor. Etkilediği şey derleme süresi, o da TypeScript 7 ile ciddi şekilde kısaldı.",{"type":17,"tag":222,"props":1062,"children":1064},{"id":1063},"type-mı-interface-mi-kullanmalıyım",[1065,1071,1073,1079],{"type":17,"tag":25,"props":1066,"children":1068},{"className":1067},[],[1069],{"type":22,"value":1070},"type",{"type":22,"value":1072}," mı ",{"type":17,"tag":25,"props":1074,"children":1076},{"className":1075},[],[1077],{"type":22,"value":1078},"interface",{"type":22,"value":1080}," mi kullanmalıyım?",{"type":17,"tag":18,"props":1082,"children":1083},{},[1084,1086,1091],{"type":22,"value":1085},"Nesne şekilleri için ikisi de iş görüyor. Union tipleri ve daha karmaşık tip ifadeleri için ",{"type":17,"tag":25,"props":1087,"children":1089},{"className":1088},[],[1090],{"type":22,"value":1070},{"type":22,"value":1092}," gerekiyor. Bir projede birini seçip tutarlı kullanmak, hangisini seçtiğinizden daha önemli.",{"type":17,"tag":222,"props":1094,"children":1096},{"id":1095},"any-kullanmak-kötü-mü",[1097,1103],{"type":17,"tag":25,"props":1098,"children":1100},{"className":1099},[],[1101],{"type":22,"value":1102},"any",{"type":22,"value":1104}," kullanmak kötü mü?",{"type":17,"tag":18,"props":1106,"children":1107},{},[1108,1113,1115,1121,1123,1128],{"type":17,"tag":25,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":22,"value":1102},{"type":22,"value":1114}," o değer için tip kontrolünü kapatıyor. Gerçekten bilinmeyen veri için ",{"type":17,"tag":25,"props":1116,"children":1118},{"className":1117},[],[1119],{"type":22,"value":1120},"unknown",{"type":22,"value":1122}," kullanın: TypeScript, ",{"type":17,"tag":25,"props":1124,"children":1126},{"className":1125},[],[1127],{"type":22,"value":1120},{"type":22,"value":1129}," bir değeri kontrol etmeden kullanmanıza izin vermiyor.",{"title":7,"searchDepth":1131,"depth":1131,"links":1132},2,[1133,1134,1142,1143,1144,1145],{"id":68,"depth":1131,"text":71},{"id":217,"depth":1131,"text":220,"children":1135},[1136,1138,1139,1140,1141],{"id":224,"depth":1137,"text":227},3,{"id":286,"depth":1137,"text":289},{"id":327,"depth":1137,"text":330},{"id":376,"depth":1137,"text":379},{"id":407,"depth":1137,"text":410},{"id":454,"depth":1131,"text":457},{"id":609,"depth":1131,"text":612},{"id":936,"depth":1131,"text":939},{"id":1001,"depth":1131,"text":1004,"children":1146},[1147,1148,1149,1150,1152],{"id":1007,"depth":1137,"text":1010},{"id":1034,"depth":1137,"text":1037},{"id":1052,"depth":1137,"text":1055},{"id":1063,"depth":1137,"text":1151},"type mı interface mi kullanmalıyım?",{"id":1095,"depth":1137,"text":1153},"any kullanmak kötü mü?","markdown","content:posts:typescript-nedir.md","content","posts/typescript-nedir.md","md",{"loc":4},[1161,1164,1168,1172,1176,1180,1184,1188,1191,1195,1199,1202,1206,1210,1214,1218,1222,1225,1229,1233,1237,1241,1246,1250,1254],{"_path":418,"title":1162,"description":1163,"lang":12},"API nedir? REST API, HTTP istekleri ve durum kodları","API nedir, ne işe yarar? curl ile gerçek bir API isteği, REST API nedir, HTTP metodları, durum kodları ve API'lerde kimlik doğrulama, sade bir dille.",{"_path":1165,"title":1166,"description":1167,"lang":12},"/posts/backend-nedir","Backend nedir, backend developer ne iş yapar? Frontend ile farkı","Backend nedir, backend developer ne iş yapar? Sunucu, API ve veritabanı tarafını, frontend ile farkını ve küçük bir NestJS örneğini anlatıyorum.",{"_path":1169,"title":1170,"description":1171,"lang":12},"/posts/bursa-gunubirlik-gezi-mudanya-koza-han-golyazi","Bursa günübirlik gezi: Mudanya, Koza Han, İskender ve Gölyazı","İstanbul'dan Bursa'ya günübirlik gezi: Mudanya'da kahvaltı, Koza Han, Mavi Dükkan'da Bursa iskender ve Gölyazı'daki 725 yıllık Ağlayan Çınar.",{"_path":1173,"title":1174,"description":1175},"/posts/claude-code-headless","Claude Code headless mode: claude -p in scripts and CI","How Claude Code headless mode works: claude -p, text and JSON output, permission flags, bare mode, auth tokens and running it in scripts and GitHub Actions.",{"_path":1177,"title":1178,"description":1179,"lang":12},"/posts/claude-code-nedir","Claude Code nedir, nasıl kurulur ve kullanılır?","Claude Code nedir? Anthropic'in kodlama aracının kurulumu, giriş, temel komutlar, CLAUDE.md, izin modları ve sunucuda paralel kullanımı, örneklerle.",{"_path":1181,"title":1182,"description":1183},"/posts/claude-code-skills","Claude Code skills: what they are and how to write one","Claude Code skills explained: SKILL.md and its frontmatter, where skills live, how they trigger, and how to write one step by step, with a real example.",{"_path":1185,"title":1186,"description":1187,"lang":12},"/posts/docker-nedir","Docker nedir? Image, container, kurulum ve Docker Compose","Docker nedir, ne işe yarar? Image, container, volume ve network kavramları, Ubuntu'ya Docker kurulumu ve küçük bir docker-compose.yml örneği.",{"_path":957,"title":1189,"description":1190,"lang":12},"Full stack developer nedir, ne iş yapar, nasıl olunur?","Full stack developer nedir, ne iş yapar? Frontend, backend, veritabanı ve deploy katmanları, gerçek bir stack, 2026 maaş verisi ve nasıl olunacağı.",{"_path":1192,"title":1193,"description":1194,"lang":12},"/posts/istanbul-yazilim-sirketleri","İstanbul yazılım şirketleri: nasıl seçilir ve kimler var? (2026)","İstanbul yazılım şirketleri arasında nasıl seçim yapılır? Sorulacak sorular, sözleşme ve kod sahipliği, uyarı işaretleri ve bilinen şirketlerden bir liste.",{"_path":1196,"title":1197,"description":1198},"/posts/nestjs-vs-express","NestJS vs Express: the same endpoint in both, and when to pick which","NestJS vs Express from a NestJS developer: the same API in both, testing, performance numbers from the official docs, and when to pick each.",{"_path":601,"title":1200,"description":1201,"lang":12},"Node.js nedir? Event loop, npm ve ilk HTTP sunucusu","Node.js nedir, ne işe yarar? Event loop'un sade bir anlatımı, npm, sıfırdan bir HTTP sunucusu ve Node.js'in diğer backend seçenekleri arasındaki yeri.",{"_path":1203,"title":1204,"description":1205},"/posts/nuxt-seo","Nuxt SEO: the setup I use on this site, with the real config","A practical Nuxt SEO guide from halit.org: sitemap, robots, schema.org, useSeoMeta, real 404s, prerendering, hreflang and the nofollow default in Nuxt Content.",{"_path":1207,"title":1208,"description":1209},"/posts/nuxt-vs-next","Nuxt vs Next: an honest comparison from someone who ships Nuxt","Nuxt vs Next compared on Nuxt 4.6 and Next.js 16: rendering modes, routing, data fetching, ecosystem and deployment, with code for the same page in both.",{"_path":1211,"title":1212,"description":1213,"lang":12},"/posts/prometheus-grafana-nedir","Prometheus nedir, Grafana nedir? node_exporter ile sunucu izleme","Prometheus nedir, Grafana nedir ve birlikte nasıl çalışırlar? Metrikler, exporter'lar, node_exporter, PromQL örnekleri ve Docker Compose ile kurulum.",{"_path":1215,"title":1216,"description":1217},"/posts/teleparty-alternative","Teleparty alternative: free ways to watch together online","Looking for a Teleparty alternative? An honest look at Watchbear, Discord Watch Together and Watch2Gether for watching YouTube and Netflix with friends.",{"_path":1219,"title":1220,"description":1221,"lang":12},"/posts/yazilimci-maaslari-2026","Yazılımcı maaşları 2026: kıdem, pozisyon, şehir ve çalışma düzenine göre","Yazılımcı maaşları 2026: 5.002 kişilik anketin ham verisinden hesapladığım junior, middle, senior, pozisyon, şehir ve remote maaş ortancaları.",{"_path":1026,"title":1223,"description":1224,"lang":12},"Yazılımcı nasıl olunur? Yazılım öğrenmek için pratik bir yol","Yazılımcı nasıl olunur, yazılım öğrenmeye nereden başlanır? 2012'de forumlarla başlayıp 2020'den beri profesyonel çalışan bir yazılımcının pratik planı.",{"_path":1226,"title":1227,"description":1228},"/posts/running-claude-code-on-a-server-in-parallel","How I run multiple Claude Code agents in parallel on a server","My Claude Code setup: an Ubuntu server set up with claude-code-vps, parallel agents in a tmux grid with claudegrid, and the HaltOS desktop on top.",{"_path":1230,"title":1231,"description":1232},"/posts/small-web-tools-json-to-excel-steam-deck-watchbear","Small web tools I made: JSON to Excel, Steam Deck web apps, Watchbear","A JSON to Excel converter, a generator that puts any website in Steam Deck Game Mode, and Watchbear for watching videos in sync with friends.",{"_path":1234,"title":1235,"description":1236,"lang":12},"/posts/udf-dosyasi-nasil-acilir-pdf-word-cevirme","UDF dosyası nasıl açılır, PDF'ye ve Word'e nasıl çevrilir?","UYAP'ın UDF dosyasını program kurmadan tarayıcıda açmak, PDF'ye ve Word'e çevirmek, Word ve PDF'den UDF hazırlamak. Her aracın neyi koruyup neyi kaybettiğiyle birlikte.",{"_path":1238,"title":1239,"description":1240},"/posts/i-built-a-free-chrome-extension-to-watch-any-video-in-sync-with-friends","I built a free Chrome extension to watch any video in sync with friends","Watchbear is my free Chrome extension to watch YouTube together with friends: start a room, share the link, and play, pause and seek stay in sync.",{"_path":1242,"title":1243,"description":1244,"lang":1245},"/posts/a-short-trip-to-bursa","A day trip to Bursa: Mudanya, Koza Han, Iskender and Gölyazı","A day trip to Bursa via the Osmangazi Bridge, breakfast in Mudanya, Koza Han, Mavi Dükkan Iskender, and a peaceful visit to Gölyazı.","en",{"_path":1247,"title":1248,"description":1249},"/posts/embedding-metabase-dashboard-on-nuxt-app","Embedding a Metabase dashboard in a Nuxt 3 app","Metabase embedding in Nuxt 3: sign the embed JWT in a server route, lock parameters per user, set token expiry and theme the embedded dashboard.",{"_path":1251,"title":1252,"description":1253},"/posts/grafana-deep-dive","Grafana Docker Compose setup with Prometheus and node_exporter","Monitor a server with Grafana in Docker: a docker-compose.yml for Grafana, Prometheus and node_exporter, the scrape config, and a ready-made dashboard.",{"_path":1255,"title":1256,"description":1257},"/posts/deploy-express-app-on-vercel","Deploying an Express.js application on Vercel","How to deploy an Express app on Vercel: the zero-config way, the older vercel.json setup, environment variables, logs and serverless limits.",null,1795295807540]