Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-rxjs

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-rxjs

ESLint rules for RxJS

  • 5.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is eslint-plugin-rxjs?

eslint-plugin-rxjs is an ESLint plugin that provides linting rules for RxJS to help developers write more consistent and error-free reactive code. It enforces best practices and helps catch common mistakes when working with RxJS.

What are eslint-plugin-rxjs's main functionalities?

Enforce Creation Operators

This rule disallows the creation of new Observables using the constructor. Instead, it encourages the use of creation operators like `of`, `from`, etc.

/* eslint rxjs/no-create: 'error' */
import { Observable } from 'rxjs';
const observable = new Observable(observer => {
  observer.next('Hello World');
  observer.complete();
});

No Ignored Subscription

This rule ensures that subscriptions are not ignored. It helps in avoiding memory leaks by making sure that all subscriptions are properly handled.

/* eslint rxjs/no-ignored-subscription: 'error' */
import { of } from 'rxjs';
of('Hello World').subscribe();

No Subject Unsubscribe

This rule disallows calling `unsubscribe` on Subjects, as it can lead to unexpected behavior. Instead, it encourages the use of `complete`.

/* eslint rxjs/no-subject-unsubscribe: 'error' */
import { Subject } from 'rxjs';
const subject = new Subject();
subject.unsubscribe();

Other packages similar to eslint-plugin-rxjs

Keywords

FAQs

Package last updated on 27 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

  • 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