Registry / testing / eslint-plugin-react-web-api

eslint-plugin-react-web-api

JSON →
library4.2.3jsnpmunverified

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-api
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-REAC
E
eslint-plugin-react-web-api
testingjavascriptv4.2.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import reactWebApi from 'eslint-plugin-react-web-api'
const reactWebApi = require('eslint-plugin-react-web-api')
The plugin is ESM-only; CommonJS require is not supported in Node >=22.
rules
import { rules } from 'eslint-plugin-react-web-api'
import { rules } from 'eslint-plugin-react-web-api/rules'
Access rules directly from the plugin object; there is no separate export path.
configs
import { configs } from 'eslint-plugin-react-web-api'
Configurations are exported as 'configs' (e.g., configs.recommended).

Configures the plugin with two rules: no-leaked-fetch and no-missing-cleanup, using TypeScript parser for type-checked rules.

// eslint.config.js import reactWebApi from 'eslint-plugin-react-web-api'; import tsParser from '@typescript-eslint/parser'; export default [ { files: ['**/*.{js,jsx,ts,tsx}'], plugins: { 'react-web-api': reactWebApi, }, languageOptions: { parser: tsParser, parserOptions: { ecmaFeatures: { jsx: true }, }, }, rules: { 'react-web-api/no-leaked-fetch': 'warn', 'react-web-api/no-missing-cleanup': 'error', }, }, ];
eslint --version
Debug
Known issues
breakingESLint v10 is required. Versions 4.x do not support ESLint <10.
fix
Upgrade ESLint to v10+.
affects: >=4.0.0
breakingNode.js >=22 is required. The plugin uses ESM only.
fix
Upgrade Node.js to v22+ or use a bundler that handles ESM.
affects: >=4.0.0
gotchaThe plugin must be placed in the 'plugins' array of the flat config, not as a string in the 'extends' array.
fix
Use `plugins: { 'react-web-api': reactWebApi }` instead of `extends: ['plugin:react-web-api/recommended']`.
affects: >=4.0.0
deprecatedThe legacy `.eslintrc` format is not supported. The plugin only works with the flat config (eslint.config.js).
fix
Migrate to flat config format.
affects: >=4.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin 'eslint-plugin-react-web-api'.
The plugin is not installed or is not in node_modules.
fix
Run `npm install eslint-plugin-react-web-api --save-dev`.
Cannot find module 'eslint-plugin-react-web-api'
The package is ESM-only and require is used instead of import.
fix
Use dynamic import or set `"type": "module"` in package.json.
Plugin 'react-web-api' was not found.
The plugin was not added to the `plugins` array in the flat config.
fix
Add `import reactWebApi from 'eslint-plugin-react-web-api'` and reference it in `plugins: { 'react-web-api': reactWebApi }`.
Upgrade
Version history
4.2.3latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required for the plugin to function
typescriptoptionalPeer dependency required for type-checked rules
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-react-web-api — npm install eslint-plugin-react-web-api · libregistry