JSPM

tslint-rxjs-subject-restrictions-rule

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 111
  • Score
    100M100P100Q96920F
  • License MIT

Custom tslint rule for linting rxjs subjects usage in your code

Package Exports

  • tslint-rxjs-subject-restrictions-rule

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tslint-rxjs-subject-restrictions-rule) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RxJs Subject Restrictions rule

Custom rule for tslint

NPM

www.npmjs.com/package/tslint-rxjs-subject-restrictions-rule

Description

Public access modifier for RxJS Subject is not allowed'. The name of RxJS Subject variable must ends with "$".

Example

Right:

import { BehaviorSubject } from "rxjs/BehaviorSubject";

class Car {
    private isActive$ = new BehaviorSubject({})
}

Wrong:

import { BehaviorSubject } from "rxjs/BehaviorSubject";

class Car {
    public isActive = new BehaviorSubject({})
}

Installing / Getting started

Install:

npm i -D tslint-rxjs-subject-restrictions-rule

Edit your tslint.json file:

"rulesDirectory": [
  "node_modules/tslint-rxjs-subject-restrictions-rule/dist"
],
"rules": {
    "rx-subject-restrictions": true
}

Licensing

"The code in this project is licensed under MIT license."