JSPM

eslint-plugin-react-dom

2.0.0-next.58
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 265009
  • Score
    100M100P100Q166454F
  • License MIT

ESLint React's ESLint plugin for React DOM related rules.

Package Exports

  • eslint-plugin-react-dom
  • eslint-plugin-react-dom/package.json

Readme

eslint-plugin-react-dom

DOM specific rules for React DOM.

Install

# npm
npm install --save-dev eslint-plugin-react-dom

Setup

// eslint.config.js

// @ts-check
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,
      tsconfigRootDir: import.meta.dirname,
    },
  },
  rules: {
    // Put rules you want to override here
    "react-dom/no-dangerously-set-innerhtml": "warn",
  },
});

Rules

https://eslint-react.xyz/docs/rules/overview#dom-rules