🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

eslint-plugin-react-web-api

Package Overview
Dependencies
Maintainers
1
Versions
854
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.13.0
Source
npm
Version published
Weekly downloads
265K
2.65%
Maintainers
1
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

Add the plugin to your eslint.config.js:

// @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-timeout": "error",
        "react-web-api/no-leaked-interval": "error",
        "react-web-api/no-leaked-event-listener": "error",
        "react-web-api/no-leaked-resize-observer": "error",
      }
    ],
  },
];

Rules

RuleDescription💼💭
no-leaked-timeoutPrevents leaked setTimeout✔️
no-leaked-intervalPrevents leaked setInterval✔️
no-leaked-idle-callbackPrevents leaked requestIdleCallback✔️🚧
no-leaked-animation-framePrevents leaked requestAnimationFrame✔️🚧
no-leaked-event-sourcePrevents leaked EventSource✔️🚧
no-leaked-event-listenerPrevents leaked addEventListener✔️
no-leaked-resize-observerPrevents leaked ResizeObserver✔️
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

eslint

FAQs

Package last updated on 04 Sep 2024

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