Skip to content

Commit b6c231a

Browse files
authored
Run prettier on Auth (#6529)
1 parent fcd4b8a commit b6c231a

File tree

103 files changed

+920
-739
lines changed

Some content is hidden

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

103 files changed

+920
-739
lines changed

Diff for: .prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# This file is pre-built and need not be formatted
2-
packages/auth
32
packages/firebase/firebase*
43
packages/firestore/scripts
54
dist

Diff for: packages/auth/demo/src/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import {
8282
logAtLevel_
8383
} from './logging';
8484

85-
/**
85+
/**
8686
* Constants that are used when connecting to the Auth Emulator.
8787
*/
8888
const USE_AUTH_EMULATOR = false;
@@ -1658,7 +1658,6 @@ function initApp() {
16581658
if (USE_AUTH_EMULATOR) {
16591659
connectAuthEmulator(auth, AUTH_EMULATOR_URL);
16601660
}
1661-
16621661

16631662
tempApp = initializeApp(
16641663
{

Diff for: packages/auth/demo/src/worker/service-worker.ts

+21-25
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,16 @@ function getOriginFromUrl(url: string): string {
7676

7777
self.addEventListener('install', (event: ExtendableEvent) => {
7878
// Perform install steps.
79-
event.waitUntil(
80-
async (): Promise<void> => {
81-
const cache = await caches.open(CACHE_NAME);
82-
// Add all URLs of resources we want to cache.
83-
try {
84-
await cache.addAll(urlsToCache);
85-
} catch {
86-
// Suppress error as some of the files may not be available for the
87-
// current page.
88-
}
79+
event.waitUntil(async (): Promise<void> => {
80+
const cache = await caches.open(CACHE_NAME);
81+
// Add all URLs of resources we want to cache.
82+
try {
83+
await cache.addAll(urlsToCache);
84+
} catch {
85+
// Suppress error as some of the files may not be available for the
86+
// current page.
8987
}
90-
);
88+
});
9189
});
9290

9391
// As this is a test app, let's only return cached data when offline.
@@ -160,18 +158,16 @@ self.addEventListener('fetch', (event: FetchEvent) => {
160158
self.addEventListener('activate', (event: ExtendableEvent) => {
161159
// Update this list with all caches that need to remain cached.
162160
const cacheWhitelist = ['cache-v1'];
163-
event.waitUntil(
164-
async (): Promise<void> => {
165-
const cacheNames = await caches.keys();
166-
await Promise.all(
167-
cacheNames.map(cacheName => {
168-
// Check if cache is not whitelisted above.
169-
if (cacheWhitelist.indexOf(cacheName) === -1) {
170-
// If not whitelisted, delete it.
171-
return caches.delete(cacheName);
172-
}
173-
})
174-
);
175-
}
176-
);
161+
event.waitUntil(async (): Promise<void> => {
162+
const cacheNames = await caches.keys();
163+
await Promise.all(
164+
cacheNames.map(cacheName => {
165+
// Check if cache is not whitelisted above.
166+
if (cacheWhitelist.indexOf(cacheName) === -1) {
167+
// If not whitelisted, delete it.
168+
return caches.delete(cacheName);
169+
}
170+
})
171+
);
172+
});
177173
});

Diff for: packages/auth/demo/src/worker/web-worker.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ async function runWorkerTests(googleIdToken: string): Promise<void> {
105105
if (!userCredential.user || !userCredential.user.uid) {
106106
throw new Error('signInWithCredential unexpectedly failed!');
107107
}
108-
const googleCredential = GoogleAuthProvider.credentialFromResult(
109-
userCredential
110-
);
108+
const googleCredential =
109+
GoogleAuthProvider.credentialFromResult(userCredential);
111110
if (!googleCredential) {
112111
throw new Error('signInWithCredential unexpectedly failed!');
113112
}

Diff for: packages/auth/index.doc.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@
2828
export * from './index';
2929

3030
export { cordovaPopupRedirectResolver } from './index.cordova';
31-
export { reactNativeLocalPersistence, getReactNativePersistence } from './index.rn';
31+
export {
32+
reactNativeLocalPersistence,
33+
getReactNativePersistence
34+
} from './index.rn';

Diff for: packages/auth/index.rn.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ export const reactNativeLocalPersistence: Persistence =
6969
removeItem(...args) {
7070
// Called inline to avoid deprecation warnings on startup.
7171
return ReactNative.AsyncStorage.removeItem(...args);
72-
},
72+
}
7373
});
7474

75-
export {getReactNativePersistence};
75+
export { getReactNativePersistence };
7676

7777
export function getAuth(app: FirebaseApp = getApp()): Auth {
7878
const provider = _getProvider(app, 'auth');

0 commit comments

Comments
 (0)