{"id":19899,"library":"eslint-plugin-react-jsx","title":"eslint-plugin-react-jsx","description":"An ESLint plugin for React JSX rules, part of the eslint-react monorepo. The current stable version is v4.2.3, requiring Node.js >=22.0.0 and ESLint ^10.0.0 with TypeScript. It provides fine-grained control over JSX syntax and patterns beyond what eslint-plugin-react offers, with strong TypeScript support and custom rule examples. Note: the project has moved to v5.x beta releases with breaking changes – stick to v4.x for stability.","status":"active","version":"4.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/Rel1cx/eslint-react","tags":["javascript","react","jsx","eslint","eslint-react","eslint-plugin","eslint-plugin-react-jsx","typescript"],"install":[{"cmd":"npm install eslint-plugin-react-jsx","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-react-jsx","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-react-jsx","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin works as an ESLint rule harness.","package":"eslint","optional":false},{"reason":"Peer dependency; required for type-checking rules.","package":"typescript","optional":true}],"imports":[{"note":"ESM-only; CJS require() fails in Node >=22. Use dynamic import() if needed.","wrong":"const plugin = require('eslint-plugin-react-jsx')","symbol":"default","correct":"import plugin from 'eslint-plugin-react-jsx'"},{"note":"Named export for accessing individual rule definitions.","wrong":"const { rules } = require('eslint-plugin-react-jsx')","symbol":"rules","correct":"import { rules } from 'eslint-plugin-react-jsx'"},{"note":"Exported config presets like 'recommended'.","wrong":"","symbol":"configs","correct":"import { configs } from 'eslint-plugin-react-jsx'"}],"quickstart":{"code":"import plugin from 'eslint-plugin-react-jsx';\n\nexport default [\n  {\n    plugins: {\n      'react-jsx': plugin,\n    },\n    rules: {\n      'react-jsx/no-unstable-nested-components': 'error',\n      'react-jsx/no-leaked-conditional-rendering': 'warn',\n    },\n  },\n];\n","lang":"typescript","description":"Flat ESLint config using the plugin with two recommended JSX rules."},"warnings":[{"fix":"Upgrade Node to >=22.0.0 and ESLint to ^10.0.0.","message":"v5.x drops support for Node <22.0.0 and ESLint <10.0.0.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Remove the rule from your config; use eslint-plugin-react-hooks equivalent instead.","message":"Rule `component-hook-factories` removed in v5.5.0-beta.0.","severity":"deprecated","affected_versions":">=5.5.0-beta.0"},{"fix":"Use `import()` or ensure your project is ESM.","message":"ESM-only package – CJS require() throws in Node >=22 with ESM resolution.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Install TypeScript as a peer dependency and enable linting with `parserOptions.project`.","message":"Some rules (e.g., `no-unstable-nested-components`) require type checking and fail silently if TypeScript is not installed or configured.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-plugin-react-jsx --save-dev`.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'eslint-plugin-react-jsx'"},{"fix":"Use `import plugin from 'eslint-plugin-react-jsx'` or `const plugin = (await import('eslint-plugin-react-jsx')).default`.","cause":"Using CJS `require()` with ESM-only package.","error":"TypeError: plugin is not a function"},{"fix":"Set `\"type\": \"module\"` in package.json or use `.mjs` extension for config file.","cause":"ESLint is not configured for ES modules.","error":"Parsing error: The keyword 'import' is reserved"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}