marius-townhouse
@marius-townhouse
Public Skills
editor-interrogation
by marius-townhouse
Use when debugging type inference. Use when types behave unexpectedly. Use when learning unfamiliar code.
ecmascript-over-typescript-features
by marius-townhouse
Use when choosing between TypeScript and ECMAScript features. Use when writing portable code. Use when considering enum or namespace. Use when targeting multiple JavaScript environments. Use when writing library code.
iterate-objects-safely
by marius-townhouse
Use when iterating over object keys and values. Use when for...in loops produce type errors. Use when Object.entries returns any types. Use when dealing with prototype pollution concerns. Use when considering Map vs object.
narrow-any-scope
by marius-townhouse
Use when any is unavoidable. Use when working with untyped libraries. Use when silencing specific type errors.
create-objects-all-at-once
by marius-townhouse
Use when building objects incrementally. Use when adding properties after creation. Use when TypeScript errors on dynamic object construction.
code-gen-independent
by marius-townhouse
Use when confused about types at runtime. Use when trying to use instanceof with interfaces. Use when type errors don't prevent JavaScript output.
precise-any-variants
by marius-townhouse
Use when forced to use any. Use when any is too broad. Use when function types need any.
export-public-types
by marius-townhouse
Use when publishing libraries. Use when types appear in public APIs. Use when users need to reference types. Use when building reusable components. Use when designing library interfaces.
avoid-anecdotal-types
by marius-townhouse
Use when creating types from example data. Use when types don't match all cases. Use when API responses vary.
avoid-repeated-params
by marius-townhouse
Use when functions have multiple parameters of same type. Use when parameter order is easy to confuse. Use when designing function signatures.
conditional-types-over-overloads
by marius-townhouse
Use when typing functions with multiple return types. Use when function behavior depends on input type. Use when dealing with union type inputs. Use when considering function overloads.
callback-this-type
by marius-townhouse
Use when callbacks use this. Use when API provides this context. Use when typing event handlers. Use when library sets this in callbacks. Use when documenting callback context.
avoid-inferable-annotations
by marius-townhouse
Use when writing type annotations on variables. Use when TypeScript can infer the type. Use when code feels cluttered with types.
limit-optional-properties
by marius-townhouse
Use when adding optional properties. Use when types have many optional fields. Use when considering required vs optional.
mirror-types
by marius-townhouse
Use when depending on external types. Use when avoiding tight coupling. Use when external types might change. Use when building adapters. Use when types are only used internally.
hide-unsafe-assertions
by marius-townhouse
Use when type assertions are necessary. Use when function implementations need any. Use when hiding unsafe code.
avoid-unnecessary-type-params
by marius-townhouse
Use when writing generic functions or types. Use when reviewing type signatures. Use when a type parameter only appears once. Use when tempted to add generics for "flexibility".
allowjs-mixing
by marius-townhouse
Use when migrating JavaScript to TypeScript. Use when gradually adopting TypeScript. Use when working with mixed codebases. Use when converting large projects. Use when teams are learning TypeScript.
avoid-numeric-index
by marius-townhouse
Use when defining array-like types. Use when tempted to use number as index type. Use when understanding array keys.
evolving-types
by marius-townhouse
Use when types change as code executes. Use when arrays are built incrementally. Use when working with any[] that narrows.
excess-property-checking
by marius-townhouse
Use when assigning object literals to typed variables. Use when confused by "unknown property" errors. Use when extra properties are flagged on object literals but not variables.
module-by-module-migration
by marius-townhouse
Use when migrating large codebases. Use when converting JavaScript to TypeScript. Use when managing dependencies. Use when planning migration order. Use when teams are adopting TypeScript.
dom-hierarchy
by marius-townhouse
Use when working with DOM APIs. Use when typing element references. Use when creating DOM utilities. Use when handling events. Use when manipulating the DOM.
domain-language-types
by marius-townhouse
Use when naming types. Use when types describe structure not meaning. Use when domain experts won't understand type names.