{"id":19891,"library":"eslint-plugin-react-dom","title":"eslint-plugin-react-dom","description":"An ESLint plugin for React DOM-specific linting rules, part of the @eslint-react monorepo. Current stable version is 4.2.3, requiring Node >=22.0.0 and ESLint ^10.0.0. It provides rules for DOM-related best practices in React applications. The package ships with TypeScript types. Note that the latest releases are in v5 beta (5.5.1-beta.0) with breaking changes on the v5 track. Key differentiator: focused solely on DOM rules, unlike broader React ESLint plugins. Release cadence is active with frequent beta updates.","status":"active","version":"4.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/Rel1cx/eslint-react","tags":["javascript","react","dom","eslint","eslint-react","eslint-plugin","eslint-plugin-react-dom","typescript"],"install":[{"cmd":"npm install eslint-plugin-react-dom","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-react-dom","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-react-dom","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: ESLint ^10.0.0 required","package":"eslint","optional":false},{"reason":"Peer dependency: TypeScript is required (though specified as '*', needed for type checking if rules use type information)","package":"typescript","optional":true}],"imports":[{"note":"ESM only since v4; require() fails in Node 22+.","wrong":"const plugin = require('eslint-plugin-react-dom')","symbol":"default","correct":"import plugin from 'eslint-plugin-react-dom'"},{"note":"Access individual rule implementations as an object.","wrong":"","symbol":"rules","correct":"import { rules } from 'eslint-plugin-react-dom'"},{"note":"configs is a named export, not a default export from a subpath.","wrong":"import configs from 'eslint-plugin-react-dom/configs'","symbol":"configs","correct":"import { configs } from 'eslint-plugin-react-dom'"}],"quickstart":{"code":"// eslint.config.js\nimport pluginReactDom from 'eslint-plugin-react-dom';\n\nexport default [\n  {\n    plugins: {\n      'react-dom': pluginReactDom,\n    },\n    rules: {\n      'react-dom/no-dangerously-set-innerhtml': 'error',\n      'react-dom/no-missing-iframe-sandbox': 'warn',\n    },\n  },\n];","lang":"javascript","description":"Configures the plugin with two DOM-specific rules in an ESLint flat config file."},"warnings":[{"fix":"Update Node to v22+ or stay on plugin v3.x if using older Node.","message":"Node >=22.0.0 required; plugin will not load on older versions.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use ESLint 10+ with flat config (eslint.config.js).","message":"ESLint ^10.0.0 required; flat config only.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Convert project to ESM or use dynamic import() instead of require().","message":"ESM-only package; require() will throw ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Pin to v4 for stable rules; v5 may have renamed or removed rules.","message":"v5 series is in beta with breaking changes; v4 is still stable.","severity":"deprecated","affected_versions":"<5.0.0"},{"fix":"Ensure TypeScript is installed and parser configured for type-aware rules.","message":"Rules may require type information; not all work without TypeScript.","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":"Change to import statement or use dynamic import().","cause":"Using CommonJS require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Upgrade ESLint to ^10.0.0.","cause":"Installed ESLint version is lower than 10.","error":"Failed to load plugin 'react-dom': Package requires eslint ^10.0.0"},{"fix":"Add plugin to plugins object: plugins: { 'react-dom': pluginReactDom }.","cause":"Plugin not registered properly in flat config.","error":"TypeError: Cannot read properties of undefined (reading 'no-dangerously-set-innerhtml')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}