tslint-rxjs-subject-restrictions-rule

Custom tslint rule for linting rxjs subjects usage in your code

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
tslint-rxjs-subject-restrictions-rule
611.0.46 years ago6 years agoMinified + gzip package size for tslint-rxjs-subject-restrictions-rule in KB

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: ```ts import { BehaviorSubject } from "rxjs/BehaviorSubject"; class Car {
private isActive$ = new BehaviorSubject({})
} ``` Wrong: ```ts import { BehaviorSubject } from "rxjs/BehaviorSubject"; class Car {
public isActive = new BehaviorSubject({})
} ```

Installing / Getting started

Install: ```shell npm i -D tslint-rxjs-subject-restrictions-rule ``` Edit your tslint.json file: ```json "rulesDirectory": "nodemodules/tslint-rxjs-subject-restrictions-rule/dist" , "rules": {
"rx-subject-restrictions": true
} ```

Licensing

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