Skip to content

Commit

Permalink
Fix tslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamhency committed Feb 12, 2021
1 parent 2854771 commit 9c80eb8
Show file tree
Hide file tree
Showing 29 changed files with 49 additions and 40 deletions.
4 changes: 2 additions & 2 deletions projects/go-lib/src/lib/animations/_configs.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const timing = '.5s ';
export const easing = 'cubic-bezier(.25, .8, .25, 1)';
export const timing: string = '.5s ';
export const easing: string = 'cubic-bezier(.25, .8, .25, 1)';
5 changes: 3 additions & 2 deletions projects/go-lib/src/lib/animations/fade.animation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
animate,
AnimationTriggerMetadata,
state,
style,
transition,
Expand All @@ -8,7 +9,7 @@ import {

import { easing, timing } from './_configs';

export const fadeAnimation = trigger('fade', [
export const fadeAnimation: AnimationTriggerMetadata = trigger('fade', [
state('in', style({
opacity: 1,
visibility: 'visible'
Expand All @@ -22,7 +23,7 @@ export const fadeAnimation = trigger('fade', [
])
]);

export const fadeTemplateAnimation = trigger('fadeTemplate', [
export const fadeTemplateAnimation: AnimationTriggerMetadata = trigger('fadeTemplate', [
transition(':enter', [
style({
opacity: 0
Expand Down
3 changes: 2 additions & 1 deletion projects/go-lib/src/lib/animations/off-canvas.animation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
animate,
AnimationTriggerMetadata,
state,
style,
transition,
Expand All @@ -8,7 +9,7 @@ import {

import { easing, timing } from './_configs';

export const offCanvasAnimation = trigger('offCanvas', [
export const offCanvasAnimation: AnimationTriggerMetadata = trigger('offCanvas', [
state('slideIn', style({
transform: 'translateX(-{{width}})'
}), {params: {width: '300px'}}),
Expand Down
5 changes: 3 additions & 2 deletions projects/go-lib/src/lib/animations/search.animation.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {
animate,
AnimationTriggerMetadata,
style,
transition,
trigger
} from '@angular/animations';

import { easing, timing } from './_configs';

export const searchLoaderAnim = trigger('searchLoaderAnim', [
export const searchLoaderAnim: AnimationTriggerMetadata = trigger('searchLoaderAnim', [
transition(':enter', [
style({
height: 0,
Expand All @@ -32,7 +33,7 @@ export const searchLoaderAnim = trigger('searchLoaderAnim', [
])
]);

export const searchResultsAnim = trigger('searchResultsAnim', [
export const searchResultsAnim: AnimationTriggerMetadata = trigger('searchResultsAnim', [
transition(':enter', [
style({
height: 0,
Expand Down
3 changes: 2 additions & 1 deletion projects/go-lib/src/lib/animations/toasts.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {
animate,
AnimationTriggerMetadata,
style,
transition,
trigger
} from '@angular/animations';

import { easing, timing } from './_configs';

export const toastAnimation = trigger('toastAnimation', [
export const toastAnimation: AnimationTriggerMetadata = trigger('toastAnimation', [
transition(':enter', [
style({
height: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class GoActionSheetComponent {
'go-action-sheet__content-container--shift-left': this.shiftLeft,
'go-action-sheet__content-container--placement-bottom': this.placement === 'bottom',
'go-action-sheet__content-container--placement-right': this.placement === 'right'
}
};
}

private closeActionSheetEvent(target: HTMLElement): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnInit, OnChanges } from '@angular/core';
import { Component, Input, OnChanges } from '@angular/core';

@Component({
selector: 'go-icon',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class GoInputComponent implements OnInit {
}

if (this.maxlength > 524288) {
this.maxlength = 524288
this.maxlength = 524288;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export class GoModalService {
/**
* Opens an instance of the GoModal
* @param component Component to be rendered inside of Modal
* @param bindings Bindings for the Component being passed to the Modal. **Note: passing bindings for the Modal in this object is deprecated, use modalOptions instead.**
* @param bindings Bindings for the Component being passed to the Modal.
* **Note: passing bindings for the Modal in this object is deprecated, use modalOptions instead.**
* @param modalOptions Various configurations for the Modal.
*/
openModal<T>(component: Type<T>, bindings: Partial<T> | GoModalBindings, modalOptions?: GoModalOptions): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Directive, ViewContainerRef } from "@angular/core";
import { Directive, ViewContainerRef } from '@angular/core';

@Directive({
selector: '[go-off-canvas-host]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class GoTablePageConfig {
pageSizes: number[],
perPage?: number
}) {
if (fields) Object.assign(this, fields);
if (fields) { Object.assign(this, fields); }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class GoTableSortConfig {
column: string,
direction?: SortDirection
}) {
if (fields) Object.assign(this, fields);
if (fields) { Object.assign(this, fields); }
}
}

Expand Down
12 changes: 6 additions & 6 deletions projects/go-lib/src/lib/components/go-table/go-table-utils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export function extractFieldData(key: string, obj: object) {
export function extractFieldData(key: string, obj: object): any {
if (key) {
return key.split('.').reduce((p, c) => p && p[c], obj) || '';
return key.split('.').reduce((p: any, c: any) => p && p[c], obj) || '';
}
return '';
}

export function sortBy(key: string, reverse: boolean) {
return (a: any, b: any) => {
let aFieldData = extractFieldData(key, a);
let bFieldData = extractFieldData(key, b);
export function sortBy(key: string, reverse: boolean): Function {
return (a: object, b: object) => {
let aFieldData: any = extractFieldData(key, a);
let bFieldData: any = extractFieldData(key, b);
aFieldData = typeof aFieldData === 'string' ? aFieldData.toLowerCase() : aFieldData;
bFieldData = typeof bFieldData === 'string' ? bFieldData.toLowerCase() : bFieldData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export class GoTableComponent implements OnInit, OnChanges, OnDestroy, AfterView
selectedRows: !this.selectAllControl.value ? this.targetedRows : []
});
}
)
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class GoTimepickerComponent implements OnInit {
}

public changeTimeFormat(timeString: string | Date): string {
if (!timeString || timeString == 'Invalid Date') {
if (!timeString || timeString === 'Invalid Date') {
return;
}
if (typeof(timeString) === 'object') {
Expand Down Expand Up @@ -86,6 +86,7 @@ export class GoTimepickerComponent implements OnInit {
if (time12h) {
const [time, modifier]: string[] = time12h.split(' ');

// tslint:disable-next-line: prefer-const
let [hours, minutes]: any[] = time.split(':');
if (hours === '12') {
hours = '00';
Expand Down
2 changes: 1 addition & 1 deletion projects/go-lib/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ getTestBed().initTestEnvironment(
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
const context: any = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class FormsOverviewComponent {
private subNavService: SubNavService
) {
this.subNavService.pageTitle = 'Forms Overview';
this.subNavService.linkToSource = "https://github.com/mobi/goponents/tree/dev/projects/go-style-guide/src/app/features/standards/components/forms"
this.subNavService.linkToSource =
'https://github.com/mobi/goponents/tree/dev/projects/go-style-guide/src/app/features/standards/components/forms';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export class SelectDocsComponent implements OnInit {
of([]),
this.itemInput.pipe(
debounceTime(600), // Delay user input
map((input) => [input])
map((input: string) => [input])
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class FormDocsComponent {

constructor(private subNavService: SubNavService) {
this.subNavService.pageTitle = 'Forms';
this.subNavService.linkToSource = "https://github.com/mobi/goponents/tree/dev/projects/go-style-guide/src/app/features/standards/components/forms"
this.subNavService.linkToSource =
'https://github.com/mobi/goponents/tree/dev/projects/go-style-guide/src/app/features/standards/components/forms';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class IconDocsComponent {
`;

linkToSource: string = 'https://github.com/mobi/goponents/tree/dev/projects/go-lib/src/lib/components/go-icon';

constructor() { }

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class LayoutNavComponent {
routeActive?: boolean;
/**
* When isExternalLink is true, the value passed to route will be used for redirection. By default, all external
* When isExternalLink is true, the value passed to route will be used for redirection. By default, all external
* links will open in a new tab unless a different target is specified within externalLinkTarget.
*/
isExternalLink?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class TabDocsComponent {
</go-tab>
<go-tab heading="Tab 3">
<ng-template #tabContent>
This is a third thing.
This is a third thing.
</ng-template>
</go-tab>
</go-tab-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export class ToastDocsComponent {
</go-toast>
`;
action_btn_html: string = `
<go-toast
type="neutral"
header="Hey!"
message="Did you know that this is pretty cool?"
<go-toast
type="neutral"
header="Hey!"
message="Did you know that this is pretty cool?"
[showToastActions]="true">
<ng-container go-toast-action>
<div class="go-button-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import { ToastDocsComponent } from './components/toast-docs/toast-docs.component
import { UiKitComponent } from './components/ui-kit/ui-kit.component';
import { BasicTestComponent } from './components/basic-test/basic-test.component';
import { OffCanvasDocsComponent } from './components/off-canvas-docs/off-canvas-docs.component';
import { PortalDocsComponent } from './components/portal-docs/portal-docs.component'
import { PortalDocsComponent } from './components/portal-docs/portal-docs.component';
import { LoaderDocsComponent } from './components/loader-docs/loader-docs.component';
import { LayoutAppDrawerComponent } from './components/layout-docs/components/layout-app-drawer/layout-app-drawer.component';
import { LayoutDocsComponent } from './components/layout-docs/layout-docs.component';
Expand Down
3 changes: 2 additions & 1 deletion projects/go-style-guide/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

import {
GoIconModule, GoButtonModule
GoButtonModule,
GoIconModule
} from 'projects/go-lib/src/public_api';

import { SubNavComponent } from './components/sub-nav/sub-nav.component';
Expand Down
2 changes: 1 addition & 1 deletion projects/go-style-guide/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if (environment.production) {
}

platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
.catch((err: any) => console.error(err));
2 changes: 1 addition & 1 deletion projects/go-style-guide/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ getTestBed().initTestEnvironment(
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
const context: any = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
2 changes: 1 addition & 1 deletion projects/go-tester/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const environment = {
export const environment: any = {
production: true
};
2 changes: 1 addition & 1 deletion projects/go-tester/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
export const environment: any = {
production: false
};

Expand Down

0 comments on commit 9c80eb8

Please sign in to comment.