Skip to content

Commit 73872cc

Browse files
committed
feat(example): Configure ng-cli-example linting.
1 parent 7209895 commit 73872cc

File tree

8 files changed

+40
-1
lines changed

8 files changed

+40
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": [
3+
"../tslint.json"
4+
],
5+
"rules": {
6+
"rxjs-add": { "severity": "off" }
7+
}
8+
}

examples/ng-cli-example/package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/ng-cli-example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"karma-jasmine": "~1.1.0",
4343
"karma-jasmine-html-reporter": "^0.2.2",
4444
"protractor": "~5.1.2",
45+
"rxjs-tslint-rules": "^3.0.3",
4546
"ts-node": "~3.2.0",
4647
"tslint": "~5.7.0",
4748
"typescript": "~2.3.3"

examples/ng-cli-example/src/app/app.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component } from '@angular/core';
2+
import { Observable } from 'rxjs/Observable';
23

34
@Component({
45
selector: 'app-root',
@@ -7,4 +8,8 @@ import { Component } from '@angular/core';
78
})
89
export class AppComponent {
910
title = 'app';
11+
12+
constructor() {
13+
const obs = Observable.of(1).map(value => value + 1);
14+
}
1015
}

examples/ng-cli-example/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import './rxjs.imports';
2+
13
import { enableProdMode } from '@angular/core';
24
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import 'rxjs/add/observable/of';
2+
import 'rxjs/add/operator/map';

examples/ng-cli-example/src/tsconfig.spec.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
]
1212
},
1313
"files": [
14+
"rxjs.imports.ts",
1415
"test.ts"
1516
],
1617
"include": [

examples/ng-cli-example/tslint.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"extends": [
3+
"rxjs-tslint-rules"
4+
],
25
"rulesDirectory": [
36
"node_modules/codelyzer"
47
],
@@ -136,6 +139,14 @@
136139
"use-pipe-transform-interface": true,
137140
"component-class-suffix": true,
138141
"directive-class-suffix": true,
139-
"invoke-injectable": true
142+
"invoke-injectable": true,
143+
"rxjs-add": {
144+
"options": [{
145+
"allowElsewhere": false,
146+
"allowUnused": false,
147+
"file": "./src/rxjs.imports.ts"
148+
}],
149+
"severity": "error"
150+
}
140151
}
141152
}

0 commit comments

Comments
 (0)