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