typescript-coding-convention

A set of rules for writing TypeScript code, including naming, syntax, and identifier conventions. TypeScript is JavaScript with features that help describe and check data types before the code runs.

In plain words
What is it for?
Use it as a reference when naming classes, functions, variables, types, constants, and test methods in TypeScript projects.
Why use it?
It gives a team consistent code patterns, making files easier to read, review, and maintain.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/yu-iskw/skill-inspector/typescript-coding-convention
Clone the repo
git clone --depth 1 https://github.com/yu-iskw/skill-inspector

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,499 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03499
Opus 5 $0.00000 $0.01750
Sonnet 5 $0.00000 $0.00700
Haiku 4.5 $0.00000 $0.00350

Measured 2d ago against content hash 7a3ad22d8a9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typescript-coding-convention scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/typescript-coding-convention.mdc · 281 lines

How it starts

The opening of the file, as written. The whole thing — 281 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TypeScript Style Guide

This guide outlines the default-standard coding conventions for TypeScript, based on the Google TypeScript Style Guide, supplemented with best practices from other widely-used TypeScript style guides.

1. Syntax

1.1. Identifiers

Identifiers must use only ASCII letters, digits, underscores (for constants and structured test method names), and the '$' sign.

Style Category
UpperCamelCase class / interface / type / enum / decorator / type / parameters
lowerCamelCase variable / parameter / function / method / property / module alias
CONSTANT_CASE global constant values, including enum values
  • Abbreviations: Treat abbreviations like acronyms as whole words (e.g., loadHttpUrl, not loadHTTPURL).
  • Dollar sign: Avoid using $ in identifiers, except when aligning with third-party framework conventions (e.g., jquery).
  • Type parameters: May use a single upper case character (T) or UpperCamelCase.
  • Test names: Test method names may be structured with _ separators (e.g., testX_whenY_doesZ()).
  • _ prefix/suffix: Do not use _ as a prefix or suffix, or as an identifier by itself.

1.2. Aliases

When aliasing an existing symbol, use the format of the existing identifier. For variables, use const, and for class fields, use readonly.

1.3. Naming Style

Names should not be decorated with information already included in the type.

  • Do not use trailing or leading underscores for private properties or methods.
  • Do not use the opt_ prefix for optional parameters.
  • Do not prefix interfaces with I (e.g., IUser should be User).
  • Prefix booleans with is or has for clarity (e.g., isLoggedIn, hasPermission).

1.4. File Encoding

For non-ASCII characters, use the actual Unicode character (e.g., ). For non-printable characters, the equivalent hex or Unicode escapes (e.g., \u221e) can be used along with an explanatory comment.

Read the full file on GitHub · 281 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 281 lines · 3,499 tokens per session scan A 7a3ad22d8a9c

Subscribe to this mod's changes

typescript-coding-convention is a cursor rule published in the GitHub repository yu-iskw/skill-inspector (2 stars, last pushed 17d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,499 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.