This rule enforces the use of Finnish notation - i.e. the $
suffix.
Examples of incorrect code for this rule:
const answers = of(42, 54);
Examples of correct code for this rule:
const answer$ = of(42, 54);
This rule accepts a single option which is an object with properties that determine whether Finnish notation is enforced for functions
, methods
, parameters
, properties
and variables
. It also contains:
names
andtypes
properties that determine whether of not Finnish notation is to be enforced for specific names or types.- a
strict
property that, iftrue
, allows the$
suffix to be used only with identifiers that have anObservable
type.
The default (Angular-friendly) configuration looks like this:
{
"rxjs/finnish": [
"error",
{
"functions": true,
"methods": true,
"names": {
"^(canActivate|canActivateChild|canDeactivate|canLoad|intercept|resolve|validate)$": false
},
"parameters": true,
"properties": true,
"strict": false,
"types": {
"^EventEmitter$": false
},
"variables": true
}
]
}
The properties in the options object are themselves optional; they do not all have to be specified.