Skip to content

Commit

Permalink
feat(settings): add noImplicitAny to compiler options
Browse files Browse the repository at this point in the history
- update typescript configuration
- eliminate noImplicitAny violations

addresses #536
  • Loading branch information
slegge committed Mar 25, 2021
1 parent cba4d52 commit c14b760
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import browser from 'browser-detect';
import { Component, OnInit } from '@angular/core';
import { MatSelectChange } from '@angular/material/select';
import { Store, select } from '@ngrx/store';
import { Observable } from 'rxjs';

Expand Down Expand Up @@ -81,7 +82,7 @@ export class AppComponent implements OnInit {
this.store.dispatch(authLogout());
}

onLanguageSelect({ value: language }) {
this.store.dispatch(actionSettingsChangeLanguage({ language }));
onLanguageSelect(event: MatSelectChange) {
this.store.dispatch(actionSettingsChangeLanguage({ language: event.value }));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const STEPS_ALL: any[] = [
{ optional: true }
)
];
const STEPS_NONE = [];
const STEPS_NONE: any[] = [];
const STEPS_PAGE = [STEPS_ALL[0], STEPS_ALL[2]];
const STEPS_ELEMENTS = [STEPS_ALL[1], STEPS_ALL[3]];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createSelector } from '@ngrx/store';

import { ExamplesState, selectExamples } from '../examples.state';
import { Todo } from './todos.model';

export const selectTodosState = createSelector(
selectExamples,
Expand All @@ -24,7 +25,7 @@ export const selectTodos = createSelector(
if (filter === 'ALL') {
return items;
} else {
const predicate = filter === 'DONE' ? (t) => t.done : (t) => !t.done;
const predicate = filter === 'DONE' ? (t: Todo) => t.done : (t: Todo) => !t.done;
return items.filter(predicate);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { MatSelectChange } from '@angular/material/select';
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
import { Store, select } from '@ngrx/store';
import { Observable } from 'rxjs';

Expand Down Expand Up @@ -54,25 +55,25 @@ export class SettingsContainerComponent implements OnInit {
this.store.dispatch(actionSettingsChangeLanguage({ language: change.value }));
}

onThemeSelect({ value: theme }) {
this.store.dispatch(actionSettingsChangeTheme({ theme }));
onThemeSelect(event: MatSelectChange) {
this.store.dispatch(actionSettingsChangeTheme({ theme: event.value }));
}

onAutoNightModeToggle({ checked: autoNightMode }) {
this.store.dispatch(actionSettingsChangeAutoNightMode({ autoNightMode }));
onAutoNightModeToggle(event: MatSlideToggleChange) {
this.store.dispatch(actionSettingsChangeAutoNightMode({ autoNightMode: event.checked }));
}

onStickyHeaderToggle({ checked: stickyHeader }) {
this.store.dispatch(actionSettingsChangeStickyHeader({ stickyHeader }));
onStickyHeaderToggle(event: MatSlideToggleChange) {
this.store.dispatch(actionSettingsChangeStickyHeader({ stickyHeader: event.checked }));
}

onPageAnimationsToggle({ checked: pageAnimations }) {
this.store.dispatch(actionSettingsChangeAnimationsPage({ pageAnimations }));
onPageAnimationsToggle(event: MatSlideToggleChange) {
this.store.dispatch(actionSettingsChangeAnimationsPage({ pageAnimations: event.checked }));
}

onElementsAnimationsToggle({ checked: elementsAnimations }) {
onElementsAnimationsToggle(event: MatSlideToggleChange) {
this.store.dispatch(
actionSettingsChangeAnimationsElements({ elementsAnimations })
actionSettingsChangeAnimationsElements({ elementsAnimations: event.checked })
);
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"experimentalDecorators": true,
"importHelpers": true,
"strictNullChecks": true,
"noImplicitAny": true,
"module": "esnext",
"target": "es2015",
"typeRoots": ["node_modules/@types"],
Expand Down

0 comments on commit c14b760

Please sign in to comment.