{"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,"search_vec":"'10.0.0':31 '22.0.0':28 'beta':67 'beyond':45 'break':70 'chang':71 'control':39 'current':21 'custom':57 'eslint':2,7,17,30,48,80,82,85,88 'eslint-plugin':84 'eslint-plugin-react':47 'eslint-plugin-react-jsx':1,87 'eslint-react':16,81 'exampl':59 'fine':37 'fine-grain':36 'grain':38 'javascript':77 'jsx':5,11,41,79,91 'monorepo':19 'move':64 'node.js':27 'note':60 'offer':51 'part':13 'pattern':44 'plugin':3,8,49,86,89 'project':62 'provid':35 'react':4,10,18,50,78,83,90 'releas':68 'requir':26 'rule':12,58 'stabil':76 'stabl':22 'stick':72 'strong':53 'support':55 'syntax':42 'typescript':33,54,92 'v4.2.3':25 'v4.x':74 'v5.x':66 'version':23","created_at":"2026-04-25T11:20:15.958803+00:00","updated_at":"2026-04-25T11:20:15.958803+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Rel1cx/eslint-react","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-react-jsx","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}