TypeScript
TS Handbook and this article are great intros.
Notes
TypeScript can figure the return type out by looking at the return statements, so we can also optionally leave this off in many cases
You really shouldn’t use arrow function as class members. Arrow functions are duplicated in memory for each class instance, while proper method members are written once in your class’s prototype and shared between all instances.
any
means “ignore the type”,unknown
means “we don’t know the type”, which aren’t the same thing, and for better code you’d rather not know the type than ignore it.You can’t use
unknown
as a simple replacement forany
, that wouldn’t make sense.unkwnown
carries the implication that you should not use this variable other than passing it around. Or testing its type to get rid of the “unknown” state.
Links
StREST - Set up tests for REST in seconds with YAML.
Fork TS Checker Webpack Plugin - Webpack plugin that runs typescript type checker on a separate process.
Tsickle - TypeScript to Closure Translator.
TypeSearch - Search for TS types.
TypeScript ESLint - Monorepo for all the tooling which enables ESLint to support TypeScript.
ts-node-dev - Restarts target node process when any of required files changes (as standard node-dev) but shares Typescript compilation process between restarts.
dtslint - Tests a TypeScript declaration file for style and correctness.
SonarTS - Static code analyzer for TypeScript.
TypeScript Guidelines - Guideline to focus on how to write effective TypeScript with minimal effort.
typescript-json-schema - Generate json-schemas from your Typescript sources.
tslint-config-security - TSLint security rules.
Conditional Type Checks - Types for testing TypeScript types.
quicktype - Generate types and converters from JSON, Schema, and GraphQL.
Last updated
Was this helpful?