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.3 (2025-04-04)
🐞 Fixes
- fix: fixed
no-useless-fragment
false positive when using
, closes #1035 by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1036
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.40.2...v1.40.3