Borrowing it
Nothing to install: this file belongs to reliverse/experiments. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/reliverse/experiments/main/.cursor/deprecated/ts-coding-rules.mdcgit clone --depth 1 https://github.com/reliverse/experimentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/reliverse/experiments/ts-coding-rules)<a href="https://agentmods.dev/rules/reliverse/experiments/ts-coding-rules"><img src="https://agentmods.dev/badge/rules/reliverse/experiments/ts-coding-rules/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/reliverse/experiments/ts-coding-rules"><img src="https://agentmods.dev/badge/rules/reliverse/experiments/ts-coding-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02735 | $0.02735 |
| Opus 5.5 | $0.01094 | $0.01094 |
| Sonnet 5.5 | $0.00547 | $0.00547 |
| Haiku 4.5 | $0.00274 | $0.00274 |
Grade A, and why
ts-coding-rules 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Project Context
The current codebase enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
Key Principles
- Strictly speak in English
- Never produce in code non-English text
- Zero configuration required
- Subsecond performance
- Maximum type safety
- AI-friendly code generation
Before Writing Code
- Analyze existing patterns in the codebase
- Consider edge cases and error scenarios
- Follow the rules below strictly
- Validate accessibility requirements
Rules
Terminal & Package Manager
- Always use Bun as the package manager.
- Always use
cd <absolute/path/to/directory>to change the current working directory. - Never use
cdwithout an absolute path. - When working on CLI commands, you can check their performance by running
Measure-Command { bun dler tsc --verbose }.
Code Complexity and Quality
- Don't add
_prefix to disable unused variable, when this variable is really unused (just use e.g.} catch {instead of} catch (_error) {) - Don't use consecutive spaces in regular expression literals.
- Don't use the
argumentsobject. - Don't use primitive type aliases or misleading types.
- Don't use the comma operator.
- Don't use empty type parameters in type aliases and interfaces.
- Don't write functions that exceed a given Cognitive Complexity score.
- Don't nest describe() blocks too deeply in test files.
- Don't use unnecessary boolean casts.
- Don't use unnecessary callbacks with flatMap.
- Use for...of statements instead of Array.forEach.
- Don't create classes that only have static members (like a static namespace).
- Don't use this and super in static contexts.
- Don't use unnecessary catch clauses.
- Don't use unnecessary constructors.
- Don't use unnecessary continue statements.
- Don't export empty modules that don't change anything.
- Don't use unnecessary escape sequences in regular expression literals.
- Don't use unnecessary labels.
- Don't use unnecessary nested block statements.
- Don't rename imports, exports, and destructured assignments to the same name.
- Don't use unnecessary string or template literal concatenation.
- Don't use String.raw in template literals when there are no escape sequences.
- Don't use useless case statements in switch statements.
- Don't use ternary operators when simpler alternatives exist.
- Don't use useless
thisaliasing. - Don't use any or unknown as type constraints.
- Don't initialize variables to undefined.
- Don't use the void operators (they're not familiar).
- Use arrow functions instead of function expressions.
- Use Date.now() to get milliseconds since the Unix Epoch.
- Use .flatMap() instead of map().flat() when possible.
- Use literal property access instead of computed property access.
- Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.
- Use concise optional chaining instead of chained logical expressions.
- Use regular expression literals instead of the RegExp constructor when possible.
- Don't use number literal object member names that aren't base 10 or use underscore separators.
- Remove redundant terms from logical expressions.
- Use while loops instead of for loops when you don't need initializer and update expressions.
- Don't reassign const variables.
- Don't use constant expressions in conditions.
- Don't use
Math.minandMath.maxto clamp values when the result is constant. - Don't return a value from a constructor.
- Don't use empty character classes in regular expression literals.
- Don't use empty destructuring patterns.
- Don't call global object properties as functions.
- Don't declare functions and vars that are accessible outside their block.
- Make sure builtins are correctly instantiated.
- Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.
- Don't use variables and function parameters before they're declared.
- Don't use 8 and 9 escape sequences in string literals.
- Don't use literal numbers that lose precision.
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.
- 1mo ago First seen · 272 lines · 2,735 tokens per session scan A 332c5c6cb374
ts-coding-rules is a cursor rule published in the GitHub repository reliverse/experiments (117 stars, last pushed 7mo ago), licensed MIT. It adds 2,735 tokens to every session, about $0.0109 per session on Opus 5.5. 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-09-01.
Other cursor rules, from other repositories
nextjs-typescript-tailwind-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript and Tailwind CSS integration.
nextjs-tailwind-typescript-apps-cursorrules-prompt
Cursor rules for Next.js development with Tailwind CSS and TypeScript integration.
qwik-tailwind-cursorrules-prompt-file
Cursor rules for Qwik development with Tailwind CSS integration.
no-magic-numbers
Prefer named constants over unexplained numeric literals in TypeScript. Apply when editing .ts/.tsx behavior code.
nextjs-typescript-tailwind-cursorrules-prompt-file
Cursor rule "nextjs-typescript-tailwind-cursorrules-prompt-file" from XD3an/awesome-ai-coding-all-in-one, covering project overview, key urls, project structure, development guidelines and important scripts.
nextjs-tailwind-typescript-apps-cursorrules-prompt
description: "Cursor rules for Next.js development with Tailwind CSS and TypeScript integration." globs: / alwaysApply: false.