Introduces two new resource types (hooks, claude-md) with full CRUD, visual hook config editor, section-delimited CLAUDE.md installs, uninstall endpoints, and shell injection hardening in sync scripts.
39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
---
|
|
name: TypeScript Strict
|
|
description: Enforce strict TypeScript patterns and conventions for all TS/TSX files.
|
|
paths: src/**/*.ts, src/**/*.tsx
|
|
tags: typescript, conventions
|
|
author: Alejandro Martinez
|
|
author-email: amartinez2@certinia.com
|
|
---
|
|
|
|
# TypeScript Strict Rules
|
|
|
|
When working with TypeScript files, always follow these conventions:
|
|
|
|
## Type Safety
|
|
|
|
- Never use `any` — prefer `unknown` with type narrowing
|
|
- Always define return types for exported functions
|
|
- Use `readonly` for arrays and objects that shouldn't be mutated
|
|
- Prefer `interface` over `type` for object shapes (except unions/intersections)
|
|
|
|
## Imports
|
|
|
|
- Use named imports, not default imports
|
|
- Group imports: external libs, then internal modules, then relative paths
|
|
- No circular dependencies
|
|
|
|
## Naming
|
|
|
|
- `camelCase` for variables and functions
|
|
- `PascalCase` for types, interfaces, and classes
|
|
- `SCREAMING_SNAKE_CASE` for constants
|
|
- Prefix boolean variables with `is`, `has`, `should`, `can`
|
|
|
|
## Error Handling
|
|
|
|
- Never swallow errors silently (empty catch blocks)
|
|
- Use custom error classes for domain errors
|
|
- Always type error parameters in catch blocks
|