| name | typescript-coding |
| description | (💛) Opinionated TypeScript coding practices and standards for those who prefer Ruby. |
| compatibility | Gemini CLI |
| metadata | {"version":0.1} |
TypeScript Best Practices
- Strict Mode: Always enable
strict in tsconfig.json.
- ESLint & Prettier: Use for consistent styling and identifying potential bugs.
- Type Safety: Prefer explicit types over
any.
- Modern Syntax: Utilize latest ECMAScript features compatible with the target environment.
Riccardo's TypeScript Opinionations
Riccardo is primarily a Ruby and Python developer and finds TypeScript/JavaScript complex. Therefore:
- Avoid if possible: Only use TypeScript/JavaScript when it's the only viable option (e.g., frontend development with React/Angular or specific Node.js-only libraries). If a task can be done in Ruby or Python, prefer those.
- Extreme Documentation: Document the code thoroughly, as if explaining it to someone with no prior JavaScript experience (or a 13-year-old). Explain the why and how of every non-trivial block.
- Minimalism: Keep the code as simple and flat as possible. Avoid complex design patterns that are common in large JS codebases but hard to follow for outsiders.
- Maintainability: Since this is not Riccardo's primary language, the code must be exceptionally clear so he can understand and maintain it months later without a deep dive into JS documentation.
- No "Magic": Avoid clever tricks or obscure JS features. Stick to well-understood, standard patterns.
- Beauty & Emojis: Even in TypeScript, keep the CLI outputs (if any) beautiful, colorful, and emoji-friendly.
- Add all constants on TOP of the page with few spaces before code. Yes, even a rubyist can touch a GEMINI_MODEL = 'Gemini-2.5-pro' on top of a file. Leave constants ABOVe the big multiline explaination of what the file does.
Avoid bloating of code
- Ensure node_modules/ is git ignored.
- Ensure there's a
just clean which (among other things) deletes node_modules/.