Skip to content

Commit 186ab4d

Browse files
authored
feat: expose a global executable (#19)
Now the migration is as follow: ``` npm i -g rxjs-tslint rxjs-5-to-6-migrate -p [PATH_TO_TSCONFIG] ``` **Important**: the package introduces tslint and TypeScript as dependencies. This helps us to make sure we're using the right version (see #1).
1 parent fe88cbb commit 186ab4d

9 files changed

+182
-112
lines changed

README.md

+5-22
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,18 @@ This repository provides the following rules:
1717

1818
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:
1919

20-
1. Install `rxjs-tslint`:
21-
2220
```bash
23-
npm i rxjs-tslint
24-
```
25-
26-
2. In your project's directory, create a file called `migrate-rxjs.tslint.json` with the following content:
27-
28-
```json
29-
{
30-
"rulesDirectory": ["node_modules/rxjs-tslint"],
31-
"rules": {
32-
"rxjs-proper-imports": true,
33-
"rxjs-pipeable-operators-only": true,
34-
"rxjs-no-static-observable-methods": true,
35-
"rxjs-collapse-imports": true
36-
}
37-
}
21+
npm i -g rxjs-tslint
22+
rxjs-5-to-6-migrate -p [PATH_TO_TSCONFIG]
3823
```
3924

40-
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:
25+
For an Angular CLI project the invocation of `rxjs-5-to-6-migrate` will be:
4126

4227
```bash
43-
./node_modules/.bin/tslint -c migrate-rxjs.tslint.json --project src/tsconfig.app.json --fix
28+
rxjs-5-to-6-migrate -p src/tsconfig.app.json
4429
```
4530

46-
4. Enjoy! 😎
47-
48-
#### Notes
31+
### Notes
4932

5033
* 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.
5134
* 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.

bin/rxjs-5-to-6-migrate

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
3+
require('../rxjs-5-to-6-migrate');
4+

package-lock.json

+121-68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)