Skip to content

Commit 831b6d1

Browse files
committed
docs: update contributing guide for clarity and consistency
1 parent cefd50a commit 831b6d1

File tree

1 file changed

+43
-70
lines changed

1 file changed

+43
-70
lines changed

.github/CONTRIBUTING.md

Lines changed: 43 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,86 @@
11
# ESLint React Contributing Guide
22

3-
Thank you for your interest in contributing to ESLint React! This guide will help you understand how to contribute effectively.
3+
Welcome to contributing to ESLint React! This guide will help you contribute effectively.
44

55
> [!NOTE]
66
> ESLint React is not a fork of or derived from `eslint-plugin-react`. Features in `eslint-plugin-react` may not appear in ESLint React.
77
8-
## Issue Reporting Guidelines
8+
## Issue Reporting Guide
99

10-
- **Search First** - Your issue may already be addressed
11-
- **Verify Version** - Confirm reproducibility with the latest stable release
12-
- **Clear Reproduction Steps Required** - Detailed steps to reproduce are essential
13-
- **Minimal Code Example** - Provide only the code necessary to demonstrate the issue
14-
- **Be Patient** - The team balances many responsibilities
10+
- **Search first**: Your issue may have already been reported.
11+
- **Verify version**: Ensure the issue is reproducible in the latest stable version.
12+
- **Provide clear reproduction steps**.
13+
- **Provide a minimal reproducible code example**.
1514

16-
## Pull Request Guidelines
15+
## Pull Request Guide
1716

18-
- **Sign Your Commits** - Ensure your commits are signed
19-
- **Multiple Small Commits Allowed** - GitHub will squash before merging
20-
- **New Features** - Provide strong rationale, preferably with prior discussion
21-
- **Bug Fixes** - Include `(fix: #xxxx)` in your PR title and detailed description
22-
- **Documentation Changes** - Include `(docs: #xxxx)` in your PR title and detailed description
17+
- **Sign your commits**.
18+
- **Small commits are welcome**: We will squash them before merging.
19+
- **New features**: Please provide a good reason, preferably by discussing it in an Issue first.
20+
- **Bug fixes**: Include `(fix: #xxxx)` in the PR title.
21+
- **Documentation changes**: Include `(docs: #xxxx)` in the PR title.
2322

2423
## Development Commands
2524

26-
### Build Commands
25+
### Build
2726

2827
```bash
29-
# Build packages in packages directory (core, shared, utilities, plugins)
28+
# Build packages that are needed for development and publishing
3029
pnpm run build
3130

32-
# Build packages in .pkgs directory (local configs)
31+
# Build packages that are used in the monorepo (e.g., plugins, configs)
3332
pnpm run build:pkgs
3433

35-
# Build documentation for all packages
34+
# Build docs for all packages
3635
pnpm run build:docs
3736

38-
# Build website
37+
# Build the website
3938
pnpm run build:website
4039
```
4140

4241
### Testing
4342

4443
```bash
45-
# Run all tests with Vitest
44+
# Run all tests
4645
pnpm run test
4746

4847
# Run a single test file
4948
pnpm vitest packages/plugins/eslint-plugin-react-x/src/rules/[rule-name].spec.ts
5049
```
5150

52-
### Linting & Formatting
51+
### Code Linting and Formatting
5352

5453
```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-
64-
# Format code
65-
pnpm run format:write # Format with dprint
66-
pnpm run format:check # Check formatting
67-
```
68-
69-
### Development Utilities
54+
# Format the code
55+
pnpm run format:write
7056

71-
```bash
72-
# Update project metadata
73-
pnpm run update:all # Update version, README, and website
74-
pnpm run update:version # Update version across packages
75-
pnpm run update:readme # Update README with generated content
76-
pnpm run update:website # Update website content
77-
78-
# Package management
79-
pnpm run sort:package-json # Sort package.json files consistently
80-
81-
# Inspection tools
82-
pnpm run inspect:deps # Visualize dependency graph
83-
pnpm run inspect:eslint-config # Launch ESLint config inspector
57+
# Run all checks
58+
pnpm run lint
8459
```
8560

8661
## Development Workflow
8762

8863
### Testing
8964

90-
- Test files located alongside source: `src/rules/[rule-name].spec.ts`
91-
- Uses TypeScript ESLint Rule Tester with custom configurations
92-
- Separate test setups for type-checked and non-type-checked rules
93-
- Test fixtures support multiple TypeScript configurations (JSX variants)
94-
- Helper functions in `test/` directory for common test utilities
95-
96-
### Working with Rules
97-
98-
When developing new ESLint rules:
99-
100-
1. Open an issue to discuss the rule's purpose and design if no existing issue exists
101-
2. Add rule implementation in appropriate plugin's `src/rules/` directory
102-
3. Create corresponding test file using rule tester setup
103-
4. Export rule from plugin's main index file
104-
5. Add rule documentation with summary and examples
105-
6. Update presets/configs if rule should be included by default
106-
7. Update the unified plugin to include the new rule
107-
8. Update the website documentation with the new rule details
108-
9. Run the build and test commands to ensure everything works as expected
109-
10. Submit a pull request with clear description of the changes and any relevant issue links
110-
111-
## References
65+
- Test files coexist with source files: `src/rules/[rule-name].spec.ts`.
66+
- Uses `TypeScript ESLint Rule Tester`.
67+
- Provides separate test setups for type-aware and non-type-aware rules.
68+
- Test fixtures support multiple TypeScript configurations (e.g., JSX variants).
69+
- Test helpers are located in the `test/` directory.
70+
71+
### Developing a New Rule
72+
73+
1. If there isn't a related Issue, create one first to discuss the new rule.
74+
2. Implement the rule in the plugin's `src/rules/` directory.
75+
3. Create the corresponding test file.
76+
4. Export the rule in the plugin's entry file (`src/plugin.ts`).
77+
5. Add documentation for the rule.
78+
6. If the rule should be enabled by default, update the preset configurations.
79+
7. Update the unified plugin to include the new rule.
80+
8. Update the website documentation.
81+
9. Run build and test commands.
82+
10. Submit a PR with a clear description of the changes.
83+
84+
## Reference
11285

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

0 commit comments

Comments
 (0)