tsconfig-options
Know Which TypeScript Options You're Using
Overview
TypeScript's behavior depends heavily on configuration.
The same code can pass or fail type checking depending on options like noImplicitAny and strictNullChecks. Know your options to use TypeScript effectively.
When to Use This Skill
- Setting up a new TypeScript project
- Code behaves differently than expected
- Debugging type errors that others don't see
- Deciding on strictness level
The Iron Rule
ALWAYS use a tsconfig.json and enable strict mode for new projects.
More from marius-townhouse/effective-typescript-skills
precise-any-variants
Use when forced to use any. Use when any is too broad. Use when function types need any.
86narrow-any-scope
Use when any is unavoidable. Use when working with untyped libraries. Use when silencing specific type errors.
35tsdoc-comments
Use when documenting public APIs. Use when writing library code. Use when using JSDoc-style comments. Use when generating documentation. Use when explaining complex types.
34exhaustiveness-checking
Use when handling tagged unions. Use when adding new cases to discriminated unions. Use when switch statements must cover all cases.
13code-gen-independent
Use when confused about types at runtime. Use when trying to use instanceof with interfaces. Use when type errors don't prevent JavaScript output.
12exclusive-or-properties
Use when exactly one of several properties should be present. Use when modeling mutually exclusive options. Use when building component props with alternative configurations. Use when designing API parameters that have variants.
11