typescript-best-practices

Solid

Enforces TypeScript best practices and modern patterns

Testing & QA 1,177 stars 108 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 97/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
55
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# TypeScript Best Practices ## When to Use Use this skill when: - Writing new TypeScript code - Reviewing TypeScript pull requests - Refactoring JavaScript to TypeScript ## Triggers Activated when editing `.ts` or `.tsx` files in the project. ## Rules ### Always - Always use `const` for variables that won't be reassigned - Always use explicit return types on exported functions - Always prefer `interface` over `type` for object shapes ### Never - Never use `any` — use `unknown` instead - Never use `var` — use `const` or `let` - Never ignore TypeScript errors with `@ts-ignore` ## Examples ```typescript // Good: explicit return type export function calculateTotal(items: Item[]): number { return items.reduce((sum, item) => sum + item.price, 0); } ``` ```typescript // Good: discriminated union type Result<T> = | { success: true; data: T } | { success: false; error: Error }; ``` ## Boundaries - Do not modify `tsconfig.json` without explicit permission - Do not add new dependencies without checking existing utilities - Focus only on TypeScript patterns, not runtime behavior

Details

Author
rohitg00
Repository
rohitg00/skillkit
Created
4 months ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Listed

typescript-dev

TypeScript development best practices, code quality tools, and documentation templates. Activated when working with .ts, .tsx files or TypeScript projects.

335 Updated today
aiskillstore
Data & Documents Listed

typescript-best-practices

Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation. Must use when reading or writing TypeScript/JavaScript files.

335 Updated today
aiskillstore
AI & Automation Listed

strict-typescript-mode

Enforces TypeScript best practices when writing code. Automatically enables strict typing for TypeScript projects, prevents `any` usage, and recommends generic constraints. Activate on TS/TSX files, new features, code reviews.

8 Updated today
freitasp1
Code & Development Listed

better-typescript

Apply this skill for any task involving TypeScript: writing new code, refactoring, reviewing, debugging, designing types, structuring modules, or answering questions about TS patterns. Use it whenever the user mentions TypeScript, .ts/.tsx files, types, interfaces, generics, or any TS ecosystem (Node, Deno, Bun, React, Next.js, tRPC, Zod, etc.) — even if the question seems simple.

0 Updated 6 days ago
josbert-m
Code & Development Listed

typescript-strict-guard

Use when writing or reviewing TypeScript code. Enforces strict mode standards, explicit typing, and best practices. Prevents 'any' types, @ts-ignore comments, and non-null assertions. This is a COMPREHENSIVE skill - consult the detailed guides before writing any TypeScript code.

335 Updated today
aiskillstore