Socket
Book a DemoInstallSign in
Socket

eslint-plugin-observers

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-observers

ESLint plugin for preventing memory leaks around observers (ResizeObserver, IntersectionObserver, MutationObserver)

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
24K
-12.4%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-observers

ESLint plugin for preventing memory leaks around observers (ResizeObserver, IntersectionObserver, MutationObserver)

Installation

You'll first need to install ESLint:

npmyarnpnpm
npm i eslint -Dyarn add eslint -Dpnpm add eslint -D

Next, install eslint-plugin-observers:

npmyarnpnpm
npm i eslint-plugin-observers -Dyarn add eslint-plugin-observers -Dpnpm add eslint-plugin-observers -D

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-observers globally.

Usage

Add observers to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["observers"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "observers/no-missing-unobserve-or-disconnect": "error",
    "observers/matching-unobserve-target": "error",
  }
}

or

You can use our "recommended" settings which enables most of the rules for you

{
  "extends": ["plugin:observers/recommended"]
}

We also support a "strict" settings which enabled all of the rules for you

{
  "extends": ["plugin:observers/strict"]
}

Rule Documentation

Credits

This package is based on eslint-plugin-listeners, most of the functions were reused or based on functions used in eslint-plugin-listeners. Because of that, this plugin deserves a lot of credit.

Keywords

eslint

FAQs

Package last updated on 10 Mar 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.