Source

marius-townhouse/effective-typescript-skills

83 skills · 2.9K combined installs

Skills from this source

#
Skill
Source
8W Activity
Installs
1
precise-any-variants Use when forced to use any. Use when any is too broad. Use when function types need any.
marius-townhouse/effective-typescript-skills
135
2
tsdoc-comments Use when documenting public APIs. Use when writing library code. Use when using JSDoc-style comments. Use when genera…
marius-townhouse/effective-typescript-skills
75
3
narrow-any-scope Use when any is unavoidable. Use when working with untyped libraries. Use when silencing specific type errors.
marius-townhouse/effective-typescript-skills
72
4
prefer-unknown-over-any Use when receiving values of unknown type. Use when parsing JSON. Use when working with external data. Use instead of…
marius-townhouse/effective-typescript-skills
41
5
tsconfig-options Use when setting up a TypeScript project. Use when confused by type checking behavior. Use when strict mode causes un…
marius-townhouse/effective-typescript-skills
41
6
type-narrowing Use when working with union types. Use when handling nullable values. Use when TypeScript says a value might be undef…
marius-townhouse/effective-typescript-skills
41
7
exhaustiveness-checking Use when handling tagged unions. Use when adding new cases to discriminated unions. Use when switch statements must c…
marius-townhouse/effective-typescript-skills
39
8
prefer-type-annotations Use when assigning values to variables with types. Use when tempted to use type assertions. Use when TypeScript flags…
marius-townhouse/effective-typescript-skills
37
9
code-gen-independent Use when confused about types at runtime. Use when trying to use instanceof with interfaces. Use when type errors don…
marius-townhouse/effective-typescript-skills
36
10
limit-any-type Use when tempted to use any type. Use when getting type errors that seem hard to fix. Use when migrating JavaScript t…
marius-townhouse/effective-typescript-skills
36
11
tagged-unions Use when modeling states or variants. Use when interface has union properties. Use when different states have differe…
marius-townhouse/effective-typescript-skills
35
12
exclusive-or-properties Use when exactly one of several properties should be present. Use when modeling mutually exclusive options. Use when …
marius-townhouse/effective-typescript-skills
34
13
module-by-module-migration Use when migrating large codebases. Use when converting JavaScript to TypeScript. Use when managing dependencies. Use…
marius-townhouse/effective-typescript-skills
34
14
branded-types Use when primitive types need semantic distinction. Use when string or number types have different meanings. Use when…
marius-townhouse/effective-typescript-skills
33
15
codegen-over-complex-types Use when types become extremely complex. Use when types mirror external schemas. Use when maintaining type-to-schema …
marius-townhouse/effective-typescript-skills
33
16
domain-language-types Use when naming types. Use when types describe structure not meaning. Use when domain experts won't understand type n…
marius-townhouse/effective-typescript-skills
33
17
dry-types Use when duplicating type definitions. Use when interfaces share common fields. Use when types can be derived from ot…
marius-townhouse/effective-typescript-skills
33
18
editor-interrogation Use when debugging type inference. Use when types behave unexpectedly. Use when learning unfamiliar code.
marius-townhouse/effective-typescript-skills
33
19
excess-property-checking Use when assigning object literals to typed variables. Use when confused by "unknown property" errors. Use when extra…
marius-townhouse/effective-typescript-skills
33
20
hide-unsafe-assertions Use when type assertions are necessary. Use when function implementations need any. Use when hiding unsafe code.
marius-townhouse/effective-typescript-skills
33
21
iterate-objects-safely Use when iterating over object keys and values. Use when for...in loops produce type errors. Use when Object.entries …
marius-townhouse/effective-typescript-skills
33
22
limit-optional-properties Use when adding optional properties. Use when types have many optional fields. Use when considering required vs optio…
marius-townhouse/effective-typescript-skills
33
23
use-readonly Use when passing arrays or objects to functions. Use when mutation bugs occur. Use when wanting to signal that data s…
marius-townhouse/effective-typescript-skills
33
24
valid-state-types Use when designing types that represent state. Use when types allow invalid combinations. Use when state has implicit…
marius-townhouse/effective-typescript-skills
33
25
write-modern-javascript Use when writing TypeScript that compiles to JavaScript. Use when configuring tsconfig target. Use when choosing lang…
marius-townhouse/effective-typescript-skills
33
26
allowjs-mixing Use when migrating JavaScript to TypeScript. Use when gradually adopting TypeScript. Use when working with mixed code…
marius-townhouse/effective-typescript-skills
32
27
callback-this-type Use when callbacks use this. Use when API provides this context. Use when typing event handlers. Use when library set…
marius-townhouse/effective-typescript-skills
32
28
compiler-performance Use when build times are slow. Use when optimizing TypeScript projects. Use when configuring project references. Use …
marius-townhouse/effective-typescript-skills
32
29
currying-inference Use when generic types aren't inferred. Use when builder patterns need better types. Use when creating new inference …
marius-townhouse/effective-typescript-skills
32
30
dom-hierarchy Use when working with DOM APIs. Use when typing element references. Use when creating DOM utilities. Use when handlin…
marius-townhouse/effective-typescript-skills
32
31
ecmascript-over-typescript-features Use when choosing between TypeScript and ECMAScript features. Use when writing portable code. Use when considering en…
marius-townhouse/effective-typescript-skills
32
32
evolving-types Use when types change as code executes. Use when arrays are built incrementally. Use when working with any[] that nar…
marius-townhouse/effective-typescript-skills
32
33
export-public-types Use when publishing libraries. Use when types appear in public APIs. Use when users need to reference types. Use when…
marius-townhouse/effective-typescript-skills
32
34
imprecise-over-inaccurate Use when types become too complex. Use when precision causes false positives. Use when accuracy is uncertain.
marius-townhouse/effective-typescript-skills
32
35
liberal-accept-strict-return Use when designing function signatures. Use when creating APIs. Use when parameters have optional fields but return t…
marius-townhouse/effective-typescript-skills
32
36
precise-string-types Use when working with string-typed properties. Use when string values have a limited set of options. Use when keyof c…
marius-townhouse/effective-typescript-skills
32
37
push-null-to-perimeter Use when designing data structures with nullable values. Use when null checking is scattered throughout code. Use whe…
marius-townhouse/effective-typescript-skills
32
38
runtime-type-reconstruction Use when validating data at runtime. Use when parsing JSON. Use when types need runtime checks. Use when using io-ts …
marius-townhouse/effective-typescript-skills
32
39
soundness-traps Use when types don't match runtime values. Use when TypeScript misses errors. Use when understanding type system limi…
marius-townhouse/effective-typescript-skills
32
40
structural-typing Use when surprised by TypeScript accepting unexpected values. Use when designing function parameters. Use when testin…
marius-townhouse/effective-typescript-skills
32
41
ts-check-jsdoc-experiment Use when experimenting with TypeScript. Use when migrating JavaScript gradually. Use when adding types to JS files. U…
marius-townhouse/effective-typescript-skills
32
42
type-checking-vs-testing Use when deciding between types and tests. Use when catching logic errors. Use when testing edge cases. Use when buil…
marius-townhouse/effective-typescript-skills
32
43
type-safe-monkey-patching Use when adding properties to window, document, or DOM elements. Use when extending built-in objects at runtime. Use …
marius-townhouse/effective-typescript-skills
32
44
type-vs-interface Use when defining object types. Use when choosing between type and interface. Use when extending types.
marius-townhouse/effective-typescript-skills
32
45
typescript-devdependencies Use when setting up TypeScript projects. Use when installing @types packages. Use when configuring package.json. Use …
marius-townhouse/effective-typescript-skills
32
46
unify-types Use when similar types have minor differences. Use when union types become complex. Use when choosing between modelin…
marius-townhouse/effective-typescript-skills
32
47
accurate-environment-model Use when defining global types. Use when augmenting window. Use when typing environment variables. Use when working w…
marius-townhouse/effective-typescript-skills
31
48
avoid-wrapper-types Use when typing primitives. Use when tempted to use String, Number, Boolean. Use when wrapper types appear in errors.
marius-townhouse/effective-typescript-skills
31
49
conditional-types-over-overloads Use when typing functions with multiple return types. Use when function behavior depends on input type. Use when deal…
marius-townhouse/effective-typescript-skills
31
50
consistent-aliases Use when narrowing doesn't work as expected. Use when using variables for object properties. Use when refinements are…
marius-townhouse/effective-typescript-skills
31
Page 1 · 83 total Next