An ESLint plugin for React that enforces correct usage of Web APIs, preventing common mistakes like missing cleanup in useEffect and unsafe fetch calls. Version 4.2.3 is the latest stable release for ESLint v10 and TypeScript 5.x. It is part of the eslint-react ecosystem, offering rules such as `no-leaked-fetch` and `no-missing-cleanup`. Unlike generic ESLint plugins, it is specifically tailored for React's lifecycle with TypeScript support and ships bundled type definitions.
npm install eslint-plugin-react-web-apiVerified import paths — ran on the pinned version, not inferred.
Configures the plugin with two rules: no-leaked-fetch and no-missing-cleanup, using TypeScript parser for type-checked rules.
Upgrade ESLint to v10+.
Upgrade Node.js to v22+ or use a bundler that handles ESM.
Use `plugins: { 'react-web-api': reactWebApi }` instead of `extends: ['plugin:react-web-api/recommended']`.Migrate to flat config format.
Run `npm install eslint-plugin-react-web-api --save-dev`.
Use dynamic import or set `"type": "module"` in package.json.
Add `import reactWebApi from 'eslint-plugin-react-web-api'` and reference it in `plugins: { 'react-web-api': reactWebApi }`.