TypeScript ExpressJs Jest Logging .cursorrules prompt file
About .cursorrules prompt file
What you can build
TypeScript Code Linter Service: Develop a tool that analyzes TypeScript code for adherence to the provided guidelines, suggesting corrections and improvements, and integrates with popular editors like VSCode.
TypeScript Refactoring Tool: Create a web application that allows users to input TypeScript files and outputs refactored code following clean design patterns and guidelines, improving readability and maintainability.
Clean Architecture Code Generator: Build a service that generates starter projects in TypeScript with the specified clean architecture, including directory structure and sample code for entities, interfaces, repositories, and routes.
TypeScript Code Documentation Generator: Develop a tool that automatically generates JSDoc comments for TypeScript methods and classes based on the guidelines, integrating with code editors to assist developers.
TypeScript Testing Assistant: Design an application that guides developers through setting up tests using Jest, following the Arrange-Act-Assert pattern for TypeScript applications, including sample test templates.
Logging and Metrics Dashboard: Offer a solution that integrates with applications to provide a real-time dashboard using winston, morgan, and prom-client for logging and metrics auditing.
TypeScript Training Course: Provide an online course focused on teaching TypeScript best practices, clean architecture, and testing, catering to developers who want to improve code quality and project structure.
ExpressJS Middleware Library: Create a collection of common middleware functions for Express in TypeScript, ready to integrate into projects and following best practices for naming and structure.
API Route Creator: Develop a visual tool that assists developers in defining and generating API routes and middleware structures in TypeScript, aligned with the specified project structure.
Immutability Utilities Library: Introduce a library with utilities to enforce immutability in TypeScript applications, promoting the use of
readonly
andas const
where applicable.
Benefits
- Emphasizes the use of TypeScript-specific practices, including strict typing and avoiding 'any', while enforcing comprehensive documentation via JSDoc.
- Encourages clean and maintainable code through principles like single-purpose functions, immutability, and appropriate use of design patterns and naming conventions.
- Advocates for a well-organized project structure based on clean architecture with distinct folders for domain, infrastructure, gateways, and presentation layers, ensuring separation of concerns.
Synopsis
Developers building scalable applications using TypeScript and ExpressJS will benefit by ensuring clean, maintainable code architecture following SOLID principles integrated with clear documentation and structured testing practices.
Overview of .cursorrules prompt
The .cursorrules file outlines a set of guidelines and principles for writing TypeScript code, specifically using the ExpressJs framework, with a focus on clean programming and adherence to design patterns. It includes detailed rules for code style, nomenclature, functions, data handling, classes, exceptions, and project structure. It also specifies a clean architecture approach, emphasizing the separation of concerns into domain, gateways, infrastructure, and presentation layers. Additionally, it provides guidelines for testing using Jest, metrics and logging practices with winston, morgan, and prom-client libraries, and establishes practices for error handling and code documentation.