Skip to content
Back to skills

Typescript Style

ASecurity

TypeScript coding style enforcement (ESLint, type safety, React patterns). Auto-loads when writing or reviewing TypeScript/JavaScript code.

  • 15 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 27, 2026
developmentjavascripttypescriptjavareactrefactoringfrontend

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add jpoutrin/product-forge --skill typescript-style --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Style?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Style
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpoutrin-typescript-style/badge)](https://www.skillsdirectory.com/skills/jpoutrin-typescript-style)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-style
description: TypeScript coding style enforcement (ESLint, type safety, React patterns). Auto-loads when writing or reviewing TypeScript/JavaScript code.
user-invocable: false
---

# TypeScript/JavaScript Style Best Practices Skill

This skill enforces TypeScript strict mode, ESLint standards, and modern patterns for frontend development.

## Core Standards

- **Strict TypeScript**: All strict flags enabled
- **ESLint**: Type-checked rules enabled
- **No `any`**: Use `unknown` or proper types
- **Explicit returns**: All functions typed

## Naming Conventions

```typescript
// Types/Interfaces: PascalCase
interface UserProfile { }

// Functions/variables: camelCase
function calculateTotal() { }
const userName = "john";

// Booleans: is/has/can/should prefix
const isLoading = true;
const hasPermission = false;
```

## Type Definitions

```typescript
// Prefer union types over enums
type Status = "pending" | "active" | "completed";

// Use as const for constant objects
const HttpStatus = {
  Ok: 200,
  NotFound: 404,
} as const;

// Discriminated unions
type Result<T> =
  | { success: true; data: T }
  | { success: false; error: Error };
```

## React Patterns

```typescript
// Typed props
interface ButtonProps {
  label: string;
  onClick: () => void;
  disabled?: boolean;
}

// Typed hooks
const [isOpen, setIsOpen] = useState(false);

// Typed event handlers
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {};
```

## Function Length Guidelines

- **< 30 lines**: Ideal
- **30-50 lines**: Review for refactoring
- **> 50 lines**: Must be broken down

## Anti-Patterns to Avoid

- Using `any` type
- Missing return types
- Using `==` instead of `===`
- Unhandled promises
- Magic numbers/strings
- Vague variable/function names

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.