New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-react-web-api

Package Overview
Dependencies
Maintainers
0
Versions
420
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-web-api

ESLint React's ESLint plugin for interacting with Web APIs

  • 1.26.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
115K
decreased by-24.72%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-plugin-react-web-api

ESLint React's ESLint plugin for React to interact with Web APIs.

Install

# npm
npm install --save-dev eslint-plugin-react-web-api

Setup

// @ts-check

import js from "@eslint/js";
import reactWebAPI from "eslint-plugin-react-web-api";

export default [
  js.configs.recommended,
  {
    files: ["**/*.{ts,tsx}"],
    plugins: [
      "react-web-api": reactWebAPI,
      rules: {
        // react-web-api recommended rules
        "react-web-api/no-leaked-event-listener": "warn",
        "react-web-api/no-leaked-interval": "warn",
        "react-web-api/no-leaked-resize-observer": "warn",
        "react-web-api/no-leaked-timeout": "warn",
      }
    ],
  },
];

Rules

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

Rules to be implemented

RuleDescription
no-leaked-idle-callbackPrevents leaked requestIdleCallback
no-leaked-animation-framePrevents leaked requestAnimationFrame
no-leaked-event-sourcePrevents leaked EventSource
no-leaked-intersection-observerPrevents leaked IntersectionObserver
no-leaked-mutation-observerPrevents leaked MutationObserver
no-leaked-performance-observerPrevents leaked PerformanceObserver
no-leaked-websocketPrevents leaked WebSocket
no-leaked-broadcast-channelPrevents leaked BroadcastChannel
no-leaked-geolocationPrevents leaked Geolocation.watchPosition()
no-leaked-absolute-orientation-sensorPrevents leaked AbsoluteOrientationSensor
no-leaked-relative-accelerometerPrevents leaked Accelerometer
no-leaked-ambient-light-sensorPrevents leaked AmbientLightSensor
no-leaked-gravity-sensorPrevents leaked GravitySensor
no-leaked-gyroscopePrevents leaked Gyroscope
no-leaked-linear-acceleration-sensorPrevents leaked LinearAccelerationSensor
no-leaked-magnetometerPrevents leaked Magnetometer
no-leaked-orientation-sensorPrevents leaked OrientationSensor

Keywords

FAQs

Package last updated on 03 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc