Skip to content

Commit da9627d

Browse files
committed
build: reuse tslint rules for docs site and fix failures
Expands the tslint check to cover the docs site and fixes all of the failures.
1 parent e8810dd commit da9627d

File tree

120 files changed

+1055
-179
lines changed

Some content is hidden

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

120 files changed

+1055
-179
lines changed

docs/e2e/src/app.e2e-spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {MaterialDocsAppPage} from './app.po';
210
import {browser, logging} from 'protractor';
311

docs/e2e/src/app.po.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {browser, by, element} from 'protractor';
210

311
export class MaterialDocsAppPage {

docs/scenes/e2e/screenshot.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import * as fs from 'fs';
210
import * as path from 'path';
311
import {by, element} from 'protractor';

docs/scenes/e2e/src/app.e2e-spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {AppPage} from './app.po';
210
import {screenshot} from '../screenshot';
311

docs/scenes/e2e/src/app.po.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {browser} from 'protractor';
210

311
export class AppPage {

docs/scenes/src/app/app-routes.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {ComponentType} from '@angular/cdk/overlay';
210
import {SceneViewer} from './scene-viewer/scene-viewer';
311
import {AutocompleteScene} from './scenes/autocomplete/autocomplete-scene';
@@ -93,5 +101,10 @@ export const routes: SceneViewerRoute[] = [
93101
{path: 'tooltip', component: SceneViewer, data: {scene: TooltipScene}},
94102
{path: 'tree', component: SceneViewer, data: {scene: TreeScene}},
95103
]
96-
.sort((a, b) => (a.path > b.path ? 1 : b.path > a.path ? -1 : 0))
104+
.sort((a, b) => {
105+
if (a.path > b.path) {
106+
return 1;
107+
}
108+
return b.path > a.path ? -1 : 0;
109+
})
97110
.map((route: SceneViewerRoute) => ({...route, data: {...route.data, hueRotate: 15 * hue++}}));

docs/scenes/src/app/app.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component} from '@angular/core';
210
import {RouterOutlet} from '@angular/router';
311

docs/scenes/src/app/scene-overlay-container.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Injectable} from '@angular/core';
210
import {OverlayContainer} from '@angular/cdk/overlay';
311

docs/scenes/src/app/scene-viewer/scene-viewer.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {
210
Component,
3-
HostBinding,
411
Input,
512
OnInit,
613
ViewContainerRef,
@@ -16,12 +23,14 @@ import {DomSanitizer, SafeStyle} from '@angular/platform-browser';
1623
selector: 'app-scene-viewer',
1724
templateUrl: './scene-viewer.html',
1825
styleUrls: ['./scene-viewer.scss'],
26+
host: {
27+
'[style.filter]': 'filter',
28+
},
1929
})
2030
export class SceneViewer implements OnInit {
21-
private route = inject(ActivatedRoute);
22-
private sanitizer = inject(DomSanitizer);
23-
24-
@HostBinding('style.filter') filter: SafeStyle | undefined;
31+
private _route = inject(ActivatedRoute);
32+
private _sanitizer = inject(DomSanitizer);
33+
protected filter: SafeStyle | undefined;
2534

2635
/**
2736
* Degree to change hue of scene by. All scenes default to a reddish hue.
@@ -36,7 +45,7 @@ export class SceneViewer implements OnInit {
3645
this._hueRotation = deg;
3746
// Modern browsers have security built in so this is just bypassing Angular's redundant checks.
3847
// Furthermore these checks will soon be removed.
39-
this.filter = this.sanitizer.bypassSecurityTrustStyle(`hue-rotate(${this.hueRotation}deg)`);
48+
this.filter = this._sanitizer.bypassSecurityTrustStyle(`hue-rotate(${this.hueRotation}deg)`);
4049
}
4150
private _hueRotation = 0;
4251

@@ -49,9 +58,9 @@ export class SceneViewer implements OnInit {
4958
readonly scene = viewChild.required('scene', {read: ViewContainerRef});
5059

5160
constructor() {
52-
this.hueRotation = this.route.snapshot.data['hueRotate'];
53-
this.component = this.route.snapshot.data['scene'];
54-
this.scale = this.route.snapshot.data['scale'];
61+
this.hueRotation = this._route.snapshot.data['hueRotate'];
62+
this.component = this._route.snapshot.data['scene'];
63+
this.scale = this._route.snapshot.data['scale'];
5564
}
5665

5766
ngOnInit() {

docs/scenes/src/app/scenes/autocomplete/autocomplete-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {AfterViewInit, Component, ViewEncapsulation, viewChild} from '@angular/core';
210
import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms';
311
import {MatFormFieldModule} from '@angular/material/form-field';

docs/scenes/src/app/scenes/badge/badge-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatIconModule} from '@angular/material/icon';
311
import {MatBadgeModule} from '@angular/material/badge';

docs/scenes/src/app/scenes/bottom-sheet/bottom-sheet-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {AfterViewInit, Component, ViewEncapsulation, inject} from '@angular/core';
210
import {MatBottomSheet} from '@angular/material/bottom-sheet';
311
import {MatIconModule} from '@angular/material/icon';

docs/scenes/src/app/scenes/button-toggle/button-toggle-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatButtonToggleModule} from '@angular/material/button-toggle';
311
import {MatIconModule} from '@angular/material/icon';

docs/scenes/src/app/scenes/button/button-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatButtonModule} from '@angular/material/button';
311
import {MatIconModule} from '@angular/material/icon';

docs/scenes/src/app/scenes/card/card-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component} from '@angular/core';
210
import {MatCardModule} from '@angular/material/card';
311

docs/scenes/src/app/scenes/checkbox/checkbox-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatCheckboxModule} from '@angular/material/checkbox';
311

docs/scenes/src/app/scenes/chips/chips-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatChipsModule} from '@angular/material/chips';
311

docs/scenes/src/app/scenes/core/core-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatIconModule} from '@angular/material/icon';
311

docs/scenes/src/app/scenes/datepicker/datepicker-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatDatepickerModule} from '@angular/material/datepicker';
311

docs/scenes/src/app/scenes/dialog/dialog-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation, inject} from '@angular/core';
210
import {MatButtonModule} from '@angular/material/button';
311
import {MatDialog, MatDialogModule} from '@angular/material/dialog';

docs/scenes/src/app/scenes/divider/divider-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatIconModule} from '@angular/material/icon';
311
import {MatListModule} from '@angular/material/list';

docs/scenes/src/app/scenes/expansion/expansion-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatExpansionModule} from '@angular/material/expansion';
311
import {MatIconModule} from '@angular/material/icon';

docs/scenes/src/app/scenes/form-field/form-field-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatIconModule} from '@angular/material/icon';
311
import {MatInputModule} from '@angular/material/input';

docs/scenes/src/app/scenes/grid-list/grid-list-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatGridListModule} from '@angular/material/grid-list';
311

docs/scenes/src/app/scenes/icon/icon-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatIconModule} from '@angular/material/icon';
311

docs/scenes/src/app/scenes/input/input-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatFormFieldModule} from '@angular/material/form-field';
311
import {MatInputModule} from '@angular/material/input';

docs/scenes/src/app/scenes/list/list-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {Component, ViewEncapsulation} from '@angular/core';
210
import {MatListModule} from '@angular/material/list';
311
import {MatIconModule} from '@angular/material/icon';

docs/scenes/src/app/scenes/menu/menu-scene.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC 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.dev/license
7+
*/
8+
19
import {AfterViewInit, Component, ViewEncapsulation, viewChild} from '@angular/core';
210
import {MatButtonModule} from '@angular/material/button';
311
import {MatIconModule} from '@angular/material/icon';

0 commit comments

Comments
 (0)