angular-typescript-cursorrules-prompt-file — Cursor rule: guide
Sets Angular 18 and TypeScript standards in Cursor, capping nesting depth at two levels and enforcing Jest test conventions.
.cursor/rules/angular-typescript-cursorrules-prompt-file.mdcWhat angular-typescript-cursorrules-prompt-file does
This rule configures Cursor for Angular 18 projects using TypeScript and Jest. It instructs the assistant to follow .eslintrc.json, .prettierrc, .htmlhintrc, and .editorconfig. When refactoring, the model must keep existing JSDoc comments and import statements intact.
Structural boundaries are strict. Functions cannot exceed 50 executable lines or 4 parameters. Nesting stops at 2 levels deep. Lines must fit within 80 characters. In addition, the rule demands using forNext from libs/smart-ngrx/src/common/for-next.function.ts instead of standard for or forEach loops. Without that exact helper file in your codebase, generated iterations will fail.
Extraneous conversational filler is banned. If Cursor lacks information to answer a request, it must ask directly rather than hallucinate solutions.
What it helps with
- restrict code nesting to two levels
- keep functions under 50 lines and four arguments
- preserve JSDoc comments during Angular refactoring
- generate tests targeting Jest and Angular 18
Example prompts for the agent
- Create an Angular 18 login component with reactive form validation
- Refactor this data service so nesting does not exceed two levels
- Write a Jest test suite for the authentication guard
How to install angular-typescript-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/angular-typescript-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/angular-typescript-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/angular-typescript-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/angular-typescript-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/angular-typescript-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about angular-typescript-cursorrules-prompt-file
How do I install angular-typescript-cursorrules-prompt-file in Cursor?
Add the configuration file at .cursor/rules/angular-typescript-cursorrules-prompt-file.mdc in your repository root. It matches all files via the **/* pattern.
Which Angular version does this rule target?
It targets Angular 18 with TypeScript and mandates Jest as the test runner.
Does this rule require a specific repository dependency?
Yes. It points standard iteration to libs/smart-ngrx/src/common/for-next.function.ts. You must remove that clause if your project does not use smart-ngrx.
Source text
angular-typescript-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for Angular development with TypeScript integration." globs: **/* alwaysApply: false --- you are an expert Angular programmer using TypeScript, Angular 18 and Jest that focuses on producing clear, readable code. you are thoughtful, give nuanced answers, and are brilliant at reasoning. you carefully provide accurate, factual, thoughtful answers and are a genius at reasoning. before providing an answer, think step by step, and provide a detailed, thoughtful answer. if you need more information, ask for it. always write correct, up to date, bug free, fully functional and working code. focus on performance, readability, and maintainability. before providing an answer, double check your work include all required imports, and ensure proper naming of key components do not nest code more than 2 levels deep prefer using the forNext function, located in libs/smart-ngrx/src/common/for-next.function.ts instead of for(let i;i < length;i++), forEach or for(x of y) code should obey the rules defined in the .eslintrc.json, .prettierrc, .htmlhintrc, and .editorconfig files functions and methods should not have more than 4 parameters functions should not have more than 50 executable lines lines should not be more than 80 characters when refactoring existing code, keep jsdoc comments intact be concise and minimize extraneous prose. if you don't know the answer to a request, say so instead of making something up.
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules