# sample-demo-migration

> TSLint rule for RxJS

Latest version **0.1.2** (published 2018-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install sample-demo-migration
pnpm add sample-demo-migration
yarn add sample-demo-migration
bun add sample-demo-migration
```

Provides the command `rxjs-5-to-6-migrate`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-04-24 |
| First published | 2018-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 314 |
| Author | Minko Gechev |
| Maintainers | mgechev |
| Keywords | rxjs, lint, tslint |

## Links

- npm: https://www.npmjs.com/package/sample-demo-migration
- Repository: https://github.com/reactivex/rxjs-tslint
- Homepage: https://github.com/reactivex/rxjs-tslint#readme
- Issues: https://github.com/reactivex/rxjs-tslint/issues
- npm.io page: https://npm.io/package/sample-demo-migration

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^2.4.0
- [tslint](https://npm.io/package/tslint.md) ^5.9.1
- [tsutils](https://npm.io/package/tsutils.md) ^2.25.0
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [typescript](https://npm.io/package/typescript.md) ^2.8.3

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2018-04-24
- 0.1.1 — 2018-04-24

## README

# RxJS TSLint

TSLint rules for rxjs.

## Rules

This repository provides the following rules:

| Rule name                         | Configuration | Description                                          |
| --------------------------------- | ------------- | ---------------------------------------------------- |
| rxjs-collapse-imports             | none          | Collapses multiple imports from rxjs to a single one |
| rxjs-pipeable-operators-only      | none          | Migrates side-effect operators to pipeables          |
| rxjs-no-static-observable-methods | none          | Migrates static Observable method calls              |
| rxjs-proper-imports               | none          | Updates RxJS 5.x.x imports to RxJS 6.0               |

## Migration to RxJS 6

Using the current set of rules allows you to automatically migrate your project which uses RxJS 5 to RxJS 6. Here's how you can perform the automatic migration:

1.  Install `rxjs-tslint`:

```bash
npm i rxjs-tslint
```

2.  In your project's directory, create a file called `migrate-rxjs.tslint.json` with the following content:

```json
{
  "rulesDirectory": ["node_modules/rxjs-tslint"],
  "rules": {
    "rxjs-proper-imports": true,
    "rxjs-pipeable-operators-only": true,
    "rxjs-no-static-observable-methods": true,
    "rxjs-collapse-imports": true
  }
}
```

3.  Run tslint, pointing to the `tsconfig.json` file that you use for TypeScript compilation (this is used so the checks can use type information). For example if your `tsconfig` is in `src/tsconfig.app.json` (the default from Angular CLI), the command would be:

```bash
./node_modules/.bin/tslint -c migrate-rxjs.tslint.json --project src/tsconfig.app.json --fix
```

4.  Enjoy! 😎

#### Notes

* Once you run all the migrations check the diff and make sure that everything looks as expected. These fixers cover almost all cases we know of, but it's possible that some manual fixes can be required.
* Although the migration will format your source code, it's likely that that the style is not consistent with the rest of your project. To make sure that everything is properly following your project's style guide, we recommend you apply a formatter such as prettier or clang-format after the edits are made.

## License

MIT

---
_Source: https://npm.io/package/sample-demo-migration · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
