angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Add `rxjs/Rx` into `import-blacklist` in the default `tslint.json`

Open martinsik opened this issue 9 years ago • 6 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.3.2
node: 8.4.0
os: darwin x64

Desired functionality.

The default tslint.json generated prevents me from importing from rxjs such as:

import { Observable } from 'rxjs';

However it doesn't prevent me from using the following:

import { Observable } from 'rxjs/Rx';

This loads https://github.com/ReactiveX/rxjs/blob/master/src/Rx.ts file which means that importing rxjs/Rx is equivalent to rxjs (https://github.com/ReactiveX/rxjs/blob/master/.make-packages.js#L43).

I'd suggest to add rxjs/Rx into import-blacklist in the default tslint.json. I was trying to figure out where it comes from but I was not successful to be honest. Maybe this request should go into another repo?

martinsik avatar Sep 04 '17 12:09 martinsik

Heya, the files you're looking to update are in https://github.com/angular/devkit/blob/master/packages/schematics/angular/application/files/tslint.json. Can you submit a PR there?

filipesilva avatar Sep 05 '17 09:09 filipesilva

Can be closed by https://github.com/angular/devkit/pull/131

CaerusKaru avatar Oct 19 '17 18:10 CaerusKaru

Thanks @CaerusKaru 👍

filipesilva avatar Oct 20 '17 11:10 filipesilva

Hello, quick question. How can I get the tslint.json updated in my project? Do I have to do it manually? Or does a script exists? Thanks, Pierre

pierre-hilt avatar Oct 30 '17 12:10 pierre-hilt

@pierre-hilt it has to be done manually.

filipesilva avatar Nov 04 '17 18:11 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.