typescript
Skill15 starsChanged 9 months agoMITView on GitHub
Google's official TypeScript style guide. Covers strict mode, type annotations, interfaces vs types, null handling, naming conventions, imports, and common mistakes. Enforces explicit return types, readonly properties, and avoidance of any/non-null assertions.
66 other projects use a version of this.
Adopted by
Most recently taken up by
- bbartling/open-fddtheir own version, first seen Nov 9, 2026
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
- lobehub/lobehubtheir own version, first seen Nov 5, 2026
- its-ash/skillstheir own version, first seen Nov 1, 2026
- sentimony/skillstheir own version, first seen Nov 1, 2026
- thongdn-it/react-agent-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use msw, rust and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
thongdn-itSkillmsw
MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.
Also in 3 projects that use this
MicrosoftSkillrust
Use this guide when working on Rust changes in the FAST monorepo.
Also in 9 projects that use this
SupabaseSkillreact-hook-form
Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,
Also in 3 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 10 projects that use this
leonaaardobSkilldrizzle
Complete Drizzle ORM documentation in markdown format. Use when working with Drizzle ORM - covers schema definition, queries, migrations, database connections (PostgreSQL, MySQL, SQLite), integrations (Neon, Supabase, PlanetScale, Cloudflare D1, Turso), column types, relations, transactions, and framework usage (Next.js, SvelteKit, Astro).
Also in 3 projects that use this
thongdn-itSkilltailwind
Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.
Also in 5 projects that use this
- +1 more from thongdn-it
Other versions66 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 66
- lobehub/lobe-chat★ 84ksame name
- lobehub/lobehub★ 84ksame name
- recharts/recharts★ 28ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- scalar/scalar★ 16ksame name
- prowler-cloud/prowler★ 15ksame name
- microsoft/fast★ 9.7ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
56 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- angularjsSkill
- common-lispSkill
- cppSkill
- csharpSkill
- goSkill
- html-cssSkill
- javascriptSkill
- javaSkill
- jsonSkill
- markdownSkill
- objective-cSkill
- pythonSkill
- rSkill
- shellSkill
- google-styleguides-skillsSkill
- swiftSkill
- vim-scriptSkill
The file
Files
Google TypeScript Style Guide
Official Google TypeScript coding standards for consistent, maintainable code.
Golden Rules
- Use TypeScript strictly — enable
strictmode intsconfig.json - Prefer interfaces over type aliases for object shapes
- Never use
any— useunknownwhen type is truly unknown - Use
constby default,letwhen reassignment needed, nevervar - Avoid non-null assertions (
!) — handle nullability explicitly - Use explicit return types on public functions and methods
- Prefer
readonlyfor properties that should not change
Quick Reference
Naming Conventions
| Element | Convention | Example |
| Classes/Interfaces | UpperCamelCase | UserService, User |
| Functions/Methods | lowerCamelCase | getUserById |
| Variables | lowerCamelCase | userCount |
| Constants | UPPER_SNAKE_CASE | MAX_SIZE |
| Enums | UpperCamelCase | Direction |
| Enum members | UPPER_SNAKE_CASE or UpperCamelCase | Direction.UP or Status.Active |
| Files | lower-kebab-case | user-service.ts |
| Test files | lower-kebab-case_test | user-service_test.ts |
Type System
// ✓ CORRECT - interfaces for object shapes
interface User {
id: number;
name: string;
}
// ✓ CORRECT - type aliases for unions
type StringOrNumber = string | number;
// ✗ INCORRECT - avoid any
const data: any = fetchData();
// ✓ CORRECT - use unknown and narrow
const data: unknown = fetchData();
if (typeof data === 'string') {
console.log(data.toUpperCase());
}Null Handling
// ✓ CORRECT - explicit nullability
function getUser(id: number): User | undefined {
return users.find(u => u.id === id);
}
const user = getUser(1);
if (user !== undefined) {
console.log(user.name);
}
// ✗ INCORRECT - non-null assertion
const user = getUser(1)!;Functions
// ✓ CORRECT - explicit return types for public API
function add(a: number, b: number): number {
return a + b;
}
// ✓ CORRECT - arrow functions for callbacks
const double = (x: number): number => x * 2;
// ✓ CORRECT - optional parameters with defaults
function greet(name: string, greeting = 'Hello'): string {
return `${greeting}, ${name}!`;
}Imports
// ✓ CORRECT - named exports
export function myFunction() { /* ... */ }
export interface MyInterface { id: number; }
// ✓ CORRECT - type-only imports
import type { MyInterface } from './types';
import { myFunction } from './my-module';
// ✗ INCORRECT - wildcard imports
import * as everything from './module';Common Mistakes
| Mistake | Correct Approach |
Using any type | Use unknown + type narrowing |
Non-null assertion ! | Check for null explicitly |
var declarations | Use const / let |
| Missing return types | Add explicit return types |
| Wildcard imports | Use named imports |
| Mutable class properties | Use readonly when appropriate |
| Type aliases for objects | Use interfaces instead |
tsconfig.json Recommended Settings
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}When to Use This Guide
- Writing new TypeScript code
- Refactoring existing TypeScript
- Code reviews
- Setting up linting rules
- Onboarding new team members
Install
npx skills add testdino-hq/google-styleguides-skills/typescriptFull Guide
See typescript.md for complete details, examples, and edge cases.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

