eslint-plugin-react-dom
DOM specific rules for React DOM.
Install
npm install --save-dev eslint-plugin-react-dom
Setup
import js from "@eslint/js";
import reactDom from "eslint-plugin-react-dom";
import tseslint from "typescript-eslint";
export default tseslint.config({
files: ["**/*.ts", "**/*.tsx"],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactDom.configs.recommended,
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
},
},
rules: {
"react-dom/no-dangerously-set-innerhtml": "warn",
},
});
Rules
https://eslint-react.xyz/docs/rules/overview#dom-rules
v1.40.0 (2025-04-01)
✨ New
- feat(react-x): add
react-x/jsx-uses-react
rule by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1027
- feat: enable
react-x/jsx-uses-react
rule in recommended presets by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1027
- feat: enable
naming-convention/context-name
rule in recommended presets by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1024
- feat(kit): add
JsxRuntime
module by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1025
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.38.4...v1.40.0