Welcome to contributing to ESLint React! This guide will help you contribute effectively.
Note
ESLint React is not a fork of or derived from eslint-plugin-react. Features in eslint-plugin-react may not appear in ESLint React.
- Search first: Your issue may have already been reported.
- Verify version: Ensure the issue is reproducible in the latest stable version.
- Provide clear reproduction steps.
- Provide a minimal, reproducible code example.
- Sign your commits.
- Small commits are welcome: We will squash them before merging.
- New features: Please provide a good reason, preferably by discussing it in an issue first.
- Bug fixes: Include
(fix: #xxxx)in the PR title. - Documentation changes: Include
(docs: #xxxx)in the PR title.
# Build packages that are needed for development and publishing
pnpm run build
# Build packages that are used in the monorepo (ex: plugins, configs)
pnpm run build:pkgs
# Build docs for all packages
pnpm run build:docs
# Build the website
pnpm run build:website# Run all tests
pnpm run test
# Run a single test file
pnpm vitest packages/plugins/eslint-plugin-react-x/src/rules/[rule-name]/[rule-name].spec.ts# Format the code
pnpm run format:write
# Run all checks
pnpm run lint- Test files coexist with source files:
src/rules/[rule-name]/[rule-name].spec.ts. - Uses
TypeScript ESLint Rule Tester. - Provides separate test setups for type-aware and non-type-aware rules.
- Test fixtures support multiple TypeScript configurations (ex: JSX variants).
- Test helpers are located in the
test/directory.
- If there isn't a related issue, create one first to discuss the new rule.
- Implement the rule in the plugin's
src/rules/directory. - Create the corresponding test file.
- Export the rule in the plugin's entry file (
src/plugin.ts). - Add documentation for the rule.
- If the rule should be enabled by default, update the preset configurations.
- Update the unified plugin to include the new rule.
- Update the website documentation.
- Run build and test commands.
- Submit a PR with a clear description of the changes.