typescript-naming
БесплатноБез исполняемых скриптовНе проверенApply, review, and explain TypeScript naming conventions. Use automatically for tasks involving exports, identifiers, generic type parameters, acronyms, React…
от mkosir★ 789 звёзд на GitHubОб этом скилле
Naming
Apply the TypeScript Style Guide's naming conventions in the context of the current task.
Workflow
- Inspect the consuming repository's conventions and configuration.
- Let explicit repository conventions take precedence over this opinionated guidance.
- Apply, review, or explain only the guidance relevant to the task.
- State important tradeoffs when the appropriate name or documentation depends on context or judgment.
Boundaries
- Keep ESLint and other tooling responsible for checks they can enforce automatically.
- Do not introduce unrelated TypeScript Style Guide conventions merely because this skill is active.
Related Guidance
Type-Safe Constants With Satisfies
For detailed guidance on validating constants against existing types, use typescript-types when it is available.
Naming
Strive to keep naming conventions consistent and readable, with important context provided, because another person will maintain the code you have written.
Named Export
<Rule prefix="Named exports must be used to ensure that all imports follow a uniform pattern" href="https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md"
{
export default [ { rules: { 'import/no-default-export': 'error' }, }, // In case of exceptions disable the rule { files: ['src/pages/**/*'], rules: { 'import/no-default-export': 'off' }, }, ];}
This keeps variable and function names consistent across the entire codebase. Named exports have the benefit of erroring when import statements try to import something that hasn't been declared.
Naming Conventions
While it's often hard to find the best name, aim to optimize code for consistency and future readers by following these conventions:
Variables {#variables-1}
Locals
Camel caseproducts,productsFilteredBooleans
Prefixed withis,hasetc.
isDisabled,hasProduct{`'@typescript-eslint/naming-convention': [ 'error', { selector: 'variable', types: ['boolean'], format: ['PascalCase'], prefix: ['is', 'are', 'should', 'has', 'can', 'did', 'will'], } ] `} Constants
Capitalizedconst FEATURED_PRODUCT_ID = '8f47d2a1-b13e-4d5a-a7d8-6ef1234';Object & Array Constants
Singular, capitalized with const assertion.
const IDLE_ORDER = { pending: 'idle', fulfilled: true, error: 'Shipping Error', } as const; const DASHBOARD_ACCESS_ROLES = ['admin', 'editor', 'moderator'] as const;If a type exists, use Type-Safe Constants With Satisfies.
// Type OrderStatus is predefined (e.g. generated from database schema, API) type OrderStatus = { pending: 'pending' | 'idle'; fulfilled: boolean; error: string; }; const IDLE_ORDER = { pending: 'idle', fulfilled: true, error: 'Shipping Error', } as const satisfies OrderStatus; // Type UserRole is predefined type UserRole = 'admin' | 'editor' | 'moderator' | 'viewer' | 'guest'; const DASHBOARD_ACCESS_ROLES = ['admin', 'editor', 'moderator'] as const satisfies ReadonlyArray<UserRole>;
Functions {#functions-1}
Camel casefilterProductsByType, formatCurrency
Types {#types-1}
Pascal caseOrderStatus, ProductItem
Generics
A generic type parameter must start with the capital letter T followed by a descriptive name TRequest, TFooBar.
Key reasons and benefits:
- Complex types often involve generics, for which clear naming improves readability and maintainability.
- Single-letter generics like
T,K, andUare disallowed. The more parameters we introduce, the easier it is to mistake them. - Prefixing with
Tmakes it immediately obvious that it's a generic type parameter, not a regular type. - A common scenario is when a generic parameter shadows an existing type because it has the same name, e.g.
<Request extends Request>.
// ❌ Avoid naming generic parameters with one letter
const createPair = <T, K extends string>(first: T, second: K): [T, K] => {
return [first,
Установить typescript-naming в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл typescript-naming?
Apply, review, and explain TypeScript naming conventions. Use automatically for tasks involving exports, identifiers, generic type parameters, acronyms, React props and handlers, hooks, comments, or TSDoc.
Как установить скилл typescript-naming?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл typescript-naming запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
patterns
Find patterns worth sharing from recent PRs and repo history, both repeats to fix and good practices worth spreading. Use when a champion wants to know what…
от Anthropiccopilot-cli-quickstart
Use this skill when someone wants to learn GitHub Copilot CLI from scratch. Offers interactive step-by-step tutorials with separate Developer and…
от GitHubvardoger-analyze
Use when the user asks to personalize the GitHub Copilot CLI assistant, adapt Copilot to their style, use vardoger, or analyze their Copilot CLI conversation…
от GitHubpolicy-lookup
Find and explain company policies in plain language. Trigger with "what's our PTO policy", "can I work remotely from another country", "how do expenses work"…
от Anthropic