Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule idea: no-import-operators to make sure we import from rxjs instead of rxjs/operators #108

Open
the-ult opened this issue Feb 9, 2023 · 1 comment · May be fixed by #121
Open

Rule idea: no-import-operators to make sure we import from rxjs instead of rxjs/operators #108

the-ult opened this issue Feb 9, 2023 · 1 comment · May be fixed by #121

Comments

@the-ult
Copy link

the-ult commented Feb 9, 2023

Since rxjs 7.2.0 most operators have been moved to rxjs

With RxJS v7.2.0, most operators have been moved to 'rxjs' export site. This means that the preferred way to import operators is from 'rxjs', while 'rxjs/operators' export site has been deprecated.

It would be nice to have (fixable) rule, which makes sure you only import from rxjs

For example:

import { map } from 'rxjs/operators';

Should be

import { map } from 'rxjs';
@JasonWeinzierl
Copy link

I've implemented a rule prefer-root-operators in the forked package eslint-plugin-rxjs-x. Comes with an auto-fixer that handles the renamed operators too. Would welcome any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants