Skip to content

Commit 7df1608

Browse files
chore(lint): Fix some lint errors
1 parent 9e19b14 commit 7df1608

69 files changed

Lines changed: 423 additions & 423 deletions

Some content is hidden

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

sample/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { APP_BASE_HREF } from '@angular/common';
99
import { existsSync } from 'fs';
1010

1111
// Polyfill XMLHttpRequest and WS for Firebase
12-
global['XMLHttpRequest'] = require("xhr2");
13-
global['WebSocket'] = require("ws");
12+
global.XMLHttpRequest = require('xhr2');
13+
global.WebSocket = require('ws');
1414

1515
// The Express app is exported so that it can be used by serverless Functions.
1616
export function app() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
99

1010
@Component({
1111
selector: 'app-storage',
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export const environment = {
22
production: true,
33
firebase: {
4-
apiKey: "AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg",
5-
authDomain: "aftest-94085.firebaseapp.com",
6-
databaseURL: "https://aftest-94085.firebaseio.com",
7-
projectId: "aftest-94085",
8-
storageBucket: "aftest-94085.appspot.com",
9-
messagingSenderId: "480362569154",
10-
appId: "1:480362569154:web:2fe6f75104cdfb82f50a5b",
11-
measurementId: "G-CBRYER9PJR"
4+
apiKey: 'AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg',
5+
authDomain: 'aftest-94085.firebaseapp.com',
6+
databaseURL: 'https://aftest-94085.firebaseio.com',
7+
projectId: 'aftest-94085',
8+
storageBucket: 'aftest-94085.appspot.com',
9+
messagingSenderId: '480362569154',
10+
appId: '1:480362569154:web:2fe6f75104cdfb82f50a5b',
11+
measurementId: 'G-CBRYER9PJR'
1212
}
1313
};

sample/src/environments/environment.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
export const environment = {
66
production: false,
77
firebase: {
8-
apiKey: "AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg",
9-
authDomain: "aftest-94085.firebaseapp.com",
10-
databaseURL: "https://aftest-94085.firebaseio.com",
11-
projectId: "aftest-94085",
12-
storageBucket: "aftest-94085.appspot.com",
13-
messagingSenderId: "480362569154",
14-
appId: "1:480362569154:web:2fe6f75104cdfb82f50a5b",
15-
measurementId: "G-CBRYER9PJR"
8+
apiKey: 'AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg',
9+
authDomain: 'aftest-94085.firebaseapp.com',
10+
databaseURL: 'https://aftest-94085.firebaseio.com',
11+
projectId: 'aftest-94085',
12+
storageBucket: 'aftest-94085.appspot.com',
13+
messagingSenderId: '480362569154',
14+
appId: '1:480362569154:web:2fe6f75104cdfb82f50a5b',
15+
measurementId: 'G-CBRYER9PJR'
1616
}
1717
};
1818

src/analytics/analytics.service.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ const ANNOTATIONS = '__annotations__';
3535
export class ScreenTrackingService implements OnDestroy {
3636

3737
private disposable: Subscription|undefined;
38-
38+
3939
constructor(
4040
analytics: AngularFireAnalytics,
41-
@Optional() router:Router,
42-
@Optional() title:Title,
41+
@Optional() router: Router,
42+
@Optional() title: Title,
4343
componentFactoryResolver: ComponentFactoryResolver,
44-
@Inject(PLATFORM_ID) platformId:Object,
45-
@Optional() @Inject(DEBUG_MODE) debugModeEnabled:boolean|null,
44+
@Inject(PLATFORM_ID) platformId: Object,
45+
@Optional() @Inject(DEBUG_MODE) debugModeEnabled: boolean|null,
4646
zone: NgZone,
4747
injector: Injector
4848
) {
49-
if (!router || !isPlatformBrowser(platformId)) { return this }
49+
if (!router || !isPlatformBrowser(platformId)) { return this; }
5050
zone.runOutsideAngular(() => {
5151
const activationEndEvents = router.events.pipe(filter<ActivationEnd>(e => e instanceof ActivationEnd));
5252
const navigationEndEvents = router.events.pipe(filter<NavigationEnd>(e => e instanceof NavigationEnd));
@@ -64,13 +64,13 @@ export class ScreenTrackingService implements OnDestroy {
6464
[OUTLET_KEY]: activationEnd.snapshot.outlet
6565
};
6666
if (title) {
67-
params[PAGE_TITLE_KEY] = title.getTitle()
67+
params[PAGE_TITLE_KEY] = title.getTitle();
6868
}
6969
const component = activationEnd.snapshot.component;
7070
const routeConfig = activationEnd.snapshot.routeConfig;
7171
const loadChildren = routeConfig && routeConfig.loadChildren;
7272
// TODO figure out how to handle minification
73-
if (typeof loadChildren === "string") {
73+
if (typeof loadChildren === 'string') {
7474
// SEMVER: this is the older lazy load style "./path#ClassName", drop this when we drop old ng
7575
// TODO is it worth seeing if I can look up the component factory selector from the module name?
7676
// it's lazy so it's not registered with componentFactoryResolver yet... seems a pain for a depreciated style
@@ -82,7 +82,7 @@ export class ScreenTrackingService implements OnDestroy {
8282
return of({...params, [SCREEN_CLASS_KEY]: componentFactory.selector });
8383
} else if (loadChildren) {
8484
const loadedChildren = loadChildren();
85-
var loadedChildren$: Observable<any> = (loadedChildren instanceof Observable) ? loadedChildren : from(Promise.resolve(loadedChildren));
85+
const loadedChildren$: Observable<any> = (loadedChildren instanceof Observable) ? loadedChildren : from(Promise.resolve(loadedChildren));
8686
return loadedChildren$.pipe(
8787
map(lazyModule => {
8888
if (lazyModule instanceof NgModuleFactory) {
@@ -94,14 +94,14 @@ export class ScreenTrackingService implements OnDestroy {
9494
try {
9595
const componentFactory = moduleRef.componentFactoryResolver.resolveComponentFactory(component!);
9696
return {...params, [SCREEN_CLASS_KEY]: componentFactory.selector};
97-
} catch(_) {
97+
} catch (_) {
9898
return {...params, [SCREEN_CLASS_KEY]: DEFAULT_SCREEN_CLASS};
9999
}
100100
} else {
101101
// JIT look at the annotations
102102
// INVESTIGATE are there public APIs for this stuff?
103-
const declarations = [].concat.apply([], (lazyModule[ANNOTATIONS] || []).map((f:any) => f.declarations));
104-
const selectors = [].concat.apply([], declarations.map((c:any) => (c[ANNOTATIONS] || []).map((f:any) => f.selector)));
103+
const declarations = [].concat.apply([], (lazyModule[ANNOTATIONS] || []).map((f: any) => f.declarations));
104+
const selectors = [].concat.apply([], declarations.map((c: any) => (c[ANNOTATIONS] || []).map((f: any) => f.selector)));
105105
// should I just be grabbing the selector like this or should i match against the route component?
106106
// const routerModule = lazyModule.ngInjectorDef.imports.find(i => i.ngModule && ....);
107107
// const route = routerModule.providers[0].find(p => p.provide == ROUTES).useValue[0];
@@ -127,7 +127,7 @@ export class ScreenTrackingService implements OnDestroy {
127127
[SCREEN_CLASS_KEY]: params[SCREEN_CLASS_KEY]
128128
});
129129
if (title) {
130-
analytics.updateConfig({ [PAGE_TITLE_KEY]: params[PAGE_TITLE_KEY] })
130+
analytics.updateConfig({ [PAGE_TITLE_KEY]: params[PAGE_TITLE_KEY] });
131131
}
132132
}
133133
}),
@@ -144,11 +144,11 @@ export class ScreenTrackingService implements OnDestroy {
144144
).subscribe();
145145
});
146146
}
147-
147+
148148
ngOnDestroy() {
149149
if (this.disposable) { this.disposable.unsubscribe(); }
150150
}
151-
151+
152152
}
153153

154154
@Injectable({
@@ -162,7 +162,7 @@ export class UserTrackingService implements OnDestroy {
162162
constructor(
163163
analytics: AngularFireAnalytics,
164164
zone: NgZone,
165-
@Inject(PLATFORM_ID) platformId:Object
165+
@Inject(PLATFORM_ID) platformId: Object
166166
) {
167167
const schedulers = new ɵAngularFireSchedulers(zone);
168168

@@ -186,11 +186,11 @@ export class UserTrackingService implements OnDestroy {
186186
}
187187

188188
// this is an INT64 in iOS/Android but use INT32 cause javascript
189-
let nextScreenInstanceID = Math.floor(Math.random() * (2**32 - 1)) - 2**31;
189+
let nextScreenInstanceID = Math.floor(Math.random() * (2 ** 32 - 1)) - 2 ** 31;
190190

191-
const knownScreenInstanceIDs: {[key:string]: number} = {};
191+
const knownScreenInstanceIDs: {[key: string]: number} = {};
192192

193-
const getScreenInstanceID = (params:{[key:string]: any}) => {
193+
const getScreenInstanceID = (params: {[key: string]: any}) => {
194194
// unique the screen class against the outlet name
195195
const screenInstanceKey = [
196196
params[SCREEN_CLASS_KEY],
@@ -203,4 +203,4 @@ const getScreenInstanceID = (params:{[key:string]: any}) => {
203203
knownScreenInstanceIDs[screenInstanceKey] = ret;
204204
return ret;
205205
}
206-
}
206+
};

src/analytics/analytics.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ describe('AngularFireAnalytics', () => {
3434
expect(analytics.app).toBeDefined();
3535
});
3636

37-
});
37+
});

src/analytics/analytics.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { map, tap, shareReplay, switchMap, observeOn } from 'rxjs/operators';
55
import { FirebaseAppConfig, FirebaseOptions, ɵAngularFireSchedulers, ɵlazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵfirebaseAppFactory, ɵPromiseProxy } from '@angular/fire';
66
import { analytics } from 'firebase';
77

8-
export interface Config {[key:string]: any};
8+
export interface Config {[key: string]: any; }
99

1010
export const COLLECTION_ENABLED = new InjectionToken<boolean>('angularfire2.analytics.analyticsCollectionEnabled');
1111
export const APP_VERSION = new InjectionToken<string>('angularfire2.analytics.appVersion');
@@ -21,11 +21,11 @@ const GTAG_CONFIG_COMMAND = 'config';
2121
const GTAG_FUNCTION_NAME = 'gtag';
2222
const DATA_LAYER_NAME = 'dataLayer';
2323

24-
export interface AngularFireAnalytics extends ɵPromiseProxy<analytics.Analytics> {};
24+
export interface AngularFireAnalytics extends ɵPromiseProxy<analytics.Analytics> {}
2525

2626
let gtag: (...args: any[]) => void;
2727
let analyticsInitialized: Promise<void>;
28-
const analyticsInstanceCache: {[key:string]: Observable<analytics.Analytics>} = {};
28+
const analyticsInstanceCache: {[key: string]: Observable<analytics.Analytics>} = {};
2929

3030
@Injectable({
3131
providedIn: 'any'
@@ -35,30 +35,30 @@ export class AngularFireAnalytics {
3535
async updateConfig(config: Config) {
3636
await analyticsInitialized;
3737
gtag(GTAG_CONFIG_COMMAND, this.options[ANALYTICS_ID_FIELD], { ...config, update: true });
38-
};
38+
}
3939

4040
constructor(
41-
@Inject(FIREBASE_OPTIONS) private options:FirebaseOptions,
42-
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig:string|FirebaseAppConfig|null|undefined,
43-
@Optional() @Inject(COLLECTION_ENABLED) analyticsCollectionEnabled:boolean|null,
44-
@Optional() @Inject(APP_VERSION) providedAppVersion:string|null,
45-
@Optional() @Inject(APP_NAME) providedAppName:string|null,
46-
@Optional() @Inject(DEBUG_MODE) debugModeEnabled:boolean|null,
47-
@Optional() @Inject(CONFIG) providedConfig:Config|null,
48-
@Inject(PLATFORM_ID) platformId:Object,
41+
@Inject(FIREBASE_OPTIONS) private options: FirebaseOptions,
42+
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig: string|FirebaseAppConfig|null|undefined,
43+
@Optional() @Inject(COLLECTION_ENABLED) analyticsCollectionEnabled: boolean|null,
44+
@Optional() @Inject(APP_VERSION) providedAppVersion: string|null,
45+
@Optional() @Inject(APP_NAME) providedAppName: string|null,
46+
@Optional() @Inject(DEBUG_MODE) debugModeEnabled: boolean|null,
47+
@Optional() @Inject(CONFIG) providedConfig: Config|null,
48+
@Inject(PLATFORM_ID) platformId: Object,
4949
zone: NgZone
5050
) {
5151

5252
if (!analyticsInitialized) {
5353
if (isPlatformBrowser(platformId)) {
54-
gtag = window[GTAG_FUNCTION_NAME] || function() { window[DATA_LAYER_NAME].push(arguments) };
54+
gtag = window[GTAG_FUNCTION_NAME] || function() { window[DATA_LAYER_NAME].push(arguments); };
5555
window[DATA_LAYER_NAME] = window[DATA_LAYER_NAME] || [];
5656
analyticsInitialized = zone.runOutsideAngular(() =>
5757
new Promise(resolve => {
5858
window[GTAG_FUNCTION_NAME] = (...args: any[]) => {
59-
if (args[0] == 'js') { resolve() }
59+
if (args[0] == 'js') { resolve(); }
6060
gtag(...args);
61-
}
61+
};
6262
})
6363
);
6464
} else {
@@ -75,20 +75,20 @@ export class AngularFireAnalytics {
7575
map(() => ɵfirebaseAppFactory(options, zone, nameOrConfig)),
7676
map(app => app.analytics()),
7777
tap(analytics => {
78-
if (analyticsCollectionEnabled === false) { analytics.setAnalyticsCollectionEnabled(false) }
78+
if (analyticsCollectionEnabled === false) { analytics.setAnalyticsCollectionEnabled(false); }
7979
}),
8080
shareReplay({ bufferSize: 1, refCount: false }),
8181
);
8282
analyticsInstanceCache[options[ANALYTICS_ID_FIELD]] = analytics;
8383
}
8484

85-
if (providedConfig) { this.updateConfig(providedConfig) }
86-
if (providedAppName) { this.updateConfig({ [APP_NAME_KEY]: providedAppName }) }
87-
if (providedAppVersion) { this.updateConfig({ [APP_VERSION_KEY]: providedAppVersion }) }
88-
if (debugModeEnabled) { this.updateConfig({ [DEBUG_MODE_KEY]: 1 }) }
85+
if (providedConfig) { this.updateConfig(providedConfig); }
86+
if (providedAppName) { this.updateConfig({ [APP_NAME_KEY]: providedAppName }); }
87+
if (providedAppVersion) { this.updateConfig({ [APP_VERSION_KEY]: providedAppVersion }); }
88+
if (debugModeEnabled) { this.updateConfig({ [DEBUG_MODE_KEY]: 1 }); }
8989

9090
return ɵlazySDKProxy(this, analytics, zone);
9191

9292
}
9393

94-
}
94+
}

src/auth-guard/auth-guard.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ describe('AngularFireAuthGuard', () => {
3232
afterEach(done => {
3333
app.delete().then(done, done);
3434
});
35-
35+
3636
it('should be injectable', () => {
3737
expect(router).toBeTruthy();
3838
});
39-
});
39+
});

src/auth-guard/auth-guard.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Injectable, Inject, Optional, NgZone } from '@angular/core';
22
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
33
import { Observable, of, pipe, UnaryFunction } from 'rxjs';
4-
import { map, switchMap, take, observeOn, shareReplay } from 'rxjs/operators'
4+
import { map, switchMap, take, observeOn, shareReplay } from 'rxjs/operators';
55
import { User } from 'firebase/app';
66
import { ɵAngularFireSchedulers, FirebaseOptions, FirebaseAppConfig, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵfirebaseAppFactory } from '@angular/fire';
77

@@ -16,8 +16,8 @@ export class AngularFireAuthGuard implements CanActivate {
1616
authState: Observable<User|null>;
1717

1818
constructor(
19-
@Inject(FIREBASE_OPTIONS) options:FirebaseOptions,
20-
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig:string|FirebaseAppConfig|null|undefined,
19+
@Inject(FIREBASE_OPTIONS) options: FirebaseOptions,
20+
@Optional() @Inject(FIREBASE_APP_NAME) nameOrConfig: string|FirebaseAppConfig|null|undefined,
2121
zone: NgZone,
2222
private router: Router
2323
) {
@@ -40,7 +40,7 @@ export class AngularFireAuthGuard implements CanActivate {
4040
return this.authState.pipe(
4141
take(1),
4242
authPipeFactory(next, state),
43-
map(can => typeof can == "boolean" ? can : this.router.createUrlTree(<any[]>can))
43+
map(can => typeof can == 'boolean' ? can : this.router.createUrlTree(can as any[]))
4444
);
4545
}
4646

@@ -55,6 +55,6 @@ export const isNotAnonymous: AuthPipe = map(user => !!user && !user.isAnonymous)
5555
export const idTokenResult = switchMap((user: User|null) => user ? user.getIdTokenResult() : of(null));
5656
export const emailVerified: AuthPipe = map(user => !!user && user.emailVerified);
5757
export const customClaims = pipe(idTokenResult, map(idTokenResult => idTokenResult ? idTokenResult.claims : []));
58-
export const hasCustomClaim = (claim:string) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim)));
58+
export const hasCustomClaim = (claim: string) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim)));
5959
export const redirectUnauthorizedTo = (redirect: any[]) => pipe(loggedIn, map(loggedIn => loggedIn || redirect));
6060
export const redirectLoggedInTo = (redirect: any[]) => pipe(loggedIn, map(loggedIn => loggedIn && redirect || true));

src/auth-guard/public_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './auth-guard';
2-
export * from './auth-guard.module';
2+
export * from './auth-guard.module';

0 commit comments

Comments
 (0)