Skip to content

Commit 4890bcb

Browse files
chore(lint): Fix line breaks
1 parent 7921520 commit 4890bcb

File tree

11 files changed

+144
-37
lines changed

11 files changed

+144
-37
lines changed

sample/src/app/app.module.ts

+20-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import { environment } from '../environments/environment';
99
import { AngularFireModule } from '@angular/fire';
1010
import { AngularFireStorageModule } from '@angular/fire/storage';
1111

12-
import { AngularFireAnalyticsModule, DEBUG_MODE as ANALYTICS_DEBUG_MODE, ScreenTrackingService, UserTrackingService } from '@angular/fire/analytics';
12+
import {
13+
AngularFireAnalyticsModule,
14+
DEBUG_MODE as ANALYTICS_DEBUG_MODE,
15+
ScreenTrackingService,
16+
UserTrackingService
17+
} from '@angular/fire/analytics';
1318

1419
import { FirestoreComponent } from './firestore/firestore.component';
1520

@@ -28,7 +33,7 @@ import { RemoteConfigComponent } from './remote-config/remote-config.component';
2833
const shouldUseEmulator = () => false;
2934

3035
@NgModule({
31-
declarations: [ AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent ],
36+
declarations: [AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent],
3237
imports: [
3338
BrowserModule.withServerTransition({ appId: 'serverApp' }),
3439
BrowserTransferStateModule,
@@ -50,12 +55,19 @@ const shouldUseEmulator = () => false;
5055
UserTrackingService,
5156
ScreenTrackingService,
5257
PerformanceMonitoringService,
53-
{ provide: ANALYTICS_DEBUG_MODE, useFactory: () => isDevMode() },
54-
{ provide: DATABASE_URL, useFactory: () => shouldUseEmulator() ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined },
55-
{ provide: FIRESTORE_SETTINGS, useFactory: () => shouldUseEmulator() ? { host: 'localhost:8080', ssl: false } : {} },
56-
{ provide: FUNCTIONS_ORIGIN, useFactory: () => shouldUseEmulator() ? 'http://localhost:9999' : undefined },
58+
{
59+
provide: ANALYTICS_DEBUG_MODE,
60+
useFactory: () => isDevMode()
61+
},
62+
{
63+
provide: DATABASE_URL,
64+
useFactory: () => shouldUseEmulator() ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined
65+
},
66+
{ provide: FIRESTORE_SETTINGS, useFactory: () => shouldUseEmulator() ? { host: 'localhost:8080', ssl: false } : {} },
67+
{ provide: FUNCTIONS_ORIGIN, useFactory: () => shouldUseEmulator() ? 'http://localhost:9999' : undefined },
5768
{ provide: REMOTE_CONFIG_SETTINGS, useFactory: () => isDevMode() ? { minimumFetchIntervalMillis: 10_000 } : {} }
5869
],
59-
bootstrap: [ AppComponent ]
70+
bootstrap: [AppComponent]
6071
})
61-
export class AppModule { }
72+
export class AppModule {
73+
}

sample/src/app/storage/storage.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import { startWith, tap } from 'rxjs/operators';
55
import { makeStateKey, TransferState } from '@angular/platform-browser';
66
import { trace } from '@angular/fire/performance';
77

8-
const TRANSPARENT_PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
8+
const TRANSPARENT_PNG
9+
= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
910

1011
@Component({
1112
selector: 'app-storage',
1213
template: `
1314
<p>
1415
Storage!
15-
<img [src]="downloadUrl$ | async" width="64" height="64" />
16+
<img [src]="downloadUrl$ | async" width="64" height="64"/>
1617
</p>
1718
`,
1819
styles: []

src/analytics/analytics.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } fro
22
import { EMPTY, Observable, of } from 'rxjs';
33
import { isPlatformBrowser } from '@angular/common';
44
import { map, observeOn, shareReplay, switchMap, tap } from 'rxjs/operators';
5-
import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵfirebaseAppFactory, ɵlazySDKProxy, ɵPromiseProxy } from '@angular/fire';
5+
import {
6+
FIREBASE_APP_NAME,
7+
FIREBASE_OPTIONS,
8+
FirebaseAppConfig,
9+
FirebaseOptions,
10+
ɵAngularFireSchedulers,
11+
ɵfirebaseAppFactory,
12+
ɵlazySDKProxy,
13+
ɵPromiseProxy
14+
} from '@angular/fire';
615
import { analytics } from 'firebase';
716

817
export interface Config {

src/core/angularfire2.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import { NgZone } from '@angular/core';
2-
import { asyncScheduler, Observable, Operator, queueScheduler, SchedulerAction, SchedulerLike, Subscriber, Subscription, TeardownLogic } from 'rxjs';
2+
import {
3+
asyncScheduler,
4+
Observable,
5+
Operator,
6+
queueScheduler,
7+
SchedulerAction,
8+
SchedulerLike,
9+
Subscriber,
10+
Subscription,
11+
TeardownLogic
12+
} from 'rxjs';
313
import { observeOn, subscribeOn, tap } from 'rxjs/operators';
414

515
function noop() {

src/database/database.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ import { AngularFireList, AngularFireObject, DatabaseQuery, PathReference, Query
33
import { getRef } from './utils';
44
import { createListReference } from './list/create-reference';
55
import { createObjectReference } from './object/create-reference';
6-
import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵfirebaseAppFactory, ɵkeepUnstableUntilFirstFactory } from '@angular/fire';
6+
import {
7+
FIREBASE_APP_NAME,
8+
FIREBASE_OPTIONS,
9+
FirebaseAppConfig,
10+
FirebaseOptions,
11+
ɵAngularFireSchedulers,
12+
ɵfirebaseAppFactory,
13+
ɵkeepUnstableUntilFirstFactory
14+
} from '@angular/fire';
715
import { Observable } from 'rxjs';
816
import { database } from 'firebase/app';
917
import 'firebase/database';

src/firestore/collection/changes.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export function docChanges<T>(query: Query, scheduler?: SchedulerLike): Observab
1919
/**
2020
* Return a stream of document changes on a query. These results are in sort order.
2121
*/
22-
export function sortedChanges<T>(query: Query, events: DocumentChangeType[], scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]> {
22+
export function sortedChanges<T>(
23+
query: Query,
24+
events: DocumentChangeType[],
25+
scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]> {
2326
return fromCollectionRef(query, scheduler)
2427
.pipe(
2528
map(changes => changes.payload.docChanges()),

src/firestore/firestore.ts

+32-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';
22
import { from, Observable, of } from 'rxjs';
3-
import { AssociatedReference, CollectionReference, DocumentReference, PersistenceSettings, Query, QueryFn, QueryGroupFn, Settings } from './interfaces';
3+
import {
4+
AssociatedReference,
5+
CollectionReference,
6+
DocumentReference,
7+
PersistenceSettings,
8+
Query,
9+
QueryFn,
10+
QueryGroupFn,
11+
Settings
12+
} from './interfaces';
413
import { AngularFirestoreDocument } from './document/document';
514
import { AngularFirestoreCollection } from './collection/collection';
615
import { AngularFirestoreCollectionGroup } from './collection-group/collection-group';
7-
import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵfirebaseAppFactory, ɵkeepUnstableUntilFirstFactory } from '@angular/fire';
16+
import {
17+
FIREBASE_APP_NAME,
18+
FIREBASE_OPTIONS,
19+
FirebaseAppConfig,
20+
FirebaseOptions,
21+
ɵAngularFireSchedulers,
22+
ɵfirebaseAppFactory,
23+
ɵkeepUnstableUntilFirstFactory
24+
} from '@angular/fire';
825
import { isPlatformServer } from '@angular/common';
926
import { firestore } from 'firebase/app';
1027
import firebase from '@firebase/app';
@@ -15,7 +32,7 @@ import 'firebase/firestore';
1532
* The value of this token determines whether or not the firestore will have persistance enabled
1633
*/
1734
export const ENABLE_PERSISTENCE = new InjectionToken<boolean>('angularfire2.enableFirestorePersistence');
18-
export const PERSISTENCE_SETTINGS = new InjectionToken<PersistenceSettings|undefined>('angularfire2.firestore.persistenceSettings');
35+
export const PERSISTENCE_SETTINGS = new InjectionToken<PersistenceSettings | undefined>('angularfire2.firestore.persistenceSettings');
1936
export const SETTINGS = new InjectionToken<Settings>('angularfire2.firestore.settings');
2037

2138
/**
@@ -107,13 +124,13 @@ export class AngularFirestore {
107124
*/
108125
constructor(
109126
@Inject(FIREBASE_OPTIONS) options: FirebaseOptions,
110-
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig: string|FirebaseAppConfig|null|undefined,
111-
@Optional() @Inject(ENABLE_PERSISTENCE) shouldEnablePersistence: boolean|null,
112-
@Optional() @Inject(SETTINGS) settings: Settings|null,
127+
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig: string | FirebaseAppConfig | null | undefined,
128+
@Optional() @Inject(ENABLE_PERSISTENCE) shouldEnablePersistence: boolean | null,
129+
@Optional() @Inject(SETTINGS) settings: Settings | null,
113130
// tslint:disable-next-line:ban-types
114131
@Inject(PLATFORM_ID) platformId: Object,
115132
zone: NgZone,
116-
@Optional() @Inject(PERSISTENCE_SETTINGS) persistenceSettings: PersistenceSettings|null,
133+
@Optional() @Inject(PERSISTENCE_SETTINGS) persistenceSettings: PersistenceSettings | null
117134
) {
118135
this.schedulers = new ɵAngularFireSchedulers(zone);
119136
this.keepUnstableUntilFirst = ɵkeepUnstableUntilFirstFactory(this.schedulers, platformId);
@@ -123,9 +140,13 @@ export class AngularFirestore {
123140
// INVESTIGATE this seems to be required because in the browser build registerFirestore is an Object?
124141
// seems like we're fighting ngcc. In the server firestore() isn't available, so I have to register
125142
// in the browser registerFirestore is not a function... maybe this is an underlying firebase-js-sdk issue
126-
if (registerFirestore) { registerFirestore(firebase); }
143+
if (registerFirestore) {
144+
registerFirestore(firebase);
145+
}
127146
const firestore = app.firestore();
128-
if (settings) { firestore.settings(settings); }
147+
if (settings) {
148+
firestore.settings(settings);
149+
}
129150
return firestore;
130151
});
131152

@@ -150,7 +171,7 @@ export class AngularFirestore {
150171
* CollectionReference and an optional query function to narrow the result
151172
* set.
152173
*/
153-
collection<T>(path: string| CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>;
174+
collection<T>(path: string | CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>;
154175
collection<T>(pathOrRef: string | CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T> {
155176
let collectionRef: CollectionReference;
156177
if (typeof pathOrRef === 'string') {
@@ -180,6 +201,7 @@ export class AngularFirestore {
180201
* Collection reference and can be queried.
181202
*/
182203
doc<T>(path: string): AngularFirestoreDocument<T>;
204+
// tslint:disable-next-line:unified-signatures
183205
doc<T>(ref: DocumentReference): AngularFirestoreDocument<T>;
184206
doc<T>(pathOrRef: string | DocumentReference): AngularFirestoreDocument<T> {
185207
let ref: DocumentReference;

src/messaging/messaging.ts

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import { Inject, Injectable, NgZone, Optional, PLATFORM_ID } from '@angular/core';
22
import { messaging } from 'firebase/app';
3-
import { EMPTY, Observable, of, throwError } from 'rxjs';
4-
import { catchError, concat, defaultIfEmpty, map, mergeMap, observeOn, switchMap } from 'rxjs/operators';
5-
import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵfirebaseAppFactory, ɵlazySDKProxy, ɵPromiseProxy } from '@angular/fire';
3+
import { concat, EMPTY, Observable, of, throwError } from 'rxjs';
4+
import { catchError, defaultIfEmpty, map, mergeMap, observeOn, switchMap } from 'rxjs/operators';
5+
import {
6+
FIREBASE_APP_NAME,
7+
FIREBASE_OPTIONS,
8+
FirebaseAppConfig,
9+
FirebaseOptions,
10+
ɵAngularFireSchedulers,
11+
ɵfirebaseAppFactory,
12+
ɵlazySDKProxy,
13+
ɵPromiseProxy
14+
} from '@angular/fire';
615
import { isPlatformServer } from '@angular/common';
716

817
export interface AngularFireMessaging extends Omit<ɵPromiseProxy<messaging.Messaging>, 'deleteToken' | 'getToken' | 'requestPermission'> {
@@ -62,10 +71,12 @@ export class AngularFireMessaging {
6271
))
6372
);
6473

65-
this.tokenChanges = messaging.pipe(
66-
observeOn(schedulers.outsideAngular),
67-
switchMap(messaging => messaging.getToken()),
68-
concat(tokenChanges)
74+
this.tokenChanges = concat(
75+
messaging.pipe(
76+
observeOn(schedulers.outsideAngular),
77+
switchMap(messaging => messaging.getToken())
78+
),
79+
tokenChanges
6980
);
7081

7182
this.messages = messaging.pipe(

src/remote-config/remote-config.ts

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';
22
import { concat, EMPTY, MonoTypeOperatorFunction, Observable, of, OperatorFunction, pipe } from 'rxjs';
3-
import { debounceTime, distinctUntilChanged, filter, groupBy, map, mergeMap, observeOn, scan, shareReplay, startWith, switchMap, tap, withLatestFrom } from 'rxjs/operators';
4-
import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵfirebaseAppFactory, ɵlazySDKProxy, ɵPromiseProxy } from '@angular/fire';
3+
import {
4+
debounceTime,
5+
distinctUntilChanged,
6+
filter,
7+
groupBy,
8+
map,
9+
mergeMap,
10+
observeOn,
11+
scan,
12+
shareReplay,
13+
startWith,
14+
switchMap,
15+
tap,
16+
withLatestFrom
17+
} from 'rxjs/operators';
18+
import {
19+
FIREBASE_APP_NAME,
20+
FIREBASE_OPTIONS,
21+
FirebaseAppConfig,
22+
FirebaseOptions,
23+
ɵAngularFireSchedulers,
24+
ɵfirebaseAppFactory,
25+
ɵlazySDKProxy,
26+
ɵPromiseProxy
27+
} from '@angular/fire';
528
import { remoteConfig } from 'firebase/app';
629
import { isPlatformBrowser } from '@angular/common';
730

src/storage/storage.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';
22
import { createStorageRef } from './ref';
33
import { Observable } from 'rxjs';
4-
import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵfirebaseAppFactory, ɵkeepUnstableUntilFirstFactory } from '@angular/fire';
4+
import {
5+
FIREBASE_APP_NAME,
6+
FIREBASE_OPTIONS,
7+
FirebaseAppConfig,
8+
FirebaseOptions,
9+
ɵAngularFireSchedulers,
10+
ɵfirebaseAppFactory,
11+
ɵkeepUnstableUntilFirstFactory
12+
} from '@angular/fire';
513
import { UploadMetadata } from './interfaces';
614
import { storage } from 'firebase/app';
715
import 'firebase/storage';
@@ -26,8 +34,9 @@ export class AngularFireStorage {
2634

2735
constructor(
2836
@Inject(FIREBASE_OPTIONS) options: FirebaseOptions,
29-
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig: string|FirebaseAppConfig|null|undefined,
30-
@Optional() @Inject(BUCKET) storageBucket: string|null,
37+
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig: string | FirebaseAppConfig | null | undefined,
38+
@Optional() @Inject(BUCKET) storageBucket: string | null,
39+
// tslint:disable-next-line:ban-types
3140
@Inject(PLATFORM_ID) platformId: Object,
3241
zone: NgZone
3342
) {

tslint.json

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"no-non-null-assertion": true,
6262
"no-redundant-jsdoc": true,
6363
"no-switch-case-fall-through": true,
64-
"no-use-before-declare": true,
6564
"no-var-requires": false,
6665
"object-literal-key-quotes": [
6766
true,

0 commit comments

Comments
 (0)