RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/sferg989/fergfo.om

Cursor rule

.cursor/rules/ts.mdc

[object Object]

Cursor rules

Quality

55/100

Scores the file, not the repository.

Length

214 words

5 headings · 0 code blocks

Repository

0

— · pushed 262 days ago

Last changed

3 days ago

First indexed 3 days ago.
sferg989/fergfo.om/.cursor/rules/ts.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: true
5---
6# TypeScript Best Practices
7 
8## Type Safety & Configuration
9 
10- Enable `strict: true` in [tsconfig.json](mdc:tsconfig.json) with additional flags:
11 - `noImplicitAny: true`
12 - `strictNullChecks: true`
13 - `strictFunctionTypes: true`
14 - `strictBindCallApply: true`
15 - `strictPropertyInitialization: true`
16 - `noImplicitThis: true`
17 - `alwaysStrict: true`
18 - `exactOptionalPropertyTypes: true`
19- Never use `// @ts-ignore` or `// @ts-expect-error` without explanatory comments
20- Use `--noEmitOnError` compiler flag to prevent generating JS files when TypeScript errors exist
21 
22## Type Definitions
23 
24- Do not ever use `any`. Ever. If you feel like you have to use `any`, use `unknown` instead.
25- Explicitly type function parameters, return types, and object literals.
26- Please don't ever use Enums. Use a union if you feel tempted to use an Enum.
27- Use `readonly` modifiers for immutable properties and arrays
28- Leverage TypeScript's utility types (`Partial`, `Required`, `Pick`, `Omit`, `Record`, etc.)
29- Use discriminated unions with exhaustiveness checking for type narrowing
30 
31## Advanced Patterns
32 
33- Implement proper generics with appropriate constraints
34- Use mapped types and conditional types to reduce type duplication
35- Leverage `const` assertions for literal types
36- Implement branded/nominal types for type-level validation
37## Code Organization
38 
39- Organize types in dedicated files (types.ts) or alongside implementations
40- Document complex types with JSDoc comments
41- Create a central `types.ts` file or a `src/types` directory for shared types
42 

Sections

  • TypeScript Best Practices
  • Type Safety & Configuration
  • Type Definitions
  • Advanced Patterns
  • Code Organization

What it covers

code-styletypesdo-notdocs

Stack — with the evidence

typescript

(1.00)

astro

(1.00)

tailwind

(1.00)

eslint

(1.00)

javascript

(0.60)

node

(0.60)

github-actions

(0.60)

cloudflare

(0.60)

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
sferg989
Language
—
License
—
Archived
no

All configs in this repo

Also in sferg989/fergfo.om

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
sferg989/fergfo.om.cursor/rules/astro-component-structure.mdc · 0Cursor rulestypescriptastro+6stylearchui58/1003 days ago
sferg989/fergfo.om.cursor/rules/astro-database-integration.mdc · 0Cursor rulestypescriptastro+6database50/1003 days ago
sferg989/fergfo.om.cursor/rules/astro-error-handling.mdc · 0Cursor rulestypescriptastro+6styledatabaseui58/1003 days ago
sferg989/fergfo.om.cursor/rules/astro-performance-patterns.mdc · 0Cursor rulestypescriptastro+6buildstyledatabaseperformance62/1003 days ago
sferg989/fergfo.om.cursor/rules/astro-ssr-patterns.mdc · 0Cursor rulestypescriptastro+6style49/1003 days ago
sferg989/fergfo.om.cursor/rules/ts-typecheck.mdc · 0Cursor rulestypescriptastro+6do-not23/1003 days ago
sferg989/fergfo.om.cursorrules · 0.cursorrulestypescriptastro+6do-not49/1003 days ago
sferg989/fergfo.omCLAUDE.md · 0CLAUDE.mdtypescriptastro+6setupbuildteststyle+789/1003 days ago
Diff against .cursor/rules/astro-component-structure.mdc Diff against .cursor/rules/astro-database-integration.mdc Diff against .cursor/rules/astro-error-handling.mdc Diff against .cursor/rules/astro-performance-patterns.mdc Diff against .cursor/rules/astro-ssr-patterns.mdc Diff against .cursor/rules/ts-typecheck.mdc Diff against .cursorrules Diff against CLAUDE.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack