🌐
npm
npmjs.com › package › eslint-plugin-react-dom
eslint-plugin-react-dom - npm
import js from "@eslint/js"; import dom from "eslint-plugin-react-dom"; import { defineConfig } from "eslint/config"; import tseslint from "typescript-eslint"; export default defineConfig( { files: ["**/*.{ts,tsx}"], extends: [ js.configs.recommended, tseslint.configs.recommended, // Add configs from eslint-plugin-react-dom dom.configs.recommended, ], rules: { // Put rules you want to override here "react-dom/no-dangerously-set-innerhtml": "warn", }, }, );
      » npm install eslint-plugin-react-dom
    
Published   Feb 14, 2026
Version   2.13.0
Author   Rel1cx
🌐
GitHub
github.com › jsx-eslint › eslint-plugin-react
GitHub - jsx-eslint/eslint-plugin-react: React-specific linting rules for ESLint · GitHub
Enforces where React component static properties should be positioned. style-prop-object · Enforce style prop value is an object · void-dom-elements-no-children · Disallow void DOM elements (e.g. <img />, <br />) from receiving children · Rules of Hooks: eslint-plugin-react-hooks ·
Starred by 9.3K users
Forked by 2.7K users
Languages   JavaScript
🌐
npm
npmjs.com › package › @eslint-react › eslint-plugin
@eslint-react/eslint-plugin - npm
eslint-plugin-react-dom - DOM-specific rules for React DOM.
      » npm install @eslint-react/eslint-plugin
    
Published   Feb 14, 2026
Version   2.13.0
Author   Rel1cx
🌐
GitHub
github.com › Rel1cx › eslint-react
GitHub - Rel1cx/eslint-react: 4-7x faster, composable ESLint rules for React and friends.
eslint-plugin-react-dom - DOM-specific rules for React DOM.
Starred by 490 users
Forked by 39 users
Languages   TypeScript 80.1% | MDX 19.3% | TypeScript 80.1% | MDX 19.3%
🌐
npm
npmjs.com › package › eslint-plugin-react
eslint-plugin-react - npm
React specific linting rules for ESLint. Latest version: 7.37.5, last published: a year ago. Start using eslint-plugin-react in your project by running `npm i eslint-plugin-react`. There are 16982 other projects in the npm registry using eslint-plugin-react.
      » npm install eslint-plugin-react
    
Published   Apr 03, 2025
Version   7.37.5
Author   Yannick Croissant
🌐
GitHub
github.com › Rel1cx › eslint-react › tree › main › packages › plugins › eslint-plugin-react-dom
eslint-react/packages/plugins/eslint-plugin-react-dom at main · Rel1cx/eslint-react
import js from "@eslint/js"; import dom from "eslint-plugin-react-dom"; import { defineConfig } from "eslint/config"; import tseslint from "typescript-eslint"; export default defineConfig( { files: ["**/*.{ts,tsx}"], extends: [ js.configs.recommended, tseslint.configs.recommended, // Add configs from eslint-plugin-react-dom dom.configs.recommended, ], rules: { // Put rules you want to override here "react-dom/no-dangerously-set-innerhtml": "warn", }, }, );
Author   Rel1cx
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › how-to-configure-eslint-for-react-projects
How to configure ESLint for React Projects ? - GeeksforGeeks
July 23, 2025 - ESLint in React is a JavaScript linting tool that is used for automatically detecting incorrect patterns found in ECMAScript/JavaScript code. It is used with the purpose of improving code quality, making code more consistent, and avoiding bugs.
🌐
LogRocket
blog.logrocket.com › home › 12 essential eslint rules for react
12 essential ESLint rules for React - LogRocket Blog
June 4, 2024 - All versions of react-scripts (one of CRA’s packages) from v3 and later utilize an inbuilt Create React App ESLint configuration which is already set up to include the eslint-plugin-react-hooks plugin (as well as the handy jsx-a11y plugin).
Find elsewhere
🌐
npm
npmjs.com › package › eslint-plugin-react-hooks
eslint-plugin-react-hooks - npm
The official ESLint plugin for React which enforces the Rules of React and other best practices.
      » npm install eslint-plugin-react-hooks
    
Published   Oct 24, 2025
Version   7.0.1
Homepage   https://react.dev/
🌐
Medium
medium.com › @RossWhitehouse › setting-up-eslint-in-react-c20015ef35f7
Setting up ESLint in React
April 13, 2018 - In our terminal again, we need to npm install -g eslint-plugin-react. Alternatively if you're running ESLint locally, we run npm install eslint-plugin-react --save-dev. This will install the plugin we need, but we need to tell ESLint that we want this plugin to help us out.
🌐
Eslint-react
eslint-react.xyz › docs › presets
Presets | ESLint React
The following presets are available in @eslint-react/eslint-plugin: x Enable rules for "react". dom Enable rules for "react-dom". web-api Enable rules for interacting with Web APIs. rsc Enable rules for React Server Components. recommended Enforce rules that are recommended by ESLint React for general-purpose React + React DOM projects.
🌐
React
react.dev › reference › eslint-plugin-react-hooks
eslint-plugin-react-hooks – React
This plugin helps you catch violations of React’s rules at build time, ensuring your components and hooks follow React’s rules for correctness and performance. The lints cover both fundamental React patterns (exhaustive-deps and rules-of-hooks) and issues flagged by React Compiler. React Compiler diagnostics are automatically surfaced by this ESLint plugin, and can be used even if your app hasn’t adopted the compiler yet.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-add-eslint-to-your-react-project
How to Add ESLint to Your React Project
August 8, 2023 - React needs to be imported in app.js file. We need to export our button component. This error might confuse you, because you may not know where it's coming from. We are seeing this error because we set up ESLint in our project, and it scans through our project to tell us that React needs to be imported in the app.js file.
🌐
Eslint-react
eslint-react.xyz › docs › rules › overview
Overview | ESLint React
DOM rules target React DOM-specific ... and DOM property usage. Web API rules prevent resource leaks by detecting uncleaned Web API subscriptions in components and hooks. Naming convention rules enforce consistent naming patterns for React entities. The eslint-plugin-react-debug ...
Top answer
1 of 4
10

When I tried the config snippet in the question by @Jonathan Kasser, I got an error: TypeError: context.getSource is not a function.

The solution is to use fixupPluginRules from @eslint/compat (you need to install this), so my eslint.config.js has a separate object in the config array:

import { fixupPluginRules } from "@eslint/compat";

  // Even though eslint-plugin-react-hooks exposes configs.recommended, it is not yet compatible with the flat file config, 
  // because it has plugins: [ 'react-hooks' ] property, but plugins should be an object
  // Once it is supported, replace with: eslintPluginReactHooks.configs.recommended,
  {
    plugins: {
      "react": reactPlugin, // remove this if you already have another config object that adds the react plugin
      "react-hooks": fixupPluginRules(eslintPluginReactHooks),
    },
    rules: {
      ...eslintPluginReactHooks.configs.recommended.rules,
    },
  },

Resources

  • https://github.com/t3-oss/create-t3-turbo/issues/984#issuecomment-2210934687

Proof it works

I've confirmed this by having a code that should error, and saw the error:

  const [first, setfirst] = useState("");
  useEffect(() => {
    console.log(first);
  }, []);
8:6  warning  React Hook useEffect has a missing dependency: 'first'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
2 of 4
4

[email protected] was released a few weeks ago with "stable" eslint v9 support. If you can upgrade, then see https://github.com/facebook/react/issues/28313#issuecomment-2408157792 for a sample configuration for now.

Also, follow this thread if interested in documentation refresh

🌐
Reddit
reddit.com › r/reactjs › i built an eslint plugin to catch a common and sneaky react mistake: misusing useeffect
r/reactjs on Reddit: I built an ESLint plugin to catch a common and sneaky React mistake: misusing useEffect
March 26, 2025 -

Hey y’all! I recently published an ESLint plugin inspired by the You Might Not Need an Effect section of the React docs.

useEffect is meant to sync your component with external systems. Things like the DOM, timers, or network requests. But you've probably seen (or written 😅) components with effects that operate entirely internally. This pattern shows up a lot, especially when folks are still getting used to React’s mental model.

The plugin catches these unnecessary effects and suggests the simpler, more idiomatic pattern to make your code easier to follow, faster to run, and less error-prone.

Here's a quick example:

// ❌ This triggers a warning:
// 1. "This effect operates entirely on internal React state, with no external dependencies. It is likely unnecessary."
// 2. "Avoid storing derived state. Compute "fullName" directly during render."
useEffect(() => {
  setFullName(firstName + ' ' + lastName);
}, [firstName, lastName]);

// ✅ Better:
const fullName = firstName + ' ' + lastName;

I was surprised there wasn’t already an official rule for this. Turns out it’s tricky to formalize something this abstract. But I’ve thrown a lot of tests at it and tried it on real-world codebases with success.

Would be super curious to hear if this is useful to you, or if you run into false positives or negatives, edge cases, or just have ideas for improvement.

Repo: https://github.com/NickvanDyke/eslint-plugin-react-you-might-not-need-an-effect

I hope it helps you write simpler, more performant and maintainable React! 🙂

🌐
Npm
npm.io › package › eslint-plugin-react
Eslint-plugin-react NPM | npm.io
It is also possible to install ESLint globally rather than locally (using npm install -g eslint). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case. ... If you are using the new JSX transform from React 17, extend react/jsx-runtime in your eslint config (add "plugin:react/jsx-runtime" to "extends") to disable the relevant rules.