Skip to content

Commit c038699

Browse files
committed
chore: update contributing docs
1 parent 65a33e3 commit c038699

File tree

9 files changed

+222
-69
lines changed

9 files changed

+222
-69
lines changed

.github/CONTRIBUTING.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,94 @@ Thank you for your interest in contributing to ESLint React! This guide will hel
2121
- **Bug Fixes** - Include `(fix: #xxxx)` in your PR title and detailed description
2222
- **Documentation Changes** - Include `(docs: #xxxx)` in your PR title and detailed description
2323

24+
## Development Commands
25+
26+
### Build Commands
27+
28+
```bash
29+
# Build packages in packages directory (core, shared, utilities, plugins)
30+
pnpm run build
31+
32+
# Build packages in .pkgs directory (local configs)
33+
pnpm run build:pkgs
34+
35+
# Build documentation for all packages
36+
pnpm run build:docs
37+
38+
# Build website
39+
pnpm run build:website
40+
```
41+
42+
### Testing
43+
44+
```bash
45+
# Run all tests with Vitest
46+
pnpm run test
47+
48+
# Run a single test file
49+
pnpm vitest packages/plugins/eslint-plugin-react-x/src/rules/[rule-name].spec.ts
50+
```
51+
52+
### Linting & Formatting
53+
54+
```bash
55+
# Full lint check (deps, publish, TypeScript, ESLint, examples)
56+
pnpm run lint
57+
58+
# Individual lint commands
59+
pnpm run lint:deps # Check dependency cycles with skott
60+
pnpm run lint:ts # TypeScript check across packages
61+
pnpm run lint:es # ESLint check
62+
pnpm run lint:publish # Check package.json publishing config
63+
pnpm run lint:spell # Spell check with cspell
64+
65+
# Format code
66+
pnpm run format:write # Format with dprint
67+
pnpm run format:check # Check formatting
68+
```
69+
70+
### Development Utilities
71+
72+
```bash
73+
# Update project metadata
74+
pnpm run update:all # Update version, README, and website
75+
pnpm run update:version # Update version across packages
76+
pnpm run update:readme # Update README with generated content
77+
# pnpm run update:website # Update website content
78+
79+
# Package management
80+
pnpm run sort:package-json # Sort package.json files consistently
81+
82+
# Inspection tools
83+
pnpm run inspect:deps # Visualize dependency graph
84+
pnpm run inspect:eslint-config # Launch ESLint config inspector
85+
```
86+
87+
## Development Workflow
88+
89+
### Testing
90+
91+
- Test files located alongside source: `src/rules/[rule-name].spec.ts`
92+
- Uses TypeScript ESLint Rule Tester with custom configurations
93+
- Separate test setups for type-checked and non-type-checked rules
94+
- Test fixtures support multiple TypeScript configurations (JSX variants)
95+
- Helper functions in `test/` directory for common test utilities
96+
97+
### Working with Rules
98+
99+
When developing new ESLint rules:
100+
101+
1. Open an issue to discuss the rule's purpose and design if no existing issue exists
102+
2. Add rule implementation in appropriate plugin's `src/rules/` directory
103+
3. Create corresponding test file using rule tester setup
104+
4. Export rule from plugin's main index file
105+
5. Add rule documentation with summary and examples
106+
6. Update presets/configs if rule should be included by default
107+
7. Update the unified plugin to include the new rule
108+
8. Update the website documentation with the new rule details
109+
9. Run the build and test commands to ensure everything works as expected
110+
10. Submit a pull request with clear description of the changes and any relevant issue links
111+
24112
## References
25113

26114
- [Monorepo Structure](https://eslint-react.xyz/docs/contributing#monorepo-structure)

.github/instructions/nx.instructions.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
applyTo: '**'
2+
applyTo: "**"
33
---
44

55
// This file is automatically generated by Nx Console
@@ -9,12 +9,14 @@ You are in an nx workspace using Nx 21.4.0 and pnpm as the package manager.
99
You have access to the Nx MCP server and the tools it provides. Use them. Follow these guidelines in order to best help the user:
1010

1111
# General Guidelines
12+
1213
- When answering questions, use the nx_workspace tool first to gain an understanding of the workspace architecture
1314
- For questions around nx configuration, best practices or if you're unsure, use the nx_docs tool to get relevant, up-to-date docs!! Always use this instead of assuming things about nx configuration
1415
- If the user needs help with an Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors
1516
- To help answer questions about the workspace structure or simply help with demonstrating how tasks depend on each other, use the 'nx_visualize_graph' tool
1617

1718
# Generation Guidelines
19+
1820
If the user wants to generate something, use the following flow:
1921

2022
- learn about the nx workspace and any specifics the user needs by using the 'nx_workspace' tool and the 'nx_project_details' tool if applicable
@@ -29,12 +31,11 @@ If the user wants to generate something, use the following flow:
2931
- use the information provided in the log file to answer the user's question or continue with what they were doing
3032

3133
# Running Tasks Guidelines
34+
3235
If the user wants help with tasks or commands (which include keywords like "test", "build", "lint", or other similar actions), use the following flow:
36+
3337
- Use the 'nx_current_running_tasks_details' tool to get the list of tasks (this can include tasks that were completed, stopped or failed).
3438
- If there are any tasks, ask the user if they would like help with a specific task then use the 'nx_current_running_task_output' tool to get the terminal output for that task/command
3539
- Use the terminal output from 'nx_current_running_task_output' to see what's wrong and help the user fix their problem. Use the appropriate tools if necessary
3640
- If the user would like to rerun the task or command, always use `nx run <taskId>` to rerun in the terminal. This will ensure that the task will run in the nx context and will be run the same way it originally executed
37-
- If the task was marked as "continuous" do not offer to rerun the task. This task is already running and the user can see the output in the terminal. You can use 'nx_current_running_task_output' to get the output of the task to verify the output.
38-
39-
40-
41+
- If the task was marked as "continuous" do not offer to rerun the task. This task is already running and the user can see the output in the terminal. You can use 'nx_current_running_task_output' to get the output of the task to verify the output.

apps/website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"next-view-transitions": "^0.3.4",
3030
"react": "^19.1.1",
3131
"react-dom": "^19.1.1",
32-
"shiki": "^3.9.2",
32+
"shiki": "^3.10.0",
3333
"tailwind-merge": "^3.3.1",
3434
"twoslash": "^0.3.4"
3535
},

examples/vite-react-dom-app-v1/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"@tsconfig/vite-react": "^7.0.0",
2424
"@types/react": "^19.1.10",
2525
"@types/react-dom": "^19.1.7",
26-
"@vitejs/plugin-react": "^5.0.0",
26+
"@vitejs/plugin-react": "^5.0.1",
2727
"eslint": "^9.33.0",
2828
"eslint-plugin-react-hooks": "^5.2.0",
2929
"eslint-plugin-react-refresh": "^0.4.20",
3030
"typescript": "^5.9.2",
3131
"typescript-eslint": "^8.40.0",
32-
"vite": "^7.1.2"
32+
"vite": "^7.1.3"
3333
},
3434
"engines": {
3535
"node": ">=20.19.0"

examples/vite-react-dom-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"@tsconfig/vite-react": "^7.0.0",
2424
"@types/react": "^19.1.10",
2525
"@types/react-dom": "^19.1.7",
26-
"@vitejs/plugin-react": "^5.0.0",
26+
"@vitejs/plugin-react": "^5.0.1",
2727
"eslint": "^9.33.0",
2828
"eslint-plugin-react-hooks": "^5.2.0",
2929
"eslint-plugin-react-refresh": "^0.4.20",
3030
"typescript": "^5.9.2",
3131
"typescript-eslint": "^8.40.0",
32-
"vite": "^7.1.2"
32+
"vite": "^7.1.3"
3333
},
3434
"engines": {
3535
"node": ">=20.19.0"

examples/vite-react-dom-js-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"@eslint/js": "^9.33.0",
2121
"@types/react": "^19.1.10",
2222
"@types/react-dom": "^19.1.7",
23-
"@vitejs/plugin-react": "^5.0.0",
23+
"@vitejs/plugin-react": "^5.0.1",
2424
"eslint": "^9.33.0",
2525
"eslint-plugin-react-hooks": "^5.2.0",
2626
"eslint-plugin-react-refresh": "^0.4.20",
2727
"globals": "^16.3.0",
28-
"vite": "^7.1.2"
28+
"vite": "^7.1.3"
2929
},
3030
"engines": {
3131
"node": ">=20.19.0"

examples/vite-react-dom-js-with-babel-eslint-parser-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@types/babel__preset-env": "~7.10.0",
2626
"@types/react": "^19.1.10",
2727
"@types/react-dom": "^19.1.7",
28-
"@vitejs/plugin-react": "^5.0.0",
28+
"@vitejs/plugin-react": "^5.0.1",
2929
"eslint": "^9.33.0",
3030
"eslint-plugin-react-debug": "workspace:*",
3131
"eslint-plugin-react-dom": "workspace:*",
@@ -35,7 +35,7 @@
3535
"eslint-plugin-react-web-api": "workspace:*",
3636
"eslint-plugin-react-x": "workspace:*",
3737
"globals": "^16.3.0",
38-
"vite": "^7.1.2"
38+
"vite": "^7.1.3"
3939
},
4040
"engines": {
4141
"node": ">=20.19.0"

examples/vite-react-dom-with-ts-blank-eslint-parser-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
"@tsconfig/vite-react": "^7.0.0",
2626
"@types/react": "^19.1.10",
2727
"@types/react-dom": "^19.1.7",
28-
"@vitejs/plugin-react": "^5.0.0",
28+
"@vitejs/plugin-react": "^5.0.1",
2929
"eslint": "^9.33.0",
3030
"eslint-plugin-react-hooks": "^5.2.0",
3131
"eslint-plugin-react-refresh": "^0.4.20",
3232
"globals": "^16.3.0",
3333
"ts-blank-eslint-parser": "^0.4.3",
3434
"typescript": "^5.9.2",
3535
"typescript-eslint": "^8.40.0",
36-
"vite": "^7.1.2"
36+
"vite": "^7.1.3"
3737
},
3838
"engines": {
3939
"node": ">=20.19.0"

0 commit comments

Comments
 (0)