rxjs-tslint icon indicating copy to clipboard operation
rxjs-tslint copied to clipboard

Incorrectly imports constants as functions

Open 0x-r4bbit opened this issue 7 years ago • 3 comments

Before

import { never } from 'rxjs/observable/never

After

import { NEVER as never } from 'rxjs';

^ This shouldn't be.

0x-r4bbit avatar May 01 '18 10:05 0x-r4bbit

this should be:

import { NEVER } from rxjs'``

and then usage is just:

NEVER (not never() or NEVER())

benlesh avatar May 01 '18 20:05 benlesh

This will require the development of a new rule in order to be properly solved. Not sure if I'll be able to work on this in the next a couple of weeks.

mgechev avatar May 02 '18 03:05 mgechev

Something to watch out for is that empty can be passed a scheduler argument, so simply replacing the call with the constant could change behaviour.

cartant avatar May 09 '18 07:05 cartant