Add Next.js + TypeScript rules (annotated, with enforcement hooks)#308
Add Next.js + TypeScript rules (annotated, with enforcement hooks)#308iPythoning wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthroughAdds a new Cursor rules file for Next.js (App Router) + React 19 + strict TypeScript and updates the README to reference it, describing annotated explanations and enforcement hooks (Prettier/ESLint on edit, ChangesNext.js + TypeScript Cursor Rules
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 88: Update the README entry for "Next.js + TypeScript (Annotated +
Enforced)" to remove the implicit claim that enforcement hooks are bundled, and
either (A) mention that the Claude Code enforcement hook files (CLAUDE.md and
.claude/settings.json) must be obtained separately from the source repository
and provide a pointer to where they live, or (B) add those enforcement files to
this PR; specifically edit the phrase "paired with Claude Code enforcement hooks
(Prettier/ESLint on edit, `tsc --noEmit` on stop) so the rules run, not just
suggest" to explicitly state which of the two options is true. Ensure you
reference the CLAUDE.md and .claude/settings.json filenames in the updated
README so users know whether to expect them in this package or fetch them
elsewhere.
In `@rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc`:
- Around line 8-9: Update the wording that claims "pairs with a synced Claude
Code CLAUDE.md + .claude/settings.json hooks" to accurately reflect that those
files are not included in this PR: either add CLAUDE.md and
.claude/settings.json to the contribution or change the sentence in
rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc to state
they live in an external repository and must be obtained separately (or linked),
and mention where to get them; locate the exact phrase "pairs with a synced
Claude Code CLAUDE.md + .claude/settings.json hooks" and edit it accordingly so
the README and file description match the actual contents of the PR.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d3d66252-14f7-4d57-aa48-e2c373198847
📒 Files selected for processing (2)
README.mdrules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc
Addresses CodeRabbit review on PR PatrickJS#308: README + .mdc implied the Claude Code hook files (CLAUDE.md, .claude/settings.json) ship with this entry. They do not — they live in the linked companion repo. Reworded both to say the rules work standalone in Cursor and the hooks are optional, linked.
|
Thanks @coderabbitai — addressed in the latest commit. Both the README entry and the |
|
Tip For best results, initiate chat on the files or code changes.
(◕‿◕✿) 🐇 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README.md (1)
88-88: ⚡ Quick winClarify or link to the companion repository for enforcement hooks.
The phrase "the linked repo" is ambiguous because the only link on this line points to the
.mdcfile in this repository, not to the companion repository where the enforcement hooks actually live. Users interested in the optional hooks must click through to the.mdcfile to discover the companion repo URL.Consider either:
- Adding a direct inline reference:
(get hooks from [this companion repo](https://github.com/iPythoning/claude-cursor-config-nextjs)), or- Rephrasing to: "Works standalone in Cursor; optional Claude Code hooks (Prettier/ESLint on edit,
tsc --noEmiton stop) available in the source repo."The current wording is technically correct but could be more user-friendly.
📝 Suggested clarification
-- [Next.js + TypeScript (Annotated + Enforced)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc) - Next.js + TypeScript rules where every rule states *why* it exists. Works standalone in Cursor; the linked repo also ships optional Claude Code hooks (Prettier/ESLint on edit, `tsc --noEmit` on stop) so the rules run, not just suggest. +- [Next.js + TypeScript (Annotated + Enforced)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc) - Next.js + TypeScript rules where every rule states *why* it exists. Works standalone in Cursor; optional Claude Code hooks (Prettier/ESLint on edit, `tsc --noEmit` on stop) available in the [source repo](https://github.com/iPythoning/claude-cursor-config-nextjs).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` at line 88, Update the README entry for "Next.js + TypeScript (Annotated + Enforced)" to clarify where the optional enforcement hooks live by adding an explicit inline reference or rephrasing; either append a parenthetical like "(get hooks from this companion repo: https://github.com/iPythoning/claude-cursor-config-nextjs)" or change the sentence to "Works standalone in Cursor; optional Claude Code hooks (Prettier/ESLint on edit, `tsc --noEmit` on stop) are available in the source/companion repository" so users can find the enforcement hooks without opening the .mdc file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@README.md`:
- Line 88: Update the README entry for "Next.js + TypeScript (Annotated +
Enforced)" to clarify where the optional enforcement hooks live by adding an
explicit inline reference or rephrasing; either append a parenthetical like
"(get hooks from this companion repo:
https://github.com/iPythoning/claude-cursor-config-nextjs)" or change the
sentence to "Works standalone in Cursor; optional Claude Code hooks
(Prettier/ESLint on edit, `tsc --noEmit` on stop) are available in the
source/companion repository" so users can find the enforcement hooks without
opening the .mdc file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 081e6d76-f317-4278-a83b-b8492635811e
📒 Files selected for processing (2)
README.mdrules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc
✅ Files skipped from review due to trivial changes (1)
- rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc
|
Addressed the nitpick — the entry now links the companion repo inline so readers can find the optional hooks without opening the .mdc. Thanks @coderabbitai. |
|
Tip For best results, initiate chat on the files or code changes.
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README.md (1)
88-88: 💤 Low valueConsider aligning entry format with existing Next.js entries.
The entry uses
Next.js + TypeScript (Annotated + Enforced)with a plus sign, which differs from the surrounding entries that use the patternNext.js (Spec1, Spec2). While this doesn't break functionality, consistent formatting improves scannability.📝 Optional format alignment
Consider reformatting to match the established pattern:
-- [Next.js + TypeScript (Annotated + Enforced)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc) - Next.js + TypeScript rules where every rule states *why* it exists. Works standalone in Cursor; optional Claude Code hooks (Prettier/ESLint on edit, `tsc --noEmit` on stop) are available in the [companion repo](https://github.com/iPythoning/claude-cursor-config-nextjs) so the rules run, not just suggest. +- [Next.js (TypeScript - Annotated & Enforced)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/nextjs-typescript-annotated-enforced-cursorrules-prompt-file.mdc) - Next.js + TypeScript rules where every rule states *why* it exists. Works standalone in Cursor; optional Claude Code hooks (Prettier/ESLint on edit, `tsc --noEmit` on stop) are available in the [companion repo](https://github.com/iPythoning/claude-cursor-config-nextjs) so the rules run, not just suggest.However, if the "+" emphasizes the tight integration between Next.js and TypeScript for this specific ruleset, keeping the current format is also acceptable.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` at line 88, Update the README entry that currently reads "Next.js + TypeScript (Annotated + Enforced)" to match the surrounding Next.js entry format (e.g., "Next.js (TypeScript, Annotated, Enforced)") so the style is consistent; locate the exact string "Next.js + TypeScript (Annotated + Enforced)" in README.md and replace it with the chosen parenthetical style while preserving the link and the companion repo sentence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@README.md`:
- Line 88: Update the README entry that currently reads "Next.js + TypeScript
(Annotated + Enforced)" to match the surrounding Next.js entry format (e.g.,
"Next.js (TypeScript, Annotated, Enforced)") so the style is consistent; locate
the exact string "Next.js + TypeScript (Annotated + Enforced)" in README.md and
replace it with the chosen parenthetical style while preserving the link and the
companion repo sentence.
Adds an annotated Next.js + TypeScript ruleset as a single
.mdcunderrules/, plus its README entry (alphabetical, in the Next.js group).What differentiates it from the existing Next.js + TS entries:
Why: ...). In practice this materially improves how reliably the agent follows a rule — a model that understands whyanyis banned won't quietly reintroduce it, whereas a bare "don't use any" gets ignored.useEffect-fetching waterfalls, copying server data into client stores, emptycatch {}— not just generic "use TypeScript, write clean code"..mdcis kept in sync with a Claude CodeCLAUDE.md+.claude/settings.jsonenforcement hooks (Prettier/ESLint on edit,tsc --noEmiton session stop), so for teams using Cursor + Claude Code the rules enforce themselves instead of being politely ignored.Format: modern Project Rules
.mdcwithdescription/globs/alwaysApplyfrontmatter, per contributing.md. MIT-licensed, free, single-file, no signup. Source repo linked in the file header. Happy to adjust naming or the README line to match list conventions.Summary by CodeRabbit
Documentation
Chores