Skip to content

Commit 0d0bdc1

Browse files
Prettier (#2795)
1 parent f954d2f commit 0d0bdc1

File tree

14 files changed

+213
-157
lines changed

14 files changed

+213
-157
lines changed

packages/analytics/index.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ describe('FirebaseAnalytics instance tests', () => {
6464
resetGlobalVars();
6565
app = getFakeApp(analyticsId);
6666
fidDeferred = new Deferred<void>();
67-
const installations = getFakeInstallations('fid-1234', () => fidDeferred.resolve());
67+
const installations = getFakeInstallations('fid-1234', () =>
68+
fidDeferred.resolve()
69+
);
6870

6971
window['gtag'] = gtagStub;
7072
window['dataLayer'] = [];
@@ -132,7 +134,9 @@ describe('FirebaseAnalytics instance tests', () => {
132134
resetGlobalVars();
133135
const app = getFakeApp(analyticsId);
134136
fidDeferred = new Deferred<void>();
135-
const installations = getFakeInstallations('fid-1234', () => fidDeferred.resolve());
137+
const installations = getFakeInstallations('fid-1234', () =>
138+
fidDeferred.resolve()
139+
);
136140
window[customGtagName] = gtagStub;
137141
window[customDataLayerName] = [];
138142
analyticsSettings({

packages/analytics/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import '@firebase/installations';
1919
import { FirebaseAnalytics } from '@firebase/analytics-types';
2020
import { FirebaseAnalyticsInternal } from '@firebase/analytics-interop-types';
2121
import { _FirebaseNamespace } from '@firebase/app-types/private';
22-
import { factory, settings, resetGlobalVars, getGlobalVars } from './src/factory';
22+
import {
23+
factory,
24+
settings,
25+
resetGlobalVars,
26+
getGlobalVars
27+
} from './src/factory';
2328
import { EventName } from './src/constants';
2429
import {
2530
Component,

packages/analytics/src/factory.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export function resetGlobalVars(
8888
/**
8989
* For testing
9090
*/
91-
export function getGlobalVars(): { initializedIdPromisesMap: { [gaId: string]: Promise<void> }} {
91+
export function getGlobalVars(): {
92+
initializedIdPromisesMap: { [gaId: string]: Promise<void> };
93+
} {
9294
return {
9395
initializedIdPromisesMap
9496
};

packages/analytics/src/helpers.test.ts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ describe('FirebaseAnalytics methods', () => {
8383
const initPromise1 = new Deferred<void>();
8484
const initPromise2 = new Deferred<void>();
8585
wrapOrCreateGtag(
86-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
86+
{
87+
[mockAnalyticsId]: initPromise1.promise,
88+
otherId: initPromise2.promise
89+
},
8790
'dataLayer',
8891
'gtag'
8992
);
@@ -110,7 +113,10 @@ describe('FirebaseAnalytics methods', () => {
110113
const initPromise1 = new Deferred<void>();
111114
const initPromise2 = new Deferred<void>();
112115
wrapOrCreateGtag(
113-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
116+
{
117+
[mockAnalyticsId]: initPromise1.promise,
118+
otherId: initPromise2.promise
119+
},
114120
'dataLayer',
115121
'gtag'
116122
);
@@ -138,7 +144,10 @@ describe('FirebaseAnalytics methods', () => {
138144
const initPromise1 = new Deferred<void>();
139145
const initPromise2 = new Deferred<void>();
140146
wrapOrCreateGtag(
141-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
147+
{
148+
[mockAnalyticsId]: initPromise1.promise,
149+
otherId: initPromise2.promise
150+
},
142151
'dataLayer',
143152
'gtag'
144153
);
@@ -165,7 +174,10 @@ describe('FirebaseAnalytics methods', () => {
165174
const initPromise1 = new Deferred<void>();
166175
const initPromise2 = new Deferred<void>();
167176
wrapOrCreateGtag(
168-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
177+
{
178+
[mockAnalyticsId]: initPromise1.promise,
179+
otherId: initPromise2.promise
180+
},
169181
'dataLayer',
170182
'gtag'
171183
);
@@ -249,7 +261,10 @@ describe('FirebaseAnalytics methods', () => {
249261
const initPromise1 = new Deferred<void>();
250262
const initPromise2 = new Deferred<void>();
251263
wrapOrCreateGtag(
252-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
264+
{
265+
[mockAnalyticsId]: initPromise1.promise,
266+
otherId: initPromise2.promise
267+
},
253268
'dataLayer',
254269
'gtag'
255270
);
@@ -278,7 +293,10 @@ describe('FirebaseAnalytics methods', () => {
278293
const initPromise1 = new Deferred<void>();
279294
const initPromise2 = new Deferred<void>();
280295
wrapOrCreateGtag(
281-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
296+
{
297+
[mockAnalyticsId]: initPromise1.promise,
298+
otherId: initPromise2.promise
299+
},
282300
'dataLayer',
283301
'gtag'
284302
);
@@ -312,7 +330,10 @@ describe('FirebaseAnalytics methods', () => {
312330
const initPromise1 = new Deferred<void>();
313331
const initPromise2 = new Deferred<void>();
314332
wrapOrCreateGtag(
315-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
333+
{
334+
[mockAnalyticsId]: initPromise1.promise,
335+
otherId: initPromise2.promise
336+
},
316337
'dataLayer',
317338
'gtag'
318339
);
@@ -342,7 +363,10 @@ describe('FirebaseAnalytics methods', () => {
342363
const initPromise1 = new Deferred<void>();
343364
const initPromise2 = new Deferred<void>();
344365
wrapOrCreateGtag(
345-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
366+
{
367+
[mockAnalyticsId]: initPromise1.promise,
368+
otherId: initPromise2.promise
369+
},
346370
'dataLayer',
347371
'gtag'
348372
);

packages/analytics/testing/get-fake-firebase-services.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export function getFakeInstallations(
4545
onFidResolve?: Function
4646
): FirebaseInstallations {
4747
return {
48-
getId: async () => { onFidResolve && onFidResolve(); return fid; },
48+
getId: async () => {
49+
onFidResolve && onFidResolve();
50+
return fid;
51+
},
4952
getToken: async () => 'authToken',
5053
onIdChange: () => () => undefined,
5154
delete: async () => undefined

packages/app/src/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const ERRORS: ErrorMap<AppError> = {
3636
[AppError.INVALID_APP_ARGUMENT]:
3737
'firebase.{$appName}() takes either no argument or a ' +
3838
'Firebase App instance.',
39-
[AppError.INVALID_LOG_ARGUMENT]: 'First argument to `onLog` must be null or a function.'
39+
[AppError.INVALID_LOG_ARGUMENT]:
40+
'First argument to `onLog` must be null or a function.'
4041
};
4142

4243
type ErrorParams = { [key in AppError]: { appName: string } };

packages/app/test/clientLogger.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ import { spy as Spy } from 'sinon';
2323
import './setup';
2424
import { Logger } from '@firebase/logger';
2525
import { registerCoreComponents } from '../src/registerCoreComponents';
26-
import {
27-
Component,
28-
ComponentType
29-
} from '@firebase/component';
26+
import { Component, ComponentType } from '@firebase/component';
3027

3128
declare module '@firebase/component' {
3229
interface NameServiceMapping {
@@ -86,7 +83,7 @@ describe('User Log Methods', () => {
8683
'test-shell',
8784
async () => {
8885
const logger = new Logger('@firebase/logger-test');
89-
(firebase as _FirebaseNamespace).onLog((logData) => {
86+
(firebase as _FirebaseNamespace).onLog(logData => {
9087
result = logData;
9188
});
9289
logger.info('hi');

packages/firebase/firestore/memory/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
/**
19-
* This file serves as the public entrypoint for users that import
19+
* This file serves as the public entrypoint for users that import
2020
* `firebase/firestore/memory`.
2121
*/
2222

packages/firestore/src/local/memory_persistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class MemoryPersistence implements Persistence {
8888
private _started = false;
8989

9090
readonly referenceDelegate: MemoryReferenceDelegate;
91-
91+
9292
/**
9393
* The constructor accepts a factory for creating a reference delegate. This
9494
* allows both the delegate and this instance to have strong references to

packages/installations/src/util/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface ErrorParams {
4545
};
4646
[ErrorCode.REQUEST_FAILED]: {
4747
requestName: string;
48-
[index: string] : string | number; // to make Typescript 3.8 happy
48+
[index: string]: string | number; // to make Typescript 3.8 happy
4949
} & ServerErrorData;
5050
}
5151

packages/logger/src/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface LogCallbackParams {
3434
message: string;
3535
args: unknown[];
3636
type: string;
37-
};
37+
}
3838

3939
/**
4040
* A container for all of the Logger instances

packages/logger/test/custom-logger.test.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ describe(`Custom log handler`, () => {
2828

2929
describe('Callback log level set to INFO (default)', () => {
3030
before(() => {
31-
setUserLogHandler((callbackParams) => {
31+
setUserLogHandler(callbackParams => {
3232
result = callbackParams;
3333
});
3434
});
35-
35+
3636
beforeEach(() => {
3737
result = null;
3838
spies = {
@@ -71,7 +71,12 @@ describe(`Custom log handler`, () => {
7171
// Default log level is INFO.
7272
client1.info('info message!', ['hello'], 1, { a: 3 });
7373
expect(result.message).to.equal('info message! ["hello"] 1 {"a":3}');
74-
expect(result.args).to.deep.equal(['info message!', ['hello'], 1, { a: 3 }]);
74+
expect(result.args).to.deep.equal([
75+
'info message!',
76+
['hello'],
77+
1,
78+
{ a: 3 }
79+
]);
7580
expect(result.level).to.equal('info');
7681
expect(result.type).to.equal('@firebase/test-logger');
7782
});
@@ -88,7 +93,7 @@ describe(`Custom log handler`, () => {
8893
expect(result.level).to.equal('error');
8994
expect(spies.errorSpy.called).to.be.true;
9095
});
91-
96+
9297
it('does not call custom callback when log call is not above set log level', () => {
9398
// Default log level is INFO.
9499
client1.log('message you should not see');
@@ -102,11 +107,14 @@ describe(`Custom log handler`, () => {
102107

103108
describe('Callback log level set to WARN with options', () => {
104109
before(() => {
105-
setUserLogHandler((callbackParams) => {
106-
result = callbackParams;
107-
}, { level: 'warn' });
110+
setUserLogHandler(
111+
callbackParams => {
112+
result = callbackParams;
113+
},
114+
{ level: 'warn' }
115+
);
108116
});
109-
117+
110118
beforeEach(() => {
111119
result = null;
112120
spies = {
@@ -136,7 +144,7 @@ describe(`Custom log handler`, () => {
136144
expect(result.level).to.equal('error');
137145
expect(spies.errorSpy.called).to.be.true;
138146
});
139-
147+
140148
it('does not call custom callback when log call is not above set log level', () => {
141149
client1.debug('message you should not see');
142150
expect(result).to.be.null;
@@ -158,11 +166,11 @@ describe(`Custom log handler`, () => {
158166
describe('Global log level set to VERBOSE with setLogLevel()', () => {
159167
before(() => {
160168
setLogLevel('verbose');
161-
setUserLogHandler((callbackParams) => {
169+
setUserLogHandler(callbackParams => {
162170
result = callbackParams;
163171
});
164172
});
165-
173+
166174
beforeEach(() => {
167175
result = null;
168176
spies = {
@@ -198,7 +206,7 @@ describe(`Custom log handler`, () => {
198206
expect(result.level).to.equal('error');
199207
expect(spies.errorSpy.called).to.be.true;
200208
});
201-
209+
202210
it('does not call custom callback when log call is not above set log level', () => {
203211
client1.debug('message you should not see');
204212
expect(result).to.be.null;

scripts/release/utils/npm.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ async function publishPackage(pkg, releaseType) {
6060
args = [...args, '--tag', 'next'];
6161
} else if (releaseType === 'Canary') {
6262
// Write proxy registry token for this package to .npmrc.
63-
await exec(`echo "//wombat-dressing-room.appspot.com/:_authToken=${process.env[getEnvTokenKey(pkg)]}" >> ~/.npmrc`);
63+
await exec(
64+
`echo "//wombat-dressing-room.appspot.com/:_authToken=${
65+
process.env[getEnvTokenKey(pkg)]
66+
}" >> ~/.npmrc`
67+
);
6468
args = [
6569
...args,
6670
'--tag',

0 commit comments

Comments
 (0)