Custom rule for tslint
www.npmjs.com/package/tslint-rxjs-subject-restrictions-rule
Public access modifier for RxJS Subject is not allowed'. The name of RxJS Subject variable must ends with "$".
Right:
import { BehaviorSubject } from "rxjs/BehaviorSubject";
class Car {
private isActive$ = new BehaviorSubject({})
}
Wrong:
import { BehaviorSubject } from "rxjs/BehaviorSubject";
class Car {
public isActive = new BehaviorSubject({})
}
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
}
"The code in this project is licensed under MIT license."