react-redux-typescript-cursorrules-prompt-file — Cursor rule
This Cursor rule guides React work with Redux and TypeScript, covering component style, state structure, and typed hooks. Use it in a matching project.
.cursor/rules/react-redux-typescript-cursorrules-prompt-file.mdcWhat react-redux-typescript-cursorrules-prompt-file does
The rule steers React code toward functional components with hooks and TypeScript checks. For state management, it calls for Redux Toolkit, slice-based organization, selectors, createAsyncThunk, typed Redux hooks, and error handling around async work.
It lays out src/components, src/features, src/store/slices, src/types, and src/utils, along with src/store/hooks.ts and src/store/store.ts. It also points to Redux DevTools and Redux naming conventions. The metadata uses globs: **/* while setting alwaysApply: false, so Cursor does not force the rule into every request.
What it helps with
- structure React components around functions and hooks
- split Redux state into slices under
store - type state access with selectors and Redux hooks
- handle async work through
createAsyncThunk - review a React project against Redux naming guidance
Example prompts for the agent
- Use this rule and build a React component with typed props and hooks.
- Organize the state into Redux slices, add
createAsyncThunkfor data loading, and handle failures. - Review the project layout, move state code into
src/store, and add typed hooks with selectors.
How to install react-redux-typescript-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/react-redux-typescript-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/react-redux-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/react-redux-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/react-redux-typescript-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/react-redux-typescript-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about react-redux-typescript-cursorrules-prompt-file
How do I install react-redux-typescript-cursorrules-prompt-file in Cursor?
Save the rule at .cursor/rules/react-redux-typescript-cursorrules-prompt-file.mdc in the project.
What does react-redux-typescript-cursorrules-prompt-file do?
It gives Cursor guidance for React projects using Redux and TypeScript, including functional components, Redux Toolkit, slices, selectors, typed hooks, and async error handling.
Does the rule apply to every project file?
Its glob is **/*, but alwaysApply: false means Cursor does not force it into every request.
Source text
react-redux-typescript-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for React development with Redux and TypeScript integration."
globs: **/*
alwaysApply: false
---
// React + Redux + TypeScript .cursorrules
// Prefer functional components with hooks
const preferFunctionalComponents = true;
// Use TypeScript for type safety
const useTypeScript = true;
// Redux best practices
const reduxBestPractices = [
"Use Redux Toolkit for efficient Redux development",
"Implement slice pattern for organizing Redux code",
"Utilize createAsyncThunk for handling async actions",
"Use selectors for accessing state in components",
];
// Folder structure
const folderStructure = `
src/
components/
features/
store/
slices/
hooks.ts
store.ts
types/
utils/
`;
// Additional instructions
const additionalInstructions = `
1. Use React.FC for functional components with props
2. Implement strict TypeScript checks
3. Use Redux hooks (useSelector, useDispatch) in components
4. Create reusable typed hooks for Redux operations
5. Implement proper error handling in async operations
6. Use Redux DevTools for debugging
7. Follow Redux style guide for naming conventions
`;
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules