Skip to content

Commit c1ae59e

Browse files
Updates for stricter TSConfig settings. (#46)
Unfortunately `noUnusedLocals` and `noUnusedParameters` cause propblems for AoT and `@Output`-related EventEmitters. See angular/angular#17131 Once that's fixed in Angular itself then we can turn those checks back on here. Note that they work already in JiT mode.
1 parent ecb9cf3 commit c1ae59e

17 files changed

+93
-54
lines changed

Diff for: package-lock.json

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

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
},
1414
"private": true,
1515
"dependencies": {
16-
"@angular-redux/form": "^6.3.0",
16+
"@angular-redux/form": "^6.5.2",
1717
"@angular-redux/router": "^6.3.1",
18-
"@angular-redux/store": "^6.5.5",
18+
"@angular-redux/store": "^6.5.6",
1919
"@angular/common": "^4.1.0",
2020
"@angular/compiler": "^4.1.0",
2121
"@angular/core": "^4.1.0",

Diff for: src/app/animals/animal/component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
2-
import { NgRedux, dispatch, select, select$, WithSubStore } from '@angular-redux/store';
2+
import { dispatch, select, select$, WithSubStore } from '@angular-redux/store';
33
import { Observable } from 'rxjs/Observable';
44

5-
import { IAppState } from '../../store/model';
65
import { animalComponentReducer } from './reducers';
76
import { IAnimal } from '../model';
87

Diff for: src/app/animals/animal/reducers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Reducer, Action, combineReducers } from 'redux';
1+
import { Reducer, Action } from 'redux';
22
import { AnimalComponent } from './component';
33

44
export const ticketsReducer: Reducer<number> = (state = 0, action: Action): number => {

Diff for: src/app/animals/api/epics.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import 'rxjs/add/operator/do';
77
import 'rxjs/add/operator/startWith';
88

99
import { IAppState } from '../../store/model';
10-
import { AnimalType, ANIMAL_TYPES } from '../model';
10+
import { AnimalType } from '../model';
1111
import { AnimalAPIAction, AnimalAPIActions } from './actions';
1212
import { AnimalAPIService } from './service';
1313

14-
type Predicate = (any) => boolean;
15-
1614
const animalsNotAlreadyFetched = (
1715
animalType: AnimalType,
1816
state: IAppState): boolean => !(
@@ -35,12 +33,12 @@ export class AnimalAPIEpics {
3533
return createEpicMiddleware(this.createLoadAnimalEpic(animalType));
3634
}
3735

38-
private createLoadAnimalEpic(animalType): Epic<AnimalAPIAction, IAppState> {
36+
private createLoadAnimalEpic(animalType: AnimalType): Epic<AnimalAPIAction, IAppState> {
3937
return (action$, store) => action$
4038
.ofType(AnimalAPIActions.LOAD_ANIMALS)
4139
.filter(action => actionIsForCorrectAnimalType(animalType)(action))
4240
.filter(() => animalsNotAlreadyFetched(animalType, store.getState()))
43-
.switchMap(a => this.service.getAll(animalType)
41+
.switchMap(() => this.service.getAll(animalType)
4442
.map(data => this.actions.loadSucceeded(animalType, data))
4543
.catch(response => of(this.actions.loadFailed(animalType, {
4644
status: '' + response.status,

Diff for: src/app/animals/api/reducer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AnimalAPIAction, AnimalAPIActions } from './actions';
2-
import { IAnimalList, IAnimal, AnimalType } from '../model';
2+
import { IAnimalList, AnimalType } from '../model';
33
import { indexBy, prop } from 'ramda';
44
import { Action } from 'redux';
55

Diff for: src/app/elephants/page.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Observable } from 'rxjs/Observable';
55

66
import { AnimalAPIActions } from '../animals/api/actions';
77
import { ANIMAL_TYPES, IAnimal } from '../animals/model';
8-
import { IAppState } from '../store/model';
98

109
export const sortAnimals = (animalDictionary$: Observable<{}>) =>
1110
animalDictionary$.map(

Diff for: src/app/feedback/page.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { Component, ChangeDetectionStrategy } from '@angular/core';
2-
import { Connect } from '@angular-redux/form';
3-
import { NgRedux, select$ } from '@angular-redux/store';
2+
import { select$ } from '@angular-redux/store';
43
import { Observable } from 'rxjs/Observable';
5-
import { of } from 'rxjs/observable/of';
6-
import { IAppState } from '../store/model';
74

85
const MAX_COMMENT_CHARS = 300;
96

Diff for: src/app/lions/page.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { pipe, values, sortBy, prop } from 'ramda';
55

66
import { AnimalAPIActions } from '../animals/api/actions';
77
import { ANIMAL_TYPES, IAnimal } from '../animals/model';
8-
import { IAppState } from '../store/model';
98

109
export const sortAnimals = (animalDictionary$: Observable<{}>) =>
1110
animalDictionary$.map(

Diff for: src/app/store/epics.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Injectable } from '@angular/core';
2-
import { combineEpics } from 'redux-observable';
32

43
import { ANIMAL_TYPES } from '../animals/model';
54
import { AnimalAPIEpics } from '../animals/api/epics';

Diff for: src/app/store/model.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { IAnimalList } from '../animals/model';
22

33
export interface IAppState {
4-
elephants?: IAnimalList;
5-
lions?: IAnimalList;
4+
[animalType: string]: IAnimalList;
65
routes?: any;
76
feedback?: any;
87
}

Diff for: src/app/store/module.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { provideReduxForms } from '@angular-redux/form';
1010

1111
// Redux ecosystem stuff.
1212
import { createLogger } from 'redux-logger';
13-
import { combineEpics, createEpicMiddleware } from 'redux-observable';
1413

1514
// The top-level reducers and epics that make up our app's logic.
1615
import { IAppState } from './model';

Diff for: src/tsconfig.app.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
"target": "es5",
1414
"module": "es2015",
1515
"baseUrl": "",
16-
"types": []
16+
"types": [],
17+
18+
// Causes problems for @Outputs. See https://github.com/angular/angular/issues/17131.
19+
// "noUnusedParameters": true,
20+
// "noUnusedLocals": true,
21+
22+
"forceConsistentCasingInFileNames": true,
23+
"pretty": true
1724
},
1825
"exclude": [
1926
"test.ts",

Diff for: src/tsconfig.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
"typeRoots": [
1515
"../node_modules/@types"
1616
],
17-
"strict": true
17+
"strict": true,
18+
19+
// Causes problems for @Outputs with AoT.
20+
// See https://github.com/angular/angular/issues/17131.
21+
// "noUnusedParameters": true,
22+
// "noUnusedLocals": true,
23+
24+
"forceConsistentCasingInFileNames": true,
25+
"pretty": true
1826
}
1927
}

Diff for: src/tsconfig.spec.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@
1616
"jasmine",
1717
"node"
1818
],
19-
"strict": true
19+
"strict": true,
20+
21+
// Causes problems for @Outputs with AoT.
22+
// See https://github.com/angular/angular/issues/17131.
23+
// "noUnusedParameters": true,
24+
// "noUnusedLocals": true,
25+
26+
"forceConsistentCasingInFileNames": true,
27+
"pretty": true
2028
},
2129
"files": [
2230
"test.ts"

Diff for: tsconfig.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"experimentalDecorators": true,
1010
"lib": [
1111
"es2016"
12-
]
12+
],
13+
14+
// Causes problems for @Outputs with AoT.
15+
// See https://github.com/angular/angular/issues/17131.
16+
// "noUnusedParameters": true,
17+
// "noUnusedLocals": true,
18+
19+
"forceConsistentCasingInFileNames": true,
20+
"pretty": true
1321
}
1422
}

Diff for: yarn.lock

+39-20
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# yarn lockfile v1
33

44

5-
"@angular-redux/form@^6.3.0":
6-
version "6.5.0"
7-
resolved "https://registry.yarnpkg.com/@angular-redux/form/-/form-6.5.0.tgz#1c9dae68545197fd60915a90b4d89f6a687b9876"
5+
"@angular-redux/form@^6.5.2":
6+
version "6.5.2"
7+
resolved "https://registry.yarnpkg.com/@angular-redux/form/-/form-6.5.2.tgz#bf400593f93bb2f809be5cedbff36ce6a65c2d09"
88
dependencies:
99
immutable "^3.8.1"
1010

1111
"@angular-redux/router@^6.3.1":
1212
version "6.3.1"
1313
resolved "https://registry.yarnpkg.com/@angular-redux/router/-/router-6.3.1.tgz#847f790b3e3b2d1c8bdad4d4bf3068cd4e0fbf07"
1414

15-
"@angular-redux/store@^6.5.5":
16-
version "6.5.5"
17-
resolved "https://registry.yarnpkg.com/@angular-redux/store/-/store-6.5.5.tgz#e1b5c09b42b5ba7d1b375372654e637e312bff31"
15+
"@angular-redux/store@^6.5.6":
16+
version "6.5.6"
17+
resolved "https://registry.yarnpkg.com/@angular-redux/store/-/store-6.5.6.tgz#74fec2f7126c0023f9221710c11b9c2502006c9e"
1818

1919
"@angular/[email protected]":
2020
version "1.0.1"
@@ -769,7 +769,7 @@ center-align@^0.1.1:
769769
align-text "^0.1.3"
770770
lazy-cache "^1.0.3"
771771

772-
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
772+
chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
773773
version "1.1.3"
774774
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
775775
dependencies:
@@ -779,7 +779,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
779779
strip-ansi "^3.0.0"
780780
supports-color "^2.0.0"
781781

782-
chalk@^2.0.1:
782+
chalk@^2.0.0, chalk@^2.0.1:
783783
version "2.0.1"
784784
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d"
785785
dependencies:
@@ -2233,11 +2233,11 @@ ini@^1.3.4, ini@~1.3.0:
22332233
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
22342234

22352235
inquirer@^3.0.0:
2236-
version "3.1.1"
2237-
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534"
2236+
version "3.2.0"
2237+
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.0.tgz#45b44c2160c729d7578c54060b3eed94487bb42b"
22382238
dependencies:
22392239
ansi-escapes "^2.0.0"
2240-
chalk "^1.0.0"
2240+
chalk "^2.0.0"
22412241
cli-cursor "^2.1.0"
22422242
cli-width "^2.0.0"
22432243
external-editor "^2.0.4"
@@ -2247,8 +2247,8 @@ inquirer@^3.0.0:
22472247
run-async "^2.2.0"
22482248
rx-lite "^4.0.8"
22492249
rx-lite-aggregates "^4.0.8"
2250-
string-width "^2.0.0"
2251-
strip-ansi "^3.0.0"
2250+
string-width "^2.1.0"
2251+
strip-ansi "^4.0.0"
22522252
through "^2.3.6"
22532253

22542254
interpret@^1.0.0:
@@ -2737,8 +2737,8 @@ lcid@^1.0.0:
27372737
invert-kv "^1.0.0"
27382738

27392739
less-loader@^4.0.2:
2740-
version "4.0.4"
2741-
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-4.0.4.tgz#b4a8c43843e65c67d2ea2eb1465b5c4233d5006a"
2740+
version "4.0.5"
2741+
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-4.0.5.tgz#ae155a7406cac6acd293d785587fcff0f478c4dd"
27422742
dependencies:
27432743
clone "^2.1.1"
27442744
loader-utils "^1.1.0"
@@ -2954,7 +2954,11 @@ miller-rabin@^4.0.0:
29542954
bn.js "^4.0.0"
29552955
brorand "^1.0.1"
29562956

2957-
"mime-db@>= 1.27.0 < 2", mime-db@~1.27.0:
2957+
"mime-db@>= 1.27.0 < 2":
2958+
version "1.28.0"
2959+
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.28.0.tgz#fedd349be06d2865b7fc57d837c6de4f17d7ac3c"
2960+
2961+
mime-db@~1.27.0:
29582962
version "1.27.0"
29592963
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1"
29602964

@@ -3813,10 +3817,14 @@ punycode@^1.2.4, punycode@^1.4.1:
38133817
version "1.4.1"
38143818
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
38153819

3816-
[email protected], q@^1.1.2, q@^1.4.1:
3820+
38173821
version "1.4.1"
38183822
resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
38193823

3824+
q@^1.1.2, q@^1.4.1:
3825+
version "1.5.0"
3826+
resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1"
3827+
38203828
qjobs@^1.1.4:
38213829
version "1.1.5"
38223830
resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.1.5.tgz#659de9f2cf8dcc27a1481276f205377272382e73"
@@ -4544,7 +4552,7 @@ string-width@^1.0.1, string-width@^1.0.2:
45444552
is-fullwidth-code-point "^1.0.0"
45454553
strip-ansi "^3.0.0"
45464554

4547-
string-width@^2.0.0:
4555+
string-width@^2.1.0:
45484556
version "2.1.0"
45494557
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.0.tgz#030664561fc146c9423ec7d978fe2457437fe6d0"
45504558
dependencies:
@@ -5169,13 +5177,20 @@ wrappy@1:
51695177
version "1.0.2"
51705178
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
51715179

5172-
[email protected], ws@^1.0.1:
5180+
51735181
version "1.1.2"
51745182
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.2.tgz#8a244fa052401e08c9886cf44a85189e1fd4067f"
51755183
dependencies:
51765184
options ">=0.0.5"
51775185
ultron "1.0.x"
51785186

5187+
ws@^1.0.1:
5188+
version "1.1.4"
5189+
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61"
5190+
dependencies:
5191+
options ">=0.0.5"
5192+
ultron "1.0.x"
5193+
51795194
51805195
version "1.0.0"
51815196
resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"
@@ -5198,7 +5213,11 @@ xml2js@^0.4.17:
51985213
sax ">=0.6.0"
51995214
xmlbuilder "^4.1.0"
52005215

5201-
xmlbuilder@>=1.0.0, xmlbuilder@^4.1.0:
5216+
xmlbuilder@>=1.0.0:
5217+
version "9.0.1"
5218+
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.1.tgz#91cd70897755363eba57c12ddeeab4a341a61f65"
5219+
5220+
xmlbuilder@^4.1.0:
52025221
version "4.2.1"
52035222
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-4.2.1.tgz#aa58a3041a066f90eaa16c2f5389ff19f3f461a5"
52045223
dependencies:

0 commit comments

Comments
 (0)