Skip to content

Commit d1ac6b0

Browse files
devversionjelbourn
authored andcommitted
build: run custom tslint rules on new packages (angular#17033)
Apparently we didn't run the custom tslint rules for the new packages that have been merged (`youtube-player` and `google-maps`). This is because we have a whitelist of packages we want to run these custom lint rules against. It should be actually the other way around where we only specify the folders we _don't_ want to lint against. That way, new folders are automatically linted and we need to explicitly exclude them if we don't want to run for those. (cherry picked from commit 0d7e038)
1 parent 61edae8 commit d1ac6b0

File tree

11 files changed

+96
-21
lines changed

11 files changed

+96
-21
lines changed

src/google-maps/google-map/google-map.ts

Lines changed: 11 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.io/license
7+
*/
8+
19
import {
210
AfterContentInit,
311
ChangeDetectionStrategy,
@@ -11,6 +19,7 @@ import {
1119
OnInit,
1220
Output,
1321
QueryList,
22+
ViewEncapsulation,
1423
} from '@angular/core';
1524
import {BehaviorSubject, combineLatest, Observable, Subject} from 'rxjs';
1625
import {map, shareReplay, take, takeUntil} from 'rxjs/operators';
@@ -47,9 +56,11 @@ export const DEFAULT_WIDTH = '500px';
4756
* @see https://developers.google.com/maps/documentation/javascript/reference/
4857
*/
4958
@Component({
59+
moduleId: module.id,
5060
selector: 'google-map',
5161
changeDetection: ChangeDetectionStrategy.OnPush,
5262
template: '<div class="map-container"></div><ng-content></ng-content>',
63+
encapsulation: ViewEncapsulation.None,
5364
})
5465
export class GoogleMap implements OnChanges, OnInit, AfterContentInit, OnDestroy {
5566
@Input() height = DEFAULT_HEIGHT;

src/google-maps/map-marker/map-marker.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
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.io/license
7+
*/
8+
19
import {
210
ChangeDetectionStrategy,
311
Component,
412
EventEmitter,
513
Input,
614
OnDestroy,
715
OnInit,
8-
Output
16+
Output,
17+
ViewEncapsulation
918
} from '@angular/core';
1019
import {BehaviorSubject, combineLatest, Observable, ReplaySubject, Subject} from 'rxjs';
1120
import {map, takeUntil} from 'rxjs/operators';
@@ -23,9 +32,11 @@ export const DEFAULT_MARKER_OPTIONS = {
2332
* @see developers.google.com/maps/documentation/javascript/reference/marker
2433
*/
2534
@Component({
35+
moduleId: module.id,
2636
selector: 'map-marker',
2737
template: '<ng-content></ng-content>',
2838
changeDetection: ChangeDetectionStrategy.OnPush,
39+
encapsulation: ViewEncapsulation.None,
2940
})
3041
export class MapMarker implements OnInit, OnDestroy {
3142
@Input()

src/google-maps/testing/fake-google-map-utils.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.io/license
7+
*/
8+
19
import {UpdatedGoogleMap} from '../google-map/index';
210

311
/** Window interface for testing */

src/youtube-player/fake-youtube-player.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.io/license
7+
*/
8+
19
// A re-creation of YT.PlayerState since enum values cannot be bound to the window
210
// object.
311
const playerState = {

src/youtube-player/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
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.io/license
7+
*/
8+
19
export * from './public-api';

src/youtube-player/public-api.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
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.io/license
7+
*/
8+
19
export * from './youtube-module';
210
export {YouTubePlayer} from './youtube-player';

src/youtube-player/tsconfig-build.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// TypeScript config file that is used to compile the Material package through Gulp. As the
2-
// long term goal is to switch to Bazel, and we already want to run tests with Bazel, we need to
3-
// ensure the TypeScript build options are the same for Gulp and Bazel. We achieve this by
1+
// TypeScript config file that is used to compile the "youtube-player" package through Gulp. As
2+
// the long term goal is to switch to Bazel, and we already want to run tests with Bazel, we need
3+
// to ensure the TypeScript build options are the same for Gulp and Bazel. We achieve this by
44
// extending the generic Bazel build tsconfig which will be used for each entry-point.
55
{
66
"extends": "../bazel-tsconfig-build.json",
@@ -15,7 +15,8 @@
1515
"types": ["youtube"]
1616
},
1717
"files": [
18-
"public-api.ts"
18+
"public-api.ts",
19+
"typings.d.ts"
1920
],
2021
"angularCompilerOptions": {
2122
"annotateForClosureCompiler": true,

src/youtube-player/typings.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare var module: {id: string};

src/youtube-player/youtube-module.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.io/license
7+
*/
8+
19
import {CommonModule} from '@angular/common';
210
import {NgModule} from '@angular/core';
311

src/youtube-player/youtube-player.ts

Lines changed: 24 additions & 13 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.io/license
7+
*/
8+
19
import {
210
AfterViewInit,
311
ChangeDetectionStrategy,
@@ -7,37 +15,38 @@ import {
715
Input,
816
NgZone,
917
OnDestroy,
18+
OnInit,
1019
Output,
1120
ViewChild,
12-
OnInit,
21+
ViewEncapsulation,
1322
} from '@angular/core';
1423

1524
import {
1625
combineLatest,
17-
of as observableOf,
18-
Observable,
1926
ConnectableObservable,
20-
pipe,
21-
MonoTypeOperatorFunction,
2227
merge,
28+
MonoTypeOperatorFunction,
29+
Observable,
30+
of as observableOf,
2331
OperatorFunction,
32+
pipe,
2433
Subject,
2534
} from 'rxjs';
2635

2736
import {
2837
combineLatest as combineLatestOp,
38+
distinctUntilChanged,
39+
filter,
40+
first,
41+
flatMap,
2942
map,
43+
publish,
3044
scan,
31-
withLatestFrom,
32-
flatMap,
33-
filter,
45+
skipWhile,
3446
startWith,
35-
publish,
36-
first,
37-
distinctUntilChanged,
38-
takeUntil,
3947
take,
40-
skipWhile,
48+
takeUntil,
49+
withLatestFrom,
4150
} from 'rxjs/operators';
4251

4352
declare global {
@@ -66,8 +75,10 @@ type UninitializedPlayer = Pick<Player, 'videoId' | 'destroy' | 'addEventListene
6675
* @see https://developers.google.com/youtube/iframe_api_reference
6776
*/
6877
@Component({
78+
moduleId: module.id,
6979
selector: 'youtube-player',
7080
changeDetection: ChangeDetectionStrategy.OnPush,
81+
encapsulation: ViewEncapsulation.None,
7182
// This div is *replaced* by the YouTube player embed.
7283
template: '<div #youtube_container></div>',
7384
})

tslint.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@
126126
"!host": "\\[class\\]"
127127
},
128128
"NgModule": "^(?!\\s*$).+"
129-
}, "src/+(material|cdk|material-experimental|cdk-experimental)/**/!(*.spec).ts"],
129+
}, "src/!(a11y-demo|e2e-app|material-examples|universal-app|dev-app)/**/!(*.spec).ts"],
130130
"require-license-banner": [
131131
true,
132-
"src/+(material|cdk|material-experimental|cdk-experimental|dev-app)/**/!(*.spec).ts"
132+
"src/!(a11y-demo|e2e-app|material-examples|universal-app)/**/!(*.spec).ts"
133133
],
134134
"missing-rollup-globals": [
135135
true,
136136
"./tools/package-tools/rollup-globals.ts",
137-
"src/+(material|cdk|material-examples|material-experimental|cdk-experimental)/!(schematics)**/*.ts"
137+
"src/!(a11y-demo|e2e-app|material-examples|universal-app|dev-app)/!(schematics)**/*.ts"
138138
],
139139
"file-name-casing": [true, {
140140
// Exclude custom lint rule files since they have to always be camel-cased and end

0 commit comments

Comments
 (0)