# Google Ts Styleguide

> Google TypeScript Style Guide reference for writing, reviewing, and refactoring TypeScript code. Use this skill whenever you are writing TypeScript code, reviewing TypeScript code, refactoring TypeScript, configuring ESLint or linter rules for TypeScript, or when the user asks about TypeScript coding conventions, naming conventions, type system best practices, or import/export patterns. Also trig…

- **Type:** Skill
- **Install:** `agentstack add skill-ysknsid25-skills-google-ts-styleguide`
- **Verified:** Pending review
- **Seller:** [ysknsid25](https://agentstack.voostack.com/s/ysknsid25)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ysknsid25](https://github.com/ysknsid25)
- **Source:** https://github.com/ysknsid25/Skills/tree/master/skills/google-ts-styleguide

## Install

```sh
agentstack add skill-ysknsid25-skills-google-ts-styleguide
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Google TypeScript Style Guide Reference

Google TypeScript Style Guide に基づくコーディングリファレンスです。TypeScriptの実装・コードレビュー・リファクタリング・ESLint設定時に、Googleのコーディング規約に準拠するために使います。

## How to use this reference

This guide is organized into topic-specific reference files. Read the relevant file based on the current task:

| Topic | File | When to read |
|-------|------|-------------|
| File structure & imports/exports | `references/source-file-structure.md` | Organizing files, import/export patterns, module structure |
| Language features | `references/language-features.md` | Variables, arrays, objects, classes, functions, control flow, decorators |
| Naming conventions | `references/naming.md` | Naming variables, classes, constants, type parameters, files |
| Type system | `references/type-system.md` | Type inference, null/undefined, any/unknown, interfaces vs types, generics |
| Comments & toolchain | `references/comments-and-toolchain.md` | JSDoc, comments, @ts-ignore rules, conformance |

## Quick Reference: Most Common Rules

These are the rules that come up most frequently. For details, read the corresponding reference file.

### Naming (see `references/naming.md`)
- Classes/Interfaces/Types/Enums: `UpperCamelCase`
- Variables/functions/methods/properties: `lowerCamelCase`
- Global constants & enum values: `CONSTANT_CASE`
- Treat acronyms as words: `loadHttpUrl`, not `loadHTTPURL`
- No `IMyInterface` prefix for interfaces
- No trailing/leading underscores for private members

### Imports & Exports (see `references/source-file-structure.md`)
- Use ES6 module syntax only (`import`/`export`), never `require`
- Use named exports exclusively; avoid default exports
- Use `import type` for type-only imports
- Do not use `namespace`; use modules
- No mutable exports (`export let` is prohibited)

### Variables & Types (see `references/language-features.md`, `references/type-system.md`)
- Use `const` by default, `let` when reassignment needed; never `var`
- Use `unknown` over `any`; avoid `any` wherever possible
- Prefer `interface` over type literal aliases
- Simple arrays: `T[]`; complex element types: `Array`
- Prefer optional (`field?`) over `| undefined`

### Functions & Classes (see `references/language-features.md`)
- Prefer function declarations for named functions
- Use arrow functions for callbacks, not function expressions
- Mark never-reassigned properties as `readonly`
- Use parameter properties in constructors
- No `#private` fields; use TypeScript's `private` keyword

### Control Flow (see `references/language-features.md`)
- Always use `===`/`!==` (exception: `== null` for null/undefined check)
- Always use braces for control statements
- Only throw `Error` instances
- All `switch` must have `default` case
- Explicitly end statements with semicolons (no ASI reliance)

### ESLint/Linter Configuration Guide

When configuring ESLint or other linters for Google TypeScript style compliance, enforce these core rules:

**Must enable:**
- `@typescript-eslint/no-explicit-any` - Discourage `any` usage
- `@typescript-eslint/explicit-module-boundary-types` - Encourage explicit return types at module boundaries
- `@typescript-eslint/no-non-null-assertion` - Discourage `!` assertions
- `eqeqeq` with `smart` option - Enforce `===`/`!==` with `== null` exception
- `no-var` - Forbid `var`
- `prefer-const` - Prefer `const` over `let` when no reassignment
- `curly` - Require braces for all control statements
- `@typescript-eslint/no-namespace` - Forbid `namespace`
- `no-eval` - Forbid `eval()`
- `no-debugger` - Forbid `debugger`
- `@typescript-eslint/no-wrapper-object-types` - Forbid `String`, `Boolean`, `Number` wrapper types
- `@typescript-eslint/consistent-type-imports` - Enforce `import type` for type-only imports
- `no-restricted-syntax` for `WithStatement` - Forbid `with`

**Naming convention rules (`@typescript-eslint/naming-convention`):**
- `UpperCamelCase` for classes, interfaces, type aliases, enums, decorators
- `lowerCamelCase` for variables, functions, methods, parameters, properties
- `CONSTANT_CASE` for global constants and enum members
- No leading/trailing underscores

**Import/export rules:**
- `no-restricted-exports` or plugin rules to forbid default exports
- `@typescript-eslint/no-require-imports` - Forbid `require()`

**Additional recommended:**
- `@typescript-eslint/prefer-for-of` - Prefer `for...of`
- `@typescript-eslint/no-unnecessary-type-assertion` - Remove unnecessary assertions
- `@typescript-eslint/prefer-optional-chain` - Prefer optional chaining
- `@typescript-eslint/prefer-readonly` - Prefer `readonly` for never-reassigned members

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ysknsid25](https://github.com/ysknsid25)
- **Source:** [ysknsid25/Skills](https://github.com/ysknsid25/Skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** yes

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ysknsid25-skills-google-ts-styleguide
- Seller: https://agentstack.voostack.com/s/ysknsid25
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
