typescript-config

typescript-config is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (1,846 once invoked), scanned A, original, Apache-2.0.

A guide to shared TypeScript compiler presets for libraries, React browser apps, and Node.js tools. It explains which strict checks change how code must be written and how each app should inherit the correct preset.

In plain words
What is it for?
Use it when configuring a package, choosing browser or server types, enabling path imports, or interpreting TypeScript compiler errors.
Why use it?
It prevents packages from drifting into different compiler settings and helps developers understand errors caused by strict type checking or the selected runtime.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when configuring a package, choosing browser or server types, enabling path imports, or interpreting TypeScript compiler errors.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/typescript-config
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.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote 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.

agentmods badge for typescript-config

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/typescript-config/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/typescript-config)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/typescript-config"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/typescript-config/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.

agentmods 80×15 button for typescript-config

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/typescript-config"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/typescript-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,846 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01846
Opus 5 $0.00000 $0.00923
Sonnet 5 $0.00000 $0.00369
Haiku 4.5 $0.00000 $0.00185

Measured 6d ago against content hash 82bef0e5c419, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

typescript-config 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 6d 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/quality/typescript-config.mdc · 112 lines

How it starts

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

TypeScript Config Presets

Shared presets live in @repo/typescript-config. Apps and libraries extend a runtime preset - never fork compiler options. The preset JSON is the source of truth for which options are set; read it. This file covers the parts the JSON cannot tell you: which flags change how you must write code, and why two tempting options are deliberately off.

Preset inheritance

flowchart TD
  Strict["strict.json\n(shared strict flags)"]
  Strict --> Library["library.json\nRuntime-neutral libraries"]
  Library --> Workers["workers.json\nthin role alias"]
  Strict --> ViteReact["vite-react.json\nReact + Vite browser"]
  Strict --> ViteNode["vite-node.json\nVite Node tooling"]
Preset For Runtime shape
strict.json never extended directly shared strict core
library.json Cross-runtime JIT libraries lib: es2023, no DOM or Worker globals; noEmit + incremental tsBuildInfoFile
workers.json Worker apps thin role alias of library.json
vite-react.json React SPAs lib includes DOM, types: ["vite/client"]; noEmit
vite-node.json Vite build-time config only types: ["node"], no DOM; noEmit
tests.json mixin, appended after a runtime preset no lib/target; tests tsbuildinfo path, tests/ + src/ include, exclude

Flags that change how you write code

strict.json is more than strict: true. These six will reject ordinary-looking code, so write to them from the start rather than fixing errors afterwards:

Flag What it forces
exactOptionalPropertyTypes An optional prop may be absent, not explicitly undefined. { x: undefined } is not assignable to { x?: string }
noUncheckedIndexedAccess Array and index-signature access yields T | undefined - narrow before use
noPropertyAccessFromIndexSignature Index-signature keys need bracket notation, not dot
verbatimModuleSyntax Type-only imports must say import type, or they survive into JS
erasableSyntaxOnly No runtime TS constructs: no enum, no namespaces, no parameter properties. This is why shared value sets are as const objects
noImplicitOverride Subclass overrides must be marked override

Read the full file on GitHub · 112 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. 6d ago First seen · 112 lines · 0 tokens per session scan A 82bef0e5c419

Subscribe to this mod's changes

typescript-config is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,846 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-09-03.