Skip to content

Commit

Permalink
chore: tslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pimenovoleg committed Oct 5, 2018
1 parent a5dc5eb commit 6bb0a40
Show file tree
Hide file tree
Showing 40 changed files with 312 additions and 277 deletions.
11 changes: 6 additions & 5 deletions src/cdk/a11y/a11y-module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {CdkMonitorFocus, FOCUS_MONITOR_PROVIDER} from './focus-monitor/focus-monitor';
import {PlatformModule} from '@ptsecurity/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { PlatformModule } from '@ptsecurity/cdk/platform';

import { CdkMonitorFocus, FOCUS_MONITOR_PROVIDER } from './focus-monitor/focus-monitor';


@NgModule({
imports: [CommonModule, PlatformModule],
declarations: [CdkMonitorFocus],
exports: [CdkMonitorFocus],
providers: [
FOCUS_MONITOR_PROVIDER,
FOCUS_MONITOR_PROVIDER
]
})
export class A11yModule {}
8 changes: 4 additions & 4 deletions src/cdk/a11y/aria-describer/aria-describer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Component, ElementRef, ViewChild} from '@angular/core';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import { Component, ElementRef, ViewChild } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import {A11yModule, CDK_DESCRIBEDBY_HOST_ATTRIBUTE} from '../index';
import { A11yModule, CDK_DESCRIBEDBY_HOST_ATTRIBUTE } from '../index';

import {AriaDescriber, MESSAGES_CONTAINER_ID} from './aria-describer';
import { AriaDescriber, MESSAGES_CONTAINER_ID } from './aria-describer';


describe('AriaDescriber', () => {
Expand Down
9 changes: 5 additions & 4 deletions src/cdk/a11y/focus-monitor/focus-monitor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { A11yModule } from '../index';
import { FocusMonitor, FocusOrigin, TOUCH_BUFFER_MS } from './focus-monitor';


/* tslint:disable:no-magic-numbers */
// tslint:disable:no-magic-numbers
// tslint:disable no-unbound-method
describe('FocusMonitor', () => {
let fixture: ComponentFixture<PlainButton>;
let buttonElement: HTMLElement;
Expand Down Expand Up @@ -226,7 +227,7 @@ describe('cdkMonitorFocus', () => {
ButtonWithFocusClasses,
ComplexComponentWithMonitorElementFocus,
ComplexComponentWithMonitorSubtreeFocus,
ComplexComponentWithMonitorSubtreeFocusAndMonitorElementFocus,
ComplexComponentWithMonitorSubtreeFocusAndMonitorElementFocus
]
}).compileComponents();
});
Expand Down Expand Up @@ -474,8 +475,8 @@ class PlainButton {
<button cdkMonitorElementFocus (cdkFocusChange)="focusChanged($event)"></button>`
})
class ButtonWithFocusClasses {
focusChanged(_origin: FocusOrigin) {
}
// tslint:disable-next-line
focusChanged(_origin: FocusOrigin) {}
}


Expand Down
2 changes: 1 addition & 1 deletion src/cdk/bidi/directionality.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Directionality', () => {
TestBed.configureTestingModule({
imports: [BidiModule],
declarations: [ElementWithDir, InjectsDirectionality],
providers: [{ provide: DIR_DOCUMENT, useFactory: () => fakeDocument }],
providers: [{ provide: DIR_DOCUMENT, useFactory: () => fakeDocument }]
}).compileComponents();
}));

Expand Down
2 changes: 1 addition & 1 deletion src/cdk/coercion/array.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {coerceArray} from './array';
import { coerceArray } from './array';


describe('coerceArray', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/coercion/boolean-property.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {coerceBooleanProperty} from './boolean-property';
import { coerceBooleanProperty } from './boolean-property';


describe('coerceBooleanProperty', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/coercion/css-pixel-value.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {coerceCssPixelValue} from './css-pixel-value';
import { coerceCssPixelValue } from './css-pixel-value';


describe('coerceCssPixelValue', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/cdk/coercion/number-property.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {coerceNumberProperty} from './number-property';
//tslint:disable
import { coerceNumberProperty } from './number-property';


//tslint:disable
describe('coerceNumberProperty', () => {

it('should coerce undefined to 0 or default', () => {
Expand Down
1 change: 1 addition & 0 deletions src/cdk/collections/array-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export class ArrayDataSource<T> extends DataSource<T> {
return this._data instanceof Observable ? this._data : observableOf(this._data);
}

// tslint:disable-next-line
disconnect() {}
}
1 change: 1 addition & 0 deletions src/cdk/collections/collection-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Observable } from 'rxjs';


/** Represents a range of numbers with a specified start and end. */
// tslint:disable-next-line
export type ListRange = { start: number, end: number };


Expand Down
2 changes: 2 additions & 0 deletions src/cdk/collections/selection.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getMultipleValuesInSingleSelectionError, SelectionModel } from './selection';


// tslint:disable:no-magic-numbers
// tslint:disable no-unbound-method
describe('SelectionModel', () => {
describe('single selection', () => {
let model: SelectionModel<any>;
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/collections/unique-selection-dispatcher.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UniqueSelectionDispatcher} from './unique-selection-dispatcher';
import { UniqueSelectionDispatcher } from './unique-selection-dispatcher';


describe('Unique selection dispatcher', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/cdk/layout/breakpoints-observer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, NgZone, OnDestroy } from '@angular/core';
import { coerceArray } from '@ptsecurity/cdk/coercion';
import {asapScheduler, combineLatest, fromEventPattern, Observable, Subject} from 'rxjs';
import {debounceTime, map, startWith, takeUntil} from 'rxjs/operators';
import { asapScheduler, combineLatest, fromEventPattern, Observable, Subject } from 'rxjs';
import { debounceTime, map, startWith, takeUntil } from 'rxjs/operators';

import { MediaMatcher } from './media-matcher';

Expand Down Expand Up @@ -76,7 +76,7 @@ export class BreakpointObserver implements OnDestroy {
map((breakpointStates: InternalBreakpointState[]) => {
const response: IBreakpointState = {
matches: false,
breakpoints: {},
breakpoints: {}
};

breakpointStates.forEach((state: InternalBreakpointState) => {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/layout/layout-module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import {NgModule} from '@angular/core';
import { NgModule } from '@angular/core';


@NgModule()
Expand Down
12 changes: 6 additions & 6 deletions src/cdk/portal/portal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CommonModule} from '@angular/common';
import { CommonModule } from '@angular/common';
import {
NgModule,
Component,
Expand All @@ -13,11 +13,11 @@ import {
TemplateRef,
ComponentRef
} from '@angular/core';
import {inject, ComponentFixture, TestBed} from '@angular/core/testing';
import { inject, ComponentFixture, TestBed } from '@angular/core/testing';

import {DomPortalOutlet} from './dom-portal-outlet';
import {Portal, ComponentPortal, TemplatePortal} from './portal';
import {CdkPortal, CdkPortalOutlet, PortalModule} from './portal-directives';
import { DomPortalOutlet } from './dom-portal-outlet';
import { Portal, ComponentPortal, TemplatePortal } from './portal';
import { CdkPortal, CdkPortalOutlet, PortalModule } from './portal-directives';


describe('Portals', () => {
Expand Down Expand Up @@ -533,7 +533,7 @@ class PortalTestApp {
@ViewChild(CdkPortalOutlet) portalOutlet: CdkPortalOutlet;
@ViewChild('templateRef', { read: TemplateRef }) templateRef: TemplateRef<any>;

selectedPortal: Portal<any>|undefined;
selectedPortal: Portal<any> | undefined;
fruit: string = 'Banana';
fruits = ['Apple', 'Pineapple', 'Durian'];
attachedSpy = jasmine.createSpy('attached spy');
Expand Down
14 changes: 7 additions & 7 deletions src/cdk/scrolling/scroll-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
NgZone,
OnDestroy
} from '@angular/core';
import {Platform} from '@ptsecurity/cdk/platform';
import {fromEvent, of as observableOf, Subject, Subscription, Observable} from 'rxjs';
import {auditTime, filter} from 'rxjs/operators';
import { Platform } from '@ptsecurity/cdk/platform';
import { fromEvent, of as observableOf, Subject, Subscription, Observable } from 'rxjs';
import { auditTime, filter } from 'rxjs/operators';

import {CdkScrollable} from './scrollable';
import { CdkScrollable } from './scrollable';


/** Time in ms to throttle the scrolling events by default. */
Expand All @@ -31,7 +31,7 @@ export class ScrollDispatcher implements OnDestroy {
_globalSubscription: Subscription | null = null;

/** Subject for notifying that a registered scrollable reference element has been scrolled. */
private _scrolled = new Subject<CdkScrollable|{}|void>();
private _scrolled = new Subject<CdkScrollable | {} | void>();

/** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */
private _scrolledCount = 0;
Expand Down Expand Up @@ -73,7 +73,7 @@ export class ScrollDispatcher implements OnDestroy {
* If you need to update any data bindings as a result of a scroll event, you have
* to run the callback using `NgZone.run`.
*/
scrolled(auditTimeInMs: number = DEFAULT_SCROLL_TIME): Observable<CdkScrollable|void> {
scrolled(auditTimeInMs: number = DEFAULT_SCROLL_TIME): Observable<CdkScrollable | void> {
return this._platform.isBrowser ? Observable.create((observer) => {
if (!this._globalSubscription) {
this._addGlobalListener();
Expand Down Expand Up @@ -110,7 +110,7 @@ export class ScrollDispatcher implements OnDestroy {
* @param elementRef Element whose ancestors to listen for.
* @param auditTimeInMs Time to throttle the scroll events.
*/
ancestorScrolled(elementRef: ElementRef, auditTimeInMs?: number): Observable<CdkScrollable|void> {
ancestorScrolled(elementRef: ElementRef, auditTimeInMs?: number): Observable<CdkScrollable | void> {
const ancestors = this.getAncestorScrollContainers(elementRef);

return this.scrolled(auditTimeInMs).pipe(filter((target: any) => {
Expand Down
6 changes: 3 additions & 3 deletions src/cdk/scrolling/scrollable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Directive, ElementRef, OnInit, OnDestroy, NgZone} from '@angular/core';
import {Observable, Subject} from 'rxjs';
import { Directive, ElementRef, OnInit, OnDestroy, NgZone } from '@angular/core';
import { Observable, Subject } from 'rxjs';

import {ScrollDispatcher} from './scroll-dispatcher';
import { ScrollDispatcher } from './scroll-dispatcher';


/**
Expand Down
6 changes: 3 additions & 3 deletions src/cdk/scrolling/scrolling-module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {NgModule} from '@angular/core';
import {PlatformModule} from '@ptsecurity/cdk/platform';
import { NgModule } from '@angular/core';
import { PlatformModule } from '@ptsecurity/cdk/platform';

import {CdkScrollable} from './scrollable';
import { CdkScrollable } from './scrollable';


@NgModule({
Expand Down
8 changes: 4 additions & 4 deletions src/cdk/scrolling/viewport-ruler.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {TestBed, inject, fakeAsync, tick} from '@angular/core/testing';
import {dispatchFakeEvent} from '@ptsecurity/cdk/testing';
import { TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
import { dispatchFakeEvent } from '@ptsecurity/cdk/testing';

import {ScrollDispatchModule} from './public-api';
import {ViewportRuler} from './viewport-ruler';
import { ScrollDispatchModule } from './public-api';
import { ViewportRuler } from './viewport-ruler';


// For all tests, we assume the browser window is 1024x786 (outerWidth x outerHeight).
Expand Down
1 change: 1 addition & 0 deletions src/cdk/testing/dispatch-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function dispatchKeyboardEvent(node: Node, type: string, keyCode: number,
}

/** Shorthand to dispatch a mouse event on the specified coordinates. */
// tslint:disable-next-line
export function dispatchMouseEvent(node: Node, type: string, x = 0, y = 0,
event = createMouseEvent(type, x, y)): MouseEvent {
return dispatchEvent(node, event) as MouseEvent;
Expand Down
Loading

0 comments on commit 6bb0a40

Please sign in to comment.