Source

marius-townhouse/effective-typescript-skills

83 skills · 2.9K combined installs

Skills from this source

#
Skill
Source
8W Activity
Installs
1
context-type-inference Use when extracting values causes type errors. Use when callback types are wrong. Use when const assertions are neede…
marius-townhouse/effective-typescript-skills
31
2
create-objects-all-at-once Use when building objects incrementally. Use when adding properties after creation. Use when TypeScript errors on dyn…
marius-townhouse/effective-typescript-skills
31
3
different-variables-types Use when tempted to reuse variables. Use when variable changes type. Use when using union types for multiple purposes.
marius-townhouse/effective-typescript-skills
31
4
distinct-special-values Use when tempted to use -1 or "" as special values. Use when indexOf returns -1. Use when special cases need represen…
marius-townhouse/effective-typescript-skills
31
5
function-type-expressions Use when writing multiple functions with same signature. Use when implementing callbacks. Use when matching existing …
marius-townhouse/effective-typescript-skills
31
6
functional-constructs-types Use when building arrays in loops. Use when types don't flow through code. Use when considering map/filter/reduce.
marius-townhouse/effective-typescript-skills
31
7
generics-as-functions Use when defining generic types or functions. Use when constraining type parameters. Use when writing type-level code…
marius-townhouse/effective-typescript-skills
31
8
index-signature-alternatives Use when defining object types with dynamic keys. Use when tempted to use index signatures. Use when parsing CSV or J…
marius-townhouse/effective-typescript-skills
31
9
mirror-types Use when depending on external types. Use when avoiding tight coupling. Use when external types might change. Use whe…
marius-townhouse/effective-typescript-skills
31
10
module-augmentation Use when extending third-party types. Use when adding properties to existing interfaces. Use when plugins extend core…
marius-townhouse/effective-typescript-skills
31
11
no-null-in-aliases Use when defining type aliases. Use when null/undefined appears in type definitions. Use when types are confusing.
marius-townhouse/effective-typescript-skills
31
12
no-type-in-docs Use when writing comments about types. Use when documenting function parameters. Use when naming variables.
marius-townhouse/effective-typescript-skills
31
13
noimplicitany-completion Use when finishing TypeScript migration. Use when enabling strict mode. Use when finalizing tsconfig. Use when ensuri…
marius-townhouse/effective-typescript-skills
31
14
record-types-sync Use when properties need synchronized configuration. Use when adding new properties requires updates elsewhere. Use w…
marius-townhouse/effective-typescript-skills
31
15
source-maps-debugging Use when debugging TypeScript in browser. Use when setting up build tools. Use when stack traces show compiled code. …
marius-townhouse/effective-typescript-skills
31
16
tail-recursive-generics Use when getting "Type instantiation is excessively deep" errors. Use when writing recursive generic types. Use when …
marius-townhouse/effective-typescript-skills
31
17
template-literal-types Use when modeling structured string patterns. Use when parsing DSLs like CSS selectors. Use when transforming string …
marius-townhouse/effective-typescript-skills
31
18
test-your-types Use when writing type declarations. Use when authoring libraries. Use when refactoring type utilities. Use when types…
marius-townhouse/effective-typescript-skills
31
19
three-versions-types Use when publishing type declarations. Use when dealing with version conflicts. Use when libraries have types. Use wh…
marius-townhouse/effective-typescript-skills
31
20
ts-js-relationship Use when confused about TypeScript vs JavaScript. Use when migrating JS to TS. Use when explaining TypeScript to newc…
marius-townhouse/effective-typescript-skills
31
21
type-coverage Use when measuring type safety. Use when any types creep in. Use when migrating from JavaScript.
marius-townhouse/effective-typescript-skills
31
22
type-display-attention Use when complex types display poorly in IDE. Use when users see ugly type expansions. Use when debugging type issues…
marius-townhouse/effective-typescript-skills
31
23
type-value-space Use when symbols are ambiguous. Use when class or typeof behaves unexpectedly. Use when destructuring fails.
marius-townhouse/effective-typescript-skills
31
24
types-as-sets Use when reasoning about type relationships. Use when confused by union or intersection types. Use when extends feels…
marius-townhouse/effective-typescript-skills
31
25
understand-type-widening Use when confused why TypeScript infers general types. Use when const vs let gives different types. Use when literals…
marius-townhouse/effective-typescript-skills
31
26
variadic-tuple-types Use when functions accept variable arguments. Use when typing rest parameters with specific constraints. Use when bui…
marius-townhouse/effective-typescript-skills
31
27
async-over-callbacks Use when writing asynchronous code. Use when tempted to use callbacks. Use when composing multiple async operations.
marius-townhouse/effective-typescript-skills
30
28
avoid-numeric-index Use when defining array-like types. Use when tempted to use number as index type. Use when understanding array keys.
marius-townhouse/effective-typescript-skills
30
29
avoid-repeated-params Use when functions have multiple parameters of same type. Use when parameter order is easy to confuse. Use when desig…
marius-townhouse/effective-typescript-skills
30
30
avoid-unnecessary-type-params Use when writing generic functions or types. Use when reviewing type signatures. Use when a type parameter only appea…
marius-townhouse/effective-typescript-skills
30
31
control-union-distribution Use when conditional types behave unexpectedly with unions. Use when boolean or never types cause surprises. Use when…
marius-townhouse/effective-typescript-skills
30
32
avoid-anecdotal-types Use when creating types from example data. Use when types don't match all cases. Use when API responses vary.
marius-townhouse/effective-typescript-skills
29
33
avoid-inferable-annotations Use when writing type annotations on variables. Use when TypeScript can infer the type. Use when code feels cluttered…
marius-townhouse/effective-typescript-skills
29
Page 2 · 83 total Previous