Skip to content

Commit 61b5ae3

Browse files
committed
build: enable no-unused-variable lint rule
* Now TSLint starts reporting unused variables again (Rule has been un-deprecated and now uses the type checker * In favor of linting the whole project the tsconfig file inside of `src/` needs to live in the project root.
1 parent 8ae4d9d commit 61b5ae3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+82
-125
lines changed

e2e/components/checkbox-e2e.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ describe('checkbox', () => {
1010
it('should be checked when clicked, and unchecked when clicked again', async () => {
1111
let checkboxEl = element(by.id('test-checkbox'));
1212
let inputEl = element(by.css('input[id=input-test-checkbox]'));
13-
let checked: string;
1413

1514
screenshot('start');
1615
checkboxEl.click();

e2e/components/icon-e2e.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {browser, by, element} from 'protractor';
2-
import {screenshot} from '../screenshot';
32

43

54
describe('icon', () => {

e2e/components/menu-e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Key, protractor, browser, by, element, ElementFinder} from 'protractor';
1+
import {Key, protractor, browser, by, element} from 'protractor';
22
import {screenshot} from '../screenshot';
33
import {
44
expectToExist,

src/cdk/a11y/activedescendant-key-manager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {QueryList} from '@angular/core';
109
import {ListKeyManager, CanDisable} from './list-key-manager';
1110

1211
/**

src/cdk/bidi/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import {NgModule} from '@angular/core';
1010
import {DOCUMENT} from '@angular/platform-browser';
1111
import {Dir} from './dir';
12-
import {DIR_DOCUMENT, Directionality, DIRECTIONALITY_PROVIDER} from './directionality';
12+
import {DIR_DOCUMENT, Directionality} from './directionality';
1313

1414
export {
1515
Directionality,

src/cdk/table/cell.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ export class CdkColumnDef {
4747
},
4848
})
4949
export class CdkHeaderCell {
50-
constructor(private columnDef: CdkColumnDef,
51-
private elementRef: ElementRef,
52-
private renderer: Renderer2) {
53-
this.renderer.addClass(elementRef.nativeElement, `cdk-column-${columnDef.name}`);
50+
constructor(columnDef: CdkColumnDef, elementRef: ElementRef, renderer: Renderer2) {
51+
renderer.addClass(elementRef.nativeElement, `cdk-column-${columnDef.name}`);
5452
}
5553
}
5654

@@ -63,9 +61,7 @@ export class CdkHeaderCell {
6361
},
6462
})
6563
export class CdkCell {
66-
constructor(private columnDef: CdkColumnDef,
67-
private elementRef: ElementRef,
68-
private renderer: Renderer2) {
69-
this.renderer.addClass(elementRef.nativeElement, `cdk-column-${columnDef.name}`);
64+
constructor(columnDef: CdkColumnDef, elementRef: ElementRef, renderer: Renderer2) {
65+
renderer.addClass(elementRef.nativeElement, `cdk-column-${columnDef.name}`);
7066
}
7167
}

src/demo-app/overlay/overlay-demo.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import {
1111
OverlayState,
1212
OverlayOrigin,
1313
ComponentPortal,
14+
// This import is only used to define a generic type. The current TypeScript version incorrectly
15+
// considers such imports as unused (https://github.com/Microsoft/TypeScript/issues/14953)
16+
// tslint:disable-next-line:no-unused-variable
1417
Portal,
1518
TemplatePortalDirective,
1619
} from '@angular/material';

src/lib/autocomplete/autocomplete.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {dispatchFakeEvent} from '../core/testing/dispatch-events';
3030
import {createKeyboardEvent} from '../core/testing/event-objects';
3131
import {typeInElement} from '../core/testing/type-in-element';
3232
import {ScrollDispatcher} from '../core/overlay/scroll/scroll-dispatcher';
33-
import {RxChain, map, startWith, filter} from '../core/rxjs/index';
33+
import {RxChain, map, startWith} from '../core/rxjs/index';
3434

3535

3636
describe('MdAutocomplete', () => {

src/lib/chips/chip-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import {
1919

2020
import {MdChip} from './chip';
2121
import {FocusKeyManager} from '../core/a11y/focus-key-manager';
22-
import {SPACE, LEFT_ARROW, RIGHT_ARROW, TAB} from '../core/keyboard/keycodes';
23-
import {coerceBooleanProperty} from '@angular/cdk';
22+
import {SPACE, LEFT_ARROW, RIGHT_ARROW} from '../core/keyboard/keycodes';
2423
import {Subscription} from 'rxjs/Subscription';
24+
import {coerceBooleanProperty} from '@angular/cdk';
2525

2626
/**
2727
* A material design chips component (named ChipList for it's similarity to the List component).

src/lib/core/a11y/activedescendant-key-manager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {QueryList} from '@angular/core';
109
import {ListKeyManager, CanDisable} from './list-key-manager';
1110

1211
/**

src/lib/core/bidi/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
109
export {
1110
Directionality,
1211
DIRECTIONALITY_PROVIDER,

src/lib/core/datetime/native-date-adapter.spec.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
import {NativeDateAdapter} from './native-date-adapter';
22
import {Platform} from '../platform/index';
3-
3+
import {DEC, FEB, JAN, MAR} from '../testing/month-constants';
44

55
const SUPPORTS_INTL = typeof Intl != 'undefined';
66

7-
8-
// When constructing a Date, the month is zero-based. This can be confusing, since people are
9-
// used to seeing them one-based. So we create these aliases to make reading the tests easier.
10-
const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,
11-
NOV = 10, DEC = 11;
12-
13-
147
describe('NativeDateAdapter', () => {
158
let adapter;
169
let platform;

src/lib/core/error/error-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {InjectionToken} from '@angular/core';
10-
import {FormControl, FormGroupDirective, Form, NgForm} from '@angular/forms';
10+
import {FormControl, FormGroupDirective, NgForm} from '@angular/forms';
1111

1212
/** Injection token that can be used to specify the global error options. */
1313
export const MD_ERROR_GLOBAL_OPTIONS = new InjectionToken<ErrorOptions>('md-error-global-options');

src/lib/core/option/optgroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Component, ViewEncapsulation, ContentChildren, QueryList, Input} from '@angular/core';
9+
import {Component, ViewEncapsulation, Input} from '@angular/core';
1010
import {mixinDisabled, CanDisable} from '../common-behaviors/disabled';
1111

1212
// Boilerplate for applying mixins to MdOptgroup.

src/lib/core/option/option.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
EventEmitter,
1313
Input,
1414
Output,
15-
NgModule,
1615
ViewEncapsulation,
1716
Inject,
1817
Optional,

src/lib/core/overlay/overlay-directives.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ import {TemplatePortal} from '../portal/portal';
2626
import {OverlayState} from './overlay-state';
2727
import {
2828
ConnectionPositionPair,
29+
// This import is only used to define a generic type. The current TypeScript version incorrectly
30+
// considers such imports as unused (https://github.com/Microsoft/TypeScript/issues/14953)
31+
// tslint:disable-next-line:no-unused-variable
2932
ConnectedOverlayPositionChange
3033
} from './position/connected-position';
3134
import {ConnectedPositionStrategy} from './position/connected-position-strategy';
3235
import {Directionality, Direction} from '../bidi/index';
33-
import {Scrollable} from './scroll/scrollable';
3436
import {ScrollStrategy} from './scroll/scroll-strategy';
3537
import {coerceBooleanProperty} from '@angular/cdk';
3638
import {ESCAPE} from '../keyboard/keycodes';

src/lib/core/overlay/overlay.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import {
99
OverlayContainer,
1010
Overlay,
1111
PositionStrategy,
12-
ViewportRuler,
1312
ScrollStrategy,
14-
ScrollDispatcher,
1513
} from './index';
1614

1715

@@ -336,7 +334,6 @@ describe('Overlay', () => {
336334
overlayRef.attach(componentPortal);
337335
viewContainerFixture.detectChanges();
338336

339-
let backdrop = overlayContainerElement.querySelector('.cdk-overlay-backdrop') as HTMLElement;
340337
let completeHandler = jasmine.createSpy('backdrop complete handler');
341338

342339
overlayRef.backdropClick().subscribe(undefined, undefined, completeHandler);

src/lib/core/overlay/scroll/scroll-strategy-options.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {Injectable} from '@angular/core';
10-
import {ScrollStrategy} from './scroll-strategy';
1110
import {CloseScrollStrategy} from './close-scroll-strategy';
1211
import {NoopScrollStrategy} from './noop-scroll-strategy';
1312
import {BlockScrollStrategy} from './block-scroll-strategy';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
/**
10+
* When constructing a Date, the month is zero-based. This can be confusing, since people are
11+
* used to seeing them one-based. So we create these aliases to make writing the tests easier.
12+
*/
13+
export const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8,
14+
OCT = 9, NOV = 10, DEC = 11;

src/lib/datepicker/calendar.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ import {MdDatepickerIntl} from './datepicker-intl';
2525
import {MdNativeDateModule} from '../core/datetime/index';
2626
import {NoConflictStyleCompatibilityMode} from '../core';
2727
import {MdButtonModule} from '../button/index';
28-
29-
30-
// When constructing a Date, the month is zero-based. This can be confusing, since people are
31-
// used to seeing them one-based. So we create these aliases to make reading the tests easier.
32-
const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,
33-
NOV = 10, DEC = 11;
34-
28+
import {AUG, DEC, FEB, JAN, JUL, NOV, MAR, MAY, JUN, SEP} from '../core/testing/month-constants';
3529

3630
describe('MdCalendar', () => {
3731
beforeEach(async(() => {

src/lib/datepicker/datepicker.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ import {
1414
dispatchMouseEvent,
1515
dispatchKeyboardEvent,
1616
} from '../core/testing/dispatch-events';
17-
18-
19-
// When constructing a Date, the month is zero-based. This can be confusing, since people are
20-
// used to seeing them one-based. So we create these aliases to make reading the tests easier.
21-
const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,
22-
NOV = 10, DEC = 11;
23-
17+
import {DEC, JAN} from '../core/testing/month-constants';
2418

2519
describe('MdDatepicker', () => {
2620
describe('with MdNativeDateModule', () => {

src/lib/datepicker/datepicker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {MdDialogRef} from '../dialog/dialog-ref';
3333
import {PositionStrategy} from '../core/overlay/position/position-strategy';
3434
import {MdDatepickerInput} from './datepicker-input';
3535
import {Subscription} from 'rxjs/Subscription';
36-
import {MdDialogConfig} from '../dialog/dialog-config';
3736
import {DateAdapter} from '../core/datetime/index';
3837
import {createMissingDateImplError} from './datepicker-errors';
3938
import {ESCAPE} from '../core/keyboard/keycodes';

src/lib/datepicker/month-view.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import {By} from '@angular/platform-browser';
44
import {MdMonthView} from './month-view';
55
import {MdCalendarBody} from './calendar-body';
66
import {MdNativeDateModule, DateAdapter, NativeDateAdapter} from '../core/datetime/index';
7-
8-
9-
// When constructing a Date, the month is zero-based. This can be confusing, since people are
10-
// used to seeing them one-based. So we create these aliases to make reading the tests easier.
11-
const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,
12-
NOV = 10, DEC = 11;
13-
7+
import {JAN, MAR} from '../core/testing/month-constants';
148

159
describe('MdMonthView', () => {
1610
beforeEach(async(() => {

src/lib/datepicker/year-view.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import {By} from '@angular/platform-browser';
44
import {MdYearView} from './year-view';
55
import {MdCalendarBody} from './calendar-body';
66
import {MdNativeDateModule, DateAdapter, NativeDateAdapter} from '../core/datetime/index';
7-
8-
9-
// When constructing a Date, the month is zero-based. This can be confusing, since people are
10-
// used to seeing them one-based. So we create these aliases to make reading the tests easier.
11-
const JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,
12-
NOV = 10, DEC = 11;
13-
7+
import {FEB, JAN, MAR} from '../core/testing/month-constants';
148

159
describe('MdYearView', () => {
1610
beforeEach(async(() => {

src/lib/dialog/dialog-container.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ViewChild,
1313
ViewEncapsulation,
1414
NgZone,
15-
OnDestroy,
1615
ElementRef,
1716
EventEmitter,
1817
Inject,

src/lib/dialog/dialog-injector.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
*/
88

99
import {Injector} from '@angular/core';
10-
import {MdDialogRef} from './dialog-ref';
11-
import {MdDialogContainer} from './dialog-container';
1210

1311
/** Custom injector type specifically for instantiating components with a dialog. */
1412
export class DialogInjector implements Injector {

src/lib/dialog/dialog.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ describe('MdDialog', () => {
310310
});
311311

312312
it('should allow setting the layout direction', () => {
313-
let dialogRef = dialog.open(PizzaMsg, { direction: 'rtl' });
313+
dialog.open(PizzaMsg, { direction: 'rtl' });
314314

315315
viewContainerFixture.detectChanges();
316316

src/lib/expansion/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {NgModule, ModuleWithProviders} from '@angular/core';
9+
import {NgModule} from '@angular/core';
1010
import {CommonModule} from '@angular/common';
1111
import {CompatibilityModule, UNIQUE_SELECTION_DISPATCHER_PROVIDER} from '../core';
1212
import {

src/lib/paginator/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import {NgModule} from '@angular/core';
1010
import {CommonModule} from '@angular/common';
1111
import {FormsModule} from '@angular/forms';
12-
import {MdCommonModule, OverlayModule} from '../core';
1312
import {MdButtonModule} from '../button/index';
1413
import {MdSelectModule} from '../select/index';
1514
import {MdPaginator} from './paginator';

src/lib/paginator/paginator.spec.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,6 @@ class MdPaginatorApp {
251251
}
252252
}
253253

254-
@Component({
255-
template: `
256-
<md-paginator [length]="100"></md-paginator>
257-
`,
258-
})
259-
class MdPaginatorWithoutPageSizeOrOptionsApp {
260-
@ViewChild(MdPaginator) mdPaginator: MdPaginator;
261-
}
262-
263254
@Component({
264255
template: `
265256
<md-paginator [pageSizeOptions]="[10, 20, 30]"></md-paginator>

src/lib/sidenav/sidenav.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {fakeAsync, async, tick, ComponentFixture, TestBed} from '@angular/core/testing';
22
import {Component, ElementRef, ViewChild} from '@angular/core';
33
import {By} from '@angular/platform-browser';
4-
import {MdSidenav, MdSidenavModule, MdSidenavToggleResult, MdSidenavContainer} from './index';
4+
import {MdSidenav, MdSidenavModule, MdSidenavContainer} from './index';
55
import {A11yModule} from '../core/a11y/index';
66
import {PlatformModule} from '../core/platform/index';
77
import {ESCAPE} from '../core/keyboard/keycodes';

src/lib/snack-bar/snack-bar-container.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
import {
2727
BasePortalHost,
2828
ComponentPortal,
29-
TemplatePortal,
3029
PortalHostDirective,
3130
} from '../core';
3231
import {MdSnackBarConfig} from './snack-bar-config';

src/lib/tabs/tab-header.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
import {MdTabLabelWrapper} from './tab-label-wrapper';
3535
import {MdInkBar} from './ink-bar';
3636
import {Subscription} from 'rxjs/Subscription';
37-
import {applyCssTransform} from '../core/style/apply-transform';
3837
import {auditTime, startWith} from '../core/rxjs/index';
3938
import {of as observableOf} from 'rxjs/observable/of';
4039
import {merge} from 'rxjs/observable/merge';

src/tsconfig.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/universal-app/kitchen-sink/kitchen-sink.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import {BrowserModule} from '@angular/platform-browser';
44
import {
55
MdAutocompleteModule,
66
MdButtonModule,
7-
MdButtonToggleModule,
87
MdCardModule,
9-
MdCheckboxModule,
108
MdChipsModule,
119
MdDatepickerModule,
1210
MdDialogModule,

0 commit comments

Comments
 (0)