ESLint shareable config for React projects, designed to be used with eslint-config-xo. Current stable version is 0.30.1, released in early 2025. This package enforces a strict, opinionated set of React and JSX rules including hooks, prop types, accessibility, and security. It supports both React and Preact, and requires Node.js >=18.18 and ESLint >=9.18.0. Unlike generic React ESLint configs, it integrates tightly with the XO style guide and provides options for spaces vs tabs in JSX. Ships TypeScript types, but is ESLint 9 (flat config) only from v0.30.0.
npm install eslint-config-xo-reactVerified import paths — ran on the pinned version, not inferred.
Sets up ESLint flat config for React with XO style guide, using spaces for JSX indentation.
Use default import: import eslintConfigXoReact from 'eslint-config-xo-react' and pass options as object.
Upgrade ESLint to 9.x and migrate to eslint.config.js flat config.
Use function declarations for named components: function MyComponent() { ... } instead of const MyComponent = () => { ... }.Always include eslint-config-xo in your ESLint flat config array before eslint-config-xo-react.
Use ESLint flat config with eslint-config-xo and eslint-config-xo-react directly.
Use ...eslintConfigXoReact() instead of eslintConfigXoReact() alone.
Convert to ESM: use import and set "type": "module" in package.json, or use dynamic import().
Upgrade to ESLint 9 and use eslint.config.js with flat config. Remove .eslintrc files.
Install eslint-plugin-react: npm install --save-dev eslint-plugin-react