eslint-plugin-react-x
A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.
Install
npm install --save-dev eslint-plugin-react-x
Setup
import js from "@eslint/js";
import react from "eslint-plugin-react-x";
import tseslint from "typescript-eslint";
export default tseslint.config({
files: ["**/*.ts", "**/*.tsx"],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
react.configs.recommended,
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"react-x/no-class-component": "warn",
},
});
Rules
https://eslint-react.xyz/docs/rules/overview#x-rules
v1.51.2 (2025-06-08)
🐞 Fixes
- fix: skip function components without name in
react-x/prefer-read-only-props
by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1125
🪄 Improvements
- docs: update references from 'Language Config' to 'Project Config' across documentation by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1126
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.51.1...v1.51.2