From 425db8aef5e04c41bcccb0cb4f6ab78972f26966 Mon Sep 17 00:00:00 2001 From: d3viant0ne Date: Mon, 7 Mar 2016 18:47:34 -0600 Subject: [PATCH] build(linting): execute tslint in travis execute tslint in travis ci build - uses npm script until ng lint task is stable - lints only the typescript in the src directory - executes in before_script section of travis.yml to fail fast chore(tslint): update no-unused-variable tslint rule modify the no-unused-variable tslint rule to ignore - ddescribe - iit style(button): resolves basic tslint errors resolve the following tslint violations - max-line-length - whitespace style(card): resolves basic tslint errors resolve the following tslint violations - max-line-length style(progress-circle): resolves basic tslint errors resolve the following tslint violations - max-line-length - whitespace - eofline - semicolon style(sidenav): resolves basic tslint errors resolve the following tslint violations - no-inferrable-types - max-line-length - whitespace - eofline - semicolon style(annotations): resolves basic tslint errors resolve the following tslint violations - semicolon style(demo-app): resolves basic tslint errors resolve the following tslint violations - eofline style(directives): resolves basic tslint errors resolve the following tslint violations - quotemark style(sidenav): resolves unused variable tslint errors remove the following unused imports - Predicate - PromiseWrapper - TimerWrapper remove the following unused variable - let openPromise: Promise ignore rule no-unused-variable on the following functions - closeModalSidenav_() - isShowingBackdrop_() - getMarginLeft_() - getMarginRight_() - getPositionLeft_() - getPositionRight_() style(progress-circle): resolves unused variable tslint errors remove the following unused imports - Attribute - ElementRef - ViewEncapsulation style(button): resolves unused variable tslint errors remove the following unused imports - ComponentFixture - beforeEachProviders - provide - DebugElement - AsyncTestFn ignore rule no-unused-variable on the following function - testAsync() style(one-of): resolves variable-name tslint errors rename OneOf to oneOf (camelCase) in following files - progress_circle.ts - sidenav.ts - one-of.ts - dir.ts style(test_injector): resolves variable tslint errors remove the following unused import - ExceptionHandler ignore rule variable-name on the following variables - _testInjector - _providers - _injector - _instantiated style(main): resolves variable tslint errors remove the following unused imports - HashLocationStrategy - LocationStrategy - provide build(linting): update tslint version Update to 3.5.0 to make user of ignore patterns style(sidenav): remove individual tslint rule ignore statements - remove all individual ignore statements for no-unused-variable on private class members - add regex to no-unused-variable ignore-pattern style(sidenav.spec): modify line break - break after toEqual to improve readability style(test_injector): resolves variable tslint errors rename var to let remove all individual ignore statements for variable-name move _ to end of private var name rename testInjector to testInjectorCache - resolves no-shadowed-variable error in setBaseTestProviders() - resolves no-shadowed-variable error in resetBaseTestProviders() style(button.spec): remove unused testAsync function - remove unused testAsync function - remove now unused module imports style(karma-test-shim): increase jasmine default timeout increase jasmine.DEFAULT_TIMEOUT_INTERVAL from 2000 to 4000ms. - Temporary resolution of Async callback timeouts in tests style(button): fix whitespace resolve whitespace issue in setClassList() style(one-of): modified case of OneOf - Fixed case for OneOf dec. factory - Modified export in one-of.ts Closes #134 --- .travis.yml | 2 +- package.json | 3 +- src/components/button/button.spec.ts | 32 ++++------- src/components/button/button.ts | 4 +- src/components/card/card.ts | 11 ++-- .../progress-circle/progress_circle.spec.ts | 18 +++--- .../progress-circle/progress_circle.ts | 5 +- src/components/sidenav/sidenav.spec.ts | 51 +++++++++-------- src/core/annotations/one-of.ts | 9 ++- src/core/facade/test_injector.ts | 55 ++++++++++--------- src/demo-app/button/button-demo.ts | 2 +- src/demo-app/card/card-demo.ts | 2 +- .../progress-circle/progress-circle-demo.ts | 2 +- src/demo-app/sidenav/sidenav-demo.ts | 2 +- src/directives/dir/dir.ts | 2 +- src/main.ts | 3 - test/karma-test-shim.js | 2 +- tslint.json | 2 +- 18 files changed, 98 insertions(+), 109 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bfbc54371f..4fb010d865f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - mkdir -p $LOGS_DIR + - npm run tslint script: @@ -62,4 +63,3 @@ cache: directories: - node_modules - $HOME/.pub-cache - diff --git a/package.json b/package.json index d5c575f1f12..5fd1166c8e8 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dartanalyzer": "cd dist/dart && pub install && cd ../.. && ts-node scripts/ci/dart_analyzer", "demo-app": "cd src && ng serve", "test": "karma start test/karma.conf.js", + "tslint" : "tslint -c tslint.json 'src/**/*.ts'", "typings": "typings install --ambient" }, "version": "2.0.0-alpha.0", @@ -53,7 +54,7 @@ "symlink-or-copy": "^1.0.1", "ts-node": "^0.5.5", "ts2dart": "^0.7.27", - "tslint": "^3.2.2", + "tslint": "^3.5.0", "typescript": "^1.7.5", "typings": "^0.6.8", "which": "^1.2.4" diff --git a/src/components/button/button.spec.ts b/src/components/button/button.spec.ts index f9c22f4b65b..0a053314061 100644 --- a/src/components/button/button.spec.ts +++ b/src/components/button/button.spec.ts @@ -1,9 +1,6 @@ import { inject, - injectAsync, - ComponentFixture, - TestComponentBuilder, - beforeEachProviders, + TestComponentBuilder } from 'angular2/testing'; import { it, @@ -13,22 +10,21 @@ import { expect, beforeEach, } from '../../core/facade/testing'; -import {provide, Component, DebugElement} from 'angular2/core'; +import {Component} from 'angular2/core'; import {By} from 'angular2/platform/browser'; import {MdButton, MdAnchor} from './button'; -import {AsyncTestFn, FunctionWithParamTokens} from 'angular2/testing'; export function main() { describe('MdButton', () => { let builder: TestComponentBuilder; - beforeEach(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { + beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { builder = tcb; })); // General button tests - it('should apply class based on color attribute', (done:() => void) => { + it('should apply class based on color attribute', (done: () => void) => { return builder.createAsync(TestApp).then((fixture) => { let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('button')); @@ -49,7 +45,7 @@ export function main() { // Regular button tests describe('button[md-button]', () => { - it('should handle a click on the button', (done:() => void) => { + it('should handle a click on the button', (done: () => void) => { return builder.createAsync(TestApp).then((fixture) => { let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('button')); @@ -60,7 +56,7 @@ export function main() { }); }); - it('should not increment if disabled', (done:() => void) => { + it('should not increment if disabled', (done: () => void) => { return builder.createAsync(TestApp).then((fixture) => { let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('button')); @@ -79,7 +75,7 @@ export function main() { // Anchor button tests describe('a[md-button]', () => { - it('should not redirect if disabled',(done:() => void)=>{ + it('should not redirect if disabled', (done: () => void) => { return builder.createAsync(TestApp).then((fixture) => { let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('a')); @@ -93,7 +89,7 @@ export function main() { }); }); - it('should remove tabindex if disabled', (done:() => void) => { + it('should remove tabindex if disabled', (done: () => void) => { return builder.createAsync(TestApp).then((fixture) => { let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('a')); @@ -106,7 +102,7 @@ export function main() { }); }); - it('should add aria-disabled attribute if disabled', (done:() => void) => { + it('should add aria-disabled attribute if disabled', (done: () => void) => { return builder.createAsync(TestApp).then((fixture) => { let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('a')); @@ -124,16 +120,12 @@ export function main() { }); } -/** Shortcut function to use instead of `injectAsync` for less boilerplate on each `it`. */ -function testAsync(fn: Function): FunctionWithParamTokens { - return injectAsync([], fn); -} - /** Test component that contains an MdButton. */ @Component({ selector: 'test-app', template: ` - Link @@ -148,5 +140,3 @@ class TestApp { this.clickCount++; } } - - diff --git a/src/components/button/button.ts b/src/components/button/button.ts index efd1f241f80..5ac983f5d94 100644 --- a/src/components/button/button.ts +++ b/src/components/button/button.ts @@ -37,7 +37,7 @@ export class MdButton { /** Whether a mousedown has occurred on this element in the last 100ms. */ isMouseDown: boolean = false; - setClassList() {return `md-${this.color}`;} + setClassList() { return `md-${this.color}`; } setMousedown() { // We only *show* the focus style when focus has come to the button via the keyboard. @@ -75,7 +75,7 @@ export class MdAnchor extends MdButton { disabled_: boolean = null; @HostBinding('tabIndex') - get tabIndex():number { + get tabIndex(): number { return this.disabled ? -1 : 0; } diff --git a/src/components/card/card.ts b/src/components/card/card.ts index 2f199432138..86d6b4e5d9b 100644 --- a/src/components/card/card.ts +++ b/src/components/card/card.ts @@ -5,7 +5,8 @@ import {CONST_EXPR} from 'angular2/src/facade/lang'; is a basic content container component that adds the styles of a material design card. -While you can use this component alone, it also provides a number of preset styles for common card sections, including: +While you can use this component alone, +it also provides a number of preset styles for common card sections, including: - md-card-title - md-card-subtitle - md-card-content @@ -29,10 +30,11 @@ While you can use this component alone, it also provides a number of preset styl export class MdCard {} -/* The following components don't have any behavior. They simply use content projection to wrap user content - for flex layout purposes in (and thus allow a cleaner, boilerplate-free API). +/* The following components don't have any behavior. + They simply use content projection to wrap user content + for flex layout purposes in (and thus allow a cleaner, boilerplate-free API). + - is a component intended to be used within the component. It adds styles for a preset header section (i.e. a title, subtitle, and avatar layout). @@ -70,4 +72,3 @@ TODO(kara): update link to demo site when it exists export class MdCardTitleGroup {} export const MD_CARD_DIRECTIVES: any[] = CONST_EXPR([MdCard, MdCardHeader, MdCardTitleGroup]); - diff --git a/src/components/progress-circle/progress_circle.spec.ts b/src/components/progress-circle/progress_circle.spec.ts index 583dd84d40c..2d0c57c298f 100644 --- a/src/components/progress-circle/progress_circle.spec.ts +++ b/src/components/progress-circle/progress_circle.spec.ts @@ -8,19 +8,19 @@ import { beforeEach, } from '../../core/facade/testing'; import {Component, DebugElement} from 'angular2/core'; -import {By} from 'angular2/platform/browser' +import {By} from 'angular2/platform/browser'; import {MdProgressCircle} from './progress_circle'; export function main() { describe('MdProgressCircular', () => { - let builder:TestComponentBuilder; + let builder: TestComponentBuilder; - beforeEach(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { + beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { builder = tcb; })); - it('should apply a mode of "determinate" if no mode is provided.', (done:() => void) => { + it('should apply a mode of "determinate" if no mode is provided.', (done: () => void) => { builder .overrideTemplate(TestApp, '') .createAsync(TestApp) @@ -32,7 +32,7 @@ export function main() { }); }); - it('should apply a mode of "determinate" if an invalid mode is provided.', (done:() => void) => { + it('should apply mode of "determinate" if an invalid mode is provided.', (done: () => void) => { builder .overrideTemplate(TestApp, '') .createAsync(TestApp) @@ -44,7 +44,7 @@ export function main() { }); }); - it('should not modify the mode if a valid mode is provided.', (done:() => void) => { + it('should not modify the mode if a valid mode is provided.', (done: () => void) => { builder .overrideTemplate(TestApp, '') .createAsync(TestApp) @@ -56,7 +56,7 @@ export function main() { }); }); - it('should define a default value for the value attribute', (done:() => void) => { + it('should define a default value for the value attribute', (done: () => void) => { builder .overrideTemplate(TestApp, '') .createAsync(TestApp) @@ -68,7 +68,7 @@ export function main() { }); }); - it('should clamp the value of the progress between 0 and 100', (done:() => void) => { + it('should clamp the value of the progress between 0 and 100', (done: () => void) => { builder .overrideTemplate(TestApp, '') .createAsync(TestApp) @@ -104,4 +104,4 @@ function getChildDebugElement(parent: DebugElement, selector: string): DebugElem directives: [MdProgressCircle], template: '', }) -class TestApp {} \ No newline at end of file +class TestApp {} diff --git a/src/components/progress-circle/progress_circle.ts b/src/components/progress-circle/progress_circle.ts index ae2f9cb3bac..f9bf4be1fe9 100644 --- a/src/components/progress-circle/progress_circle.ts +++ b/src/components/progress-circle/progress_circle.ts @@ -1,11 +1,8 @@ import { - Attribute, Component, ChangeDetectionStrategy, - ElementRef, HostBinding, - Input, - ViewEncapsulation, + Input } from 'angular2/core'; import {isPresent, CONST} from 'angular2/src/facade/lang'; import {Math} from 'angular2/src/facade/math'; diff --git a/src/components/sidenav/sidenav.spec.ts b/src/components/sidenav/sidenav.spec.ts index 84ec2a56d54..3f9f53eb9be 100644 --- a/src/components/sidenav/sidenav.spec.ts +++ b/src/components/sidenav/sidenav.spec.ts @@ -24,9 +24,6 @@ import { } from 'angular2/core'; import {By} from 'angular2/platform/browser'; -import {Predicate} from 'angular2/src/facade/collection'; -import {PromiseWrapper} from 'angular2/src/facade/promise'; -import {TimerWrapper} from 'angular2/src/facade/async'; import {MdSidenav, MdSidenavLayout, MD_SIDENAV_DIRECTIVES} from './sidenav'; @@ -38,7 +35,8 @@ function fakeAsyncAdaptor(fn: () => void) { /** * Create a ComponentFixture from the builder. This takes a template and a style for sidenav. */ -function createFixture(builder: TestComponentBuilder, template: string, style: string): ComponentFixture { +function createFixture(builder: TestComponentBuilder, + template: string, style: string): ComponentFixture { let fixture: ComponentFixture = null; // Remove the styles (which remove the animations/transitions). builder @@ -71,10 +69,11 @@ export function main() { let builder: TestComponentBuilder; /** - * We need to get the template and styles for the sidenav in an Async test. FakeAsync would block indefinitely - * on the XHR if we were to create the component async-ly. See https://github.com/angular/angular/issues/5601. - * We do some style verification so styles have to match. But we remove the transitions so we only - * set the regular `sidenav.css` styling. + * We need to get the template and styles for the sidenav in an Async test. + * FakeAsync would block indefinitely on the XHR if we were to create the component async-ly. + * See https://github.com/angular/angular/issues/5601. + * We do some style verification so styles have to match. + * But we remove the transitions so we only set the regular `sidenav.css` styling. */ beforeEach(injectAsync([TestComponentBuilder, XHR], (tcb: TestComponentBuilder, xhr: XHR) => { builder = tcb; @@ -111,7 +110,8 @@ export function main() { let sidenavElement = fixture.debugElement.query(By.css('md-sidenav')); let sidenavBackdropElement = fixture.debugElement.query(By.css('.md-sidenav-backdrop')); expect(getComputedStyle(sidenavElement.nativeElement).visibility).toEqual('visible'); - expect(getComputedStyle(sidenavBackdropElement.nativeElement).visibility).toEqual('visible'); + expect(getComputedStyle(sidenavBackdropElement.nativeElement).visibility) + .toEqual('visible'); // Close it. let closeButtonElement = fixture.debugElement.query(By.css('.close')); @@ -136,13 +136,14 @@ export function main() { expect(getComputedStyle(sidenavBackdropElement.nativeElement).visibility).toEqual('hidden'); })); - it('open() and close() return a promise that resolves after the animation ended', fakeAsyncAdaptor(() => { + it('open/close() return a promise that resolves after animation end', fakeAsyncAdaptor(() => { let fixture = createFixture(builder, template, style); - let sidenav: MdSidenav = fixture.debugElement.query(By.directive(MdSidenav)).componentInstance; - let called: boolean = false; + let sidenav: MdSidenav = fixture.debugElement + .query(By.directive(MdSidenav)).componentInstance; + let called = false; sidenav.open().then((_: any) => { - called = true + called = true; }); expect(called).toBe(false); @@ -152,7 +153,7 @@ export function main() { called = false; sidenav.close().then((_: any) => { - called = true + called = true; }); expect(called).toBe(false); @@ -164,7 +165,8 @@ export function main() { it('open/close() twice returns the same promise', fakeAsyncAdaptor(() => { let fixture = createFixture(builder, template, style); - let sidenav: MdSidenav = fixture.debugElement.query(By.directive(MdSidenav)).componentInstance; + let sidenav: MdSidenav = fixture.debugElement + .query(By.directive(MdSidenav)).componentInstance; let promise = sidenav.open(); expect(sidenav.open()).toBe(promise); @@ -178,12 +180,13 @@ export function main() { it('open() then close() cancel animations when called too fast', fakeAsyncAdaptor(() => { let fixture = createFixture(builder, template, style); - let sidenav: MdSidenav = fixture.debugElement.query(By.directive(MdSidenav)).componentInstance; + let sidenav: MdSidenav = fixture.debugElement + .query(By.directive(MdSidenav)).componentInstance; let closePromise: Promise; - let openCalled: boolean = false; - let openCancelled: boolean = false; - let closeCalled: boolean = false; + let openCalled = false; + let openCancelled = false; + let closeCalled = false; sidenav.open().then((_: any) => { openCalled = true; }, () => { openCancelled = true; }); @@ -201,12 +204,12 @@ export function main() { it('close() then open() cancel animations when called too fast', fakeAsyncAdaptor(() => { let fixture = createFixture(builder, template, style); - let sidenav: MdSidenav = fixture.debugElement.query(By.directive(MdSidenav)).componentInstance; + let sidenav: MdSidenav = fixture.debugElement + .query(By.directive(MdSidenav)).componentInstance; - let openPromise: Promise; - let closeCalled: boolean = false; - let closeCancelled: boolean = false; - let openCalled: boolean = false; + let closeCalled = false; + let closeCancelled = false; + let openCalled = false; // First, open the sidenav completely. sidenav.open(); diff --git a/src/core/annotations/one-of.ts b/src/core/annotations/one-of.ts index 1e1982d0b63..7e69d5a5838 100644 --- a/src/core/annotations/one-of.ts +++ b/src/core/annotations/one-of.ts @@ -9,8 +9,8 @@ declare var Symbol: any; * @param values The list of allowed values. The first value listed will be used as a default if * the set value isn't part of the list of accepted values. */ -function OneOfFactory(values: any[]) { - return function OneOfMetadata(target: any, key: string): void { +function oneOfFactory(values: any[]) { + return function oneOfMetadata(target: any, key: string): void { const defaultValue = values[0]; // Use a fallback if Symbol isn't available. @@ -27,8 +27,7 @@ function OneOfFactory(values: any[]) { } } }); - } + }; } - -export const OneOf = OneOfFactory; +export { oneOfFactory as OneOf }; diff --git a/src/core/facade/test_injector.ts b/src/core/facade/test_injector.ts index e89114f29af..84af577eaf8 100644 --- a/src/core/facade/test_injector.ts +++ b/src/core/facade/test_injector.ts @@ -1,19 +1,20 @@ import {Injector, Provider, PLATFORM_INITIALIZER} from 'angular2/core'; -import {BaseException, ExceptionHandler} from 'angular2/src/facade/exceptions'; +import {BaseException} from 'angular2/src/facade/exceptions'; import {ListWrapper} from 'angular2/src/facade/collection'; import {FunctionWrapper, isPresent, Type} from 'angular2/src/facade/lang'; export class TestInjector { - private _instantiated: boolean = false; - private _injector: Injector = null; + private instantiated_: boolean = false; - private _providers: Array = []; + private injector_: Injector = null; + + private providers_: Array = []; reset() { - this._injector = null; - this._providers = []; - this._instantiated = false; + this.injector_ = null; + this.providers_ = []; + this.instantiated_ = false; } platformProviders: Array = []; @@ -21,35 +22,35 @@ export class TestInjector { applicationProviders: Array = []; addProviders(providers: Array) { - if (this._instantiated) { + if (this.instantiated_) { throw new BaseException('Cannot add providers after test injector is instantiated'); } - this._providers = ListWrapper.concat(this._providers, providers); + this.providers_ = ListWrapper.concat(this.providers_, providers); } createInjector() { - var rootInjector = Injector.resolveAndCreate(this.platformProviders); - this._injector = rootInjector.resolveAndCreateChild( - ListWrapper.concat(this.applicationProviders, this._providers)); - this._instantiated = true; - return this._injector; + let rootInjector = Injector.resolveAndCreate(this.platformProviders); + this.injector_ = rootInjector.resolveAndCreateChild( + ListWrapper.concat(this.applicationProviders, this.providers_)); + this.instantiated_ = true; + return this.injector_; } execute(fn: FunctionWithParamTokens): any { - if (!this._instantiated) { + if (!this.instantiated_) { this.createInjector(); } - return fn.execute(this._injector); + return fn.execute(this.injector_); } } -var _testInjector: TestInjector = null; +let testInjectorCache: TestInjector = null; export function getTestInjector() { - if (_testInjector == null) { - _testInjector = new TestInjector(); + if (testInjectorCache == null) { + testInjectorCache = new TestInjector(); } - return _testInjector; + return testInjectorCache; } /** @@ -65,13 +66,13 @@ export function getTestInjector() { */ export function setBaseTestProviders(platformProviders: Array, applicationProviders: Array) { - var testInjector = getTestInjector(); + let testInjector = getTestInjector(); if (testInjector.platformProviders.length > 0 || testInjector.applicationProviders.length > 0) { throw new BaseException('Cannot set base providers because it has already been called'); } testInjector.platformProviders = platformProviders; testInjector.applicationProviders = applicationProviders; - var injector = testInjector.createInjector(); + let injector = testInjector.createInjector(); let inits: Function[] = injector.getOptional(PLATFORM_INITIALIZER); if (isPresent(inits)) { inits.forEach(init => init()); @@ -83,7 +84,7 @@ export function setBaseTestProviders(platformProviders: Array injector.get(t)); - return FunctionWrapper.apply(this._fn, params); + let params = this.tokens_.map(t => injector.get(t)); + return FunctionWrapper.apply(this.fn_, params); } - hasToken(token: any): boolean { return this._tokens.indexOf(token) > -1; } + hasToken(token: any): boolean { return this.tokens_.indexOf(token) > -1; } } diff --git a/src/demo-app/button/button-demo.ts b/src/demo-app/button/button-demo.ts index 4d12c44f775..60ec01fa0aa 100644 --- a/src/demo-app/button/button-demo.ts +++ b/src/demo-app/button/button-demo.ts @@ -10,4 +10,4 @@ import {MdButton, MdAnchor} from '../../components/button/button'; export class ButtonDemo { isDisabled: boolean = false; -} \ No newline at end of file +} diff --git a/src/demo-app/card/card-demo.ts b/src/demo-app/card/card-demo.ts index 872b67d8b4d..9ff44a12bd2 100644 --- a/src/demo-app/card/card-demo.ts +++ b/src/demo-app/card/card-demo.ts @@ -8,4 +8,4 @@ import {MD_CARD_DIRECTIVES} from '../../components/card/card'; styleUrls: ['demo-app/card/card-demo.css'], directives: [MD_CARD_DIRECTIVES, MdButton] }) -export class CardDemo {} \ No newline at end of file +export class CardDemo {} diff --git a/src/demo-app/progress-circle/progress-circle-demo.ts b/src/demo-app/progress-circle/progress-circle-demo.ts index c908aafabe5..a430bd4346f 100644 --- a/src/demo-app/progress-circle/progress-circle-demo.ts +++ b/src/demo-app/progress-circle/progress-circle-demo.ts @@ -15,4 +15,4 @@ export class ProgressCircleDemo { this.progressValue += val; } -} \ No newline at end of file +} diff --git a/src/demo-app/sidenav/sidenav-demo.ts b/src/demo-app/sidenav/sidenav-demo.ts index 9238c9e1409..5f5d606cfca 100644 --- a/src/demo-app/sidenav/sidenav-demo.ts +++ b/src/demo-app/sidenav/sidenav-demo.ts @@ -8,4 +8,4 @@ import {MD_SIDENAV_DIRECTIVES} from '../../components/sidenav/sidenav'; styleUrls: ['demo-app/sidenav/sidenav-demo.css'], directives: [MD_SIDENAV_DIRECTIVES, MdButton] }) -export class SidenavDemo { } \ No newline at end of file +export class SidenavDemo { } diff --git a/src/directives/dir/dir.ts b/src/directives/dir/dir.ts index 56c0da895f2..cda0547374e 100644 --- a/src/directives/dir/dir.ts +++ b/src/directives/dir/dir.ts @@ -1,6 +1,6 @@ import {EventEmitter} from 'angular2/src/facade/async'; import {Directive, HostBinding, Output, Input} from 'angular2/core'; -import {OneOf} from "../../core/annotations/one-of"; +import {OneOf} from '../../core/annotations/one-of'; /** diff --git a/src/main.ts b/src/main.ts index b75aa025324..6898cb4892c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,6 @@ import {bootstrap} from 'angular2/platform/browser'; import {DemoApp} from './demo-app/demo-app'; import {ROUTER_PROVIDERS} from 'angular2/router'; -import {HashLocationStrategy} from 'angular2/router'; -import {LocationStrategy} from 'angular2/router'; -import {provide} from 'angular2/core'; bootstrap(DemoApp, [ ROUTER_PROVIDERS diff --git a/test/karma-test-shim.js b/test/karma-test-shim.js index ef5d75a21b8..4b6426f002e 100644 --- a/test/karma-test-shim.js +++ b/test/karma-test-shim.js @@ -1,6 +1,6 @@ Error.stackTraceLimit = Infinity; -jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000; +jasmine.DEFAULT_TIMEOUT_INTERVAL = 4000; __karma__.loaded = function() {}; diff --git a/tslint.json b/tslint.json index c9cd1dd3791..d69c8279fc1 100644 --- a/tslint.json +++ b/tslint.json @@ -20,7 +20,7 @@ "no-bitwise": true, "no-shadowed-variable": true, "no-unused-expression": true, - "no-unused-variable": true, + "no-unused-variable": [true, {"ignore-pattern": "ddescribe|iit|.*_$"}], "one-line": [ true, "check-catch",