TypeScript
https://gyazo.com/26cc95f255ccb936d154b43614f61602
JavaScriptのスーパーセット。型をつけることができる
言語を学ぶ
TypeScript in 5 minutes · TypeScript
TypeScript入門以前ガイド - mizchi's blog 2018-10-03
ES2015から
Introduction · TypeScript Deep Dive
Introduction - TypeScript Deep Dive 日本語版
翻訳は有志のものなので最新は英語原典を見ること
TypeScriptの型入門 - Qiita
言語
型
Basic Types · TypeScript
タプル
Tuple types allow you to express an array where the type of a fixed number of elements is known, but need not be the same.
Utility Types · TypeScript
型変換のための便利型
TypeScriptで型安全性を破壊する方法をまとめたリポジトリを作った
型定義ファイル
DefinitelyTyped
自分で作る
https://blog.nkzn.info/entry/2014/05/15/231849
2.0からnpm install @types/<package>で型定義をインストールできるようになった
Episode 26 – Mixed Messages: Measuring Conformance and Non-Interference in TypeScript – Misreading Chat #Misreading_Chat
DefinitelyTyped から宣言間違いを探す研究
変更点
1. 公式のドキュメントを読む
2. 日本語:vvakame - Qiita
3.4
ビルド高速化のための incremental flag
TypeScript v3.4.0-rc 変更点 - Qiita
3.5
3.6 Announcing TypeScript 3.6 RC | TypeScript
TypeScript3.6の新機能 Qiita
generatorの型がわかるようになった
3.7 Announcing TypeScript 3.7 | TypeScript November 5th, 2019
Optional Chaining
Nullish Coalescing
3.8 Announcing TypeScript 3.8 | TypeScript February 20th, 2020
Top level await
top-level await only works at the top level of a module, and files are only considered modules when TypeScript finds an import or an export.
tsconfig.json
よくある誤解
私がTypeScriptについて勘違いしていたこと、そしてその理由 | POSTD(2016年6月)
Typingsのくだりはもう古い
ESLintをつかう
TypeScriptのLint - hokaccha hamalog v3
TypeScriptのLinterはTSLintがデファクトだが、TSLintはESLintと比べて実装されているルールがだいぶ少なかったり、同じルールでも名前が違ったりする。
ESLintにやらせてしまおうという発想が生まれる
しかし、ESLintのデフォルトのパーサespreeはTypeScriptのコードをパースできない
TypeScriptのコードからESLintが解釈できるASTをつくってくれるパーサが必要
そこでhttps://github.com/eslint/typescript-eslint-parser/blob/master/README.md をつかう
生成されるASTには当然、JavaScriptには存在しない構文の情報がある(interfaceとか)ので、これをどう使うかは別途規定する必要がある
nzakas/eslint-plugin-typescript: TypeScript plugin for ESLintがよくつかわれているらしい
TypeScript + Webpack4 な素振り環境を作った - 倒れるときは前のめり。
TSでもESLintを使いたいがpluginがバギーなのでワークアラウンドを入れる
TS+ESLintでimport/no-unresolvedが出るのを無視する設定
Node.jsと使う
Node.js QuickStart · TypeScript Deep Dive(2016)
Prettier連携
ESLint(あるいはTSLint)とPrettierを併用する - ひと夏の技術
JSXをサポートしている
TypeScript supports embedding, type checking, and compiling JSX directly to JavaScript.
https://www.typescriptlang.org/docs/handbook/jsx.html
https://typescript-jp.gitbook.io/deep-dive/tsx
つらみ
なぜTypeScriptに失望してしまうのか - Islands in the byte stream
演習
TypeScriptの型演習 - Qiita
#JavaScript