eslint-plugin-react
React-specific linting rules for ESLint that catch JSX bugs, enforce Hooks conventions, and keep prop usage consistent.
Repository Health
Technical Analysis
eslint-plugin-react is the standard ESLint plugin for React codebases, shipping over 100 rules that catch React-specific mistakes generic JavaScript linting can’t see — missing key props in lists, unsafe lifecycle method usage, incorrect Hooks naming, unused or undeclared prop-types, and dozens of JSX-formatting conventions. It plugs into both the legacy .eslintrc config system and ESLint 9’s flat config, with recommended, all, and jsx-runtime presets covering everything from a minimal safety net to every active rule enabled.
Maintained by the jsx-eslint organization since 2014, the plugin has grown alongside React itself, tracking class-component lifecycle deprecations, the Hooks API, and the React 17+ automatic JSX transform. Many rules ship autofixers or suggestion fixes, so eslint --fix can resolve issues like redundant closing tags or Hooks-naming inconsistencies without manual edits. It remains a near-universal devDependency for any team running ESLint against a React or JSX codebase.
What You Get
- Over 100 rules spanning JSX syntax, class-component lifecycle safety, Hooks conventions, and prop-types validation
- Both flat-config (
configs.flat) and legacy.eslintrcconfig exports, so migration to ESLint 9 doesn’t require dropping the plugin - Curated
recommendedand exhaustiveallpresets, plus ajsx-runtimepreset for React 17+‘s automatic JSX transform - Autofix (🔧) and suggestion (💡) support on many rules for one-command remediation via
eslint --fix - Shared
reactsettings block (pragma, fragment, version detection, custom link/form component recognition) applied consistently across all rules - Deprecated-rule tracking so teams can see which rules have been superseded without silently losing lint coverage
Common Use Cases
- Failing CI when a list render is missing a
keyprop, preventing subtle reconciliation bugs - Extending
jsx-runtimewhen migrating to React 17+‘s automatic JSX transform to stop flagging unnecessaryReactimports - Enforcing
prop-types/require-default-propsdiscipline on JavaScript (non-TypeScript) component codebases - Blocking
no-unstable-nested-componentsto stop components being redefined inside a parent’s render body on every render - Auditing Hooks usage with
hook-use-stateand related rules to keepuseStatedestructuring and naming symmetric
Under The Hood
Architecture
The plugin has no orchestration engine of its own — ESLint’s own AST walker invokes each rule’s visitor callbacks. index.js aggregates the ~105 independent rule modules under lib/rules/ (one file per rule, each exporting standard ESLint meta + create(context)) and composes them into the recommended, all, jsx-runtime, and flat-config variants. The load-bearing internal abstraction is lib/util/Components.js, a shared component-detection utility (used alongside componentUtil.js, propTypes.js, and usedPropTypes.js) that many rules depend on to determine whether a given AST node is a React component and how its props/state are used; a change to that abstraction would ripple through a large share of the rule set.
Tech Stack
Plain CommonJS JavaScript with no runtime build step (TypeScript is used only to generate published .d.ts type declarations via build.tsconfig.json). Dependencies lean heavily on small ponyfill/polyfill packages (array-includes, object.entries, object.fromentries, es-iterator-helpers, string.prototype.matchall) to support the very wide engines: >=4 Node range, plus doctrine for JSDoc/proptype comment parsing, resolve and semver for module/version resolution, and jsx-ast-utils for JSX AST inspection. Dev tooling includes Mocha + Istanbul for tests, eslint-doc-generator to keep the README’s rule table in sync with rule metadata, and a GitHub Actions matrix testing across multiple Node versions and ESLint majors (3 through 9).
Code Quality
Test coverage is close to 1:1 — 104 test files under tests/lib/rules/ against roughly 105 rule modules — built on ESLint’s own RuleTester harness with explicit valid/invalid case tables, run against a matrix of parsers (babel-eslint, @typescript-eslint/parser across several major versions) to guard parser-specific regressions. CI enforces linting, a type-check pass via tsc, and a docs-generation check before tests run at all, and the project self-lints with eslint-plugin-eslint-plugin. Naming is consistent (kebab-case rule files matching rule IDs), and no swallowed-error patterns are evident — rules report through ESLint’s own context API rather than custom error handling.
API Design
Adoption requires very little boilerplate: extending plugin:react/recommended gets a working baseline in two lines, and the shared settings.react block (pragma, fragment, version, link/form component recognition) is applied uniformly rather than repeated per-rule. Flat-config support was added without breaking the legacy .eslintrc surface, letting teams migrate on their own timeline, and the auto-generated per-rule docs table (via eslint-doc-generator) keeps rule metadata, fixability, and preset membership discoverable in one place.
Used by 123 apps in this directory
LibreChat
AI Assistants · Developer Tools
Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.
LibrePhotos
File Storage
Self-hosted photo library with AI-powered face recognition, semantic search, and automatic event albums — no cloud required.
LimeSurvey
Forms Surveys
The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.
Lokus
Knowledge Management · Note Taking
Local-first note-taking with graph view, canvas & AI plugins—your Markdown files, zero telemetry, blazing-fast Rust performance.
Magic
AI Agents · Automation · Low Code Platforms
Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.
Mastodon
Social Media
Run your own federated social network on the open ActivityPub standard with no ads, no algorithms, and no corporate control over your community.
Mastra Code
AI Code Assistants
"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.
Mattermost
Collaboration · Devops · Team Chat
Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.
Mautic
Automation · Ecommerce · Marketing
The world's largest open source marketing automation platform — own your data, run multi-channel campaigns, and escape vendor lock-in forever.