

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345---6description: TypeScript Rules7globs: "**/*.{ts,tsx}"8---910# TypeScript Rules1112### **Core Principles**13- Use **TypeScript** for all code; prefer **interfaces** over types.14- Use the **`function`** keyword for pure functions; **omit semicolons**.15- Avoid **enums**; use **maps** or **union types** instead.16- Use **descriptive variable names** with auxiliary verbs (e.g., `isLoading`, `hasError`).17- Follow the **RORO (Receive an Object, Return an Object)** pattern for function arguments and return values.18- Use **lowercase-with-dashes** for directories (e.g., `components/auth-wizard`).19- Favor **named exports** for components.20- Use **functional & declarative programming** patterns; **avoid classes**.21- Prefer **iteration & modularization** over code duplication.22- **Avoid unnecessary curly braces** in conditionals, especially for single-line statements.2324### **Error Handling**25- **Fail fast**: Handle errors early using **guard clauses & early returns**.26- Place the **happy path last** for improved readability.27- **Avoid unnecessary else statements**; prefer `if-return` pattern.28- Use **preconditions** to check for invalid states upfront.29- Throw errors from `@chaingraph/errors` for consistency.30- Implement **proper error logging** and **user-friendly messages**.31- Consider using **custom error types** or **error factories** for consistent error handling.3233### **File Structure & Organization** IMPORTANT34Maintain a structured and logical order when organizing files:351. **Main Component** – The primary component that orchestrates logic and renders subcomponents.362. **Subcomponents** – Smaller, reusable components that support the main component.373. **Helpers & Utilities** – Functions or modules that provide reusable logic and utilities.384. **Static Content** – Non-code assets such as constants, images, or localization files.395. **Types & Interfaces** – Type definitions for TypeScript to ensure type safety and maintain consistency.4041This hierarchy improves **readability, maintainability, and scalability**.4243#### **Example**44```tsx45export function MainComponent() {46 return (47 <div className="flex flex-col gap-4">48 <h1>{content.title}</h1>49 <SubComponent message={content.welcome} />50 </div>51 )52}5354function SubComponent({ message }: SubComponentProps) {55 return <p>{message}</p>56}5758const content = {59 title: "Main Component",60 welcome: "Welcome"61} as const6263interface SubComponentProps {64 message: string65}66```
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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| L1Network/chaingraph.cursor/rules/tailwind.mdc · 5 | Cursor rules | styleuido-not | 42/100 | 14 days ago | |
| L1Network/chaingraph.cursor/rules/web-vitals-perf.mdc · 5 | Cursor rules | performancedo-not | 32/100 | 14 days ago | |
| L1Network/chaingraph.cursor/rules/nextjs.mdc · 5 | Cursor rules | styleuiperformancedo-not | 65/100 | 14 days ago | |
| L1Network/chaingraph.cursor/rules/react-hooks.mdc · 5 | Cursor rules | styleperformancedo-not | 61/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/l1network-chaingraph-cursor-rules-typescript)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.