Skip to content

Commit 4cfcc08

Browse files
tja4472timdeschryver
authored andcommitted
fix(Example): linter problems (#1597)
1 parent 063fbe6 commit 4cfcc08

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

projects/example-app/src/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ exports[`Selected Book Page should compile 1`] = `
88
>
99
<bc-book-detail
1010
_nghost-c0=""
11+
ng-reflect-in-collection="false"
1112
>
1213
1314
</bc-book-detail>

projects/example-app/src/app/books/reducers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,6 @@ export const isSelectedBookInCollection = createSelector(
156156
getCollectionBookIds,
157157
getSelectedBookId,
158158
(ids, selected) => {
159-
return selected && ids.indexOf(selected) > -1;
159+
return !!selected && ids.indexOf(selected) > -1;
160160
}
161161
);

projects/example-app/src/app/core/containers/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class AppComponent {
3838
showSidenav$: Observable<boolean>;
3939
loggedIn$: Observable<boolean>;
4040

41-
constructor(private store: Store<fromRoot.State>) {
41+
constructor(private store: Store<fromRoot.State & fromAuth.State>) {
4242
/**
4343
* Selectors can be applied with the `select` operator which passes the state
4444
* tree to the provided selector

projects/example-app/src/app/core/reducers/layout.reducer.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import {
2-
LayoutActions
3-
} from '@example-app/core/actions';
1+
import { Action } from '@ngrx/store';
2+
import { LayoutActions } from '@example-app/core/actions';
43

54
export interface State {
65
showSidenav: boolean;
@@ -10,11 +9,10 @@ const initialState: State = {
109
showSidenav: false,
1110
};
1211

13-
export function reducer(
14-
state: State = initialState,
15-
action: LayoutActions.LayoutActionsUnion
16-
): State {
17-
switch (action.type) {
12+
export function reducer(state: State = initialState, action: Action): State {
13+
const specificAction = action as LayoutActions.LayoutActionsUnion;
14+
15+
switch (specificAction.type) {
1816
case LayoutActions.LayoutActionTypes.CloseSidenav:
1917
return {
2018
showSidenav: false,

projects/example-app/src/app/reducers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const reducers: ActionReducerMap<State> = {
4545

4646
// console.log all actions
4747
export function logger(reducer: ActionReducer<State>): ActionReducer<State> {
48-
return (state: State, action: any): any => {
48+
return (state, action) => {
4949
const result = reducer(state, action);
5050
console.groupCollapsed(action.type);
5151
console.log('prev state', state);

projects/example-app/tsconfig.app.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"compilerOptions": {
3+
"strict": true,
4+
"strictPropertyInitialization": false,
35
"sourceMap": true,
46
"declaration": false,
57
"moduleResolution": "node",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"@ngrx/schematics/schematics-core": [
3535
"./modules/schematics/schematics-core"
3636
],
37-
"@example-app/*": ["./projects/example-app/src/app/*"]
37+
"@example-app/*": ["./projects/example-app/src/app/*"],
38+
"ngrx-store-freeze": ["./projects/ngrx-store-freeze"]
3839
}
3940
},
4041
"exclude": [

0 commit comments

Comments
 (0)